thunderpad.SlackBuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/bin/sh
  2. # Slackware build script for thunderpad
  3. # Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
  4. # Thanks to B. Watson
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version, with the following exception:
  9. # the text of the GPL license may be omitted.
  10. # This program is distributed in the hope that it will be useful, but
  11. # without any warranty; without even the implied warranty of
  12. # merchantability or fitness for a particular purpose. Compiling,
  13. # interpreting, executing or merely reading the text of the program
  14. # may result in lapses of consciousness and/or very being, up to and
  15. # including the end of all existence and the Universe as we know it.
  16. # See the GNU General Public License for more details.
  17. # You may have received a copy of the GNU General Public License
  18. # along with this program (most likely, a file named COPYING). If
  19. # not, see <http://www.gnu.org/licenses/>.
  20. PRGNAM=thunderpad
  21. SRCNAM=Thunderpad
  22. VERSION=${VERSION:-20150716}
  23. SRCVERSION=${SRCVERSION:-5d3cbbc3d885fc5eabf0c2e50f25c76403706c08}
  24. BUILD=${BUILD:-1}
  25. TAG=${TAG:-_SBo}
  26. DOCS="contributors.txt license.txt readme.md"
  27. if [ -z "$ARCH" ]; then
  28. case "$( uname -m )" in
  29. i?86) ARCH=i486 ;;
  30. arm*) ARCH=arm ;;
  31. *) ARCH=$( uname -m ) ;;
  32. esac
  33. fi
  34. CWD=$(pwd)
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "i486" ]; then
  39. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "i686" ]; then
  42. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "x86_64" ]; then
  45. SLKCFLAGS="-O2 -fPIC"
  46. LIBDIRSUFFIX="64"
  47. else
  48. SLKCFLAGS="-O2"
  49. LIBDIRSUFFIX=""
  50. fi
  51. set -eu
  52. rm -rf $PKG
  53. mkdir -pv $TMP $PKG $OUTPUT
  54. cd $TMP
  55. rm -rf $SRCNAM-$SRCVERSION
  56. if [ -e $CWD/$SRCVERSION.tar.gz ]; then
  57. tar xvf $CWD/$SRCVERSION.tar.gz
  58. else
  59. tar xvf $CWD/$SRCNAM-$SRCVERSION.tar.gz
  60. fi
  61. cd $SRCNAM-$SRCVERSION
  62. chown -R root:root .
  63. find -L . \
  64. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  65. -o -perm 511 \) -exec chmod 755 {} \; -o \
  66. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  67. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  68. ## remove CR line endings
  69. sed -i 's,\r,,' data/linux/$PRGNAM.desktop *.txt *.md
  70. mkdir -p build
  71. cd build
  72. qmake \
  73. PREFIX=/usr \
  74. LIBDIR=/usr/lib${LIBDIRSUFFIX} \
  75. QMAKE_CFLAGS="$SLKCFLAGS" \
  76. QMAKE_CXXFLAGS="$SLKCFLAGS" \
  77. ../thunderpad.pro CONFIG+=release
  78. make \
  79. OPTS="$SLKCFLAGS" \
  80. LIBDIR=/usr/lib${LIBDIRSUFFIX} \
  81. PREFIX=/usr
  82. make install \
  83. INSTALL_ROOT=$PKG \
  84. DESTDIR=$PKG
  85. cd ../
  86. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  87. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  88. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  89. mkdir -p $PKG/install
  90. cat $CWD/slack-desc > $PKG/install/slack-desc
  91. cd $PKG
  92. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}