verbiste.SlackBuild 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. #
  3. # Didier Charles 2011.05.21
  4. # dcharles@alumni.concordia.ca
  5. # written with the grateful assistance of the tutorial
  6. # "Writing A SlackBuild Script" at :
  7. # http://www.slackwiki.org/Writing_A_SlackBuild_Script
  8. # and with the guidance of the templates at:
  9. # http://slackbuilds.org/templates/
  10. #
  11. cd $(dirname $0) ; CWD=$(pwd)
  12. PRGNAM=verbiste
  13. VERSION=${VERSION:-0.1.40}
  14. BUILD=${BUILD:-1}
  15. TAG=${TAG:-_SBo}
  16. PKGTYPE=${PKGTYPE:-tgz}
  17. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  18. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  19. exit 0
  20. fi
  21. TMP=${TMP:-/tmp/SBo}
  22. PKG=$TMP/package-$PRGNAM
  23. OUTPUT=${OUTPUT:-/tmp}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i586 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. if [ "$ARCH" = "i586" ]; then
  32. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "i686" ]; then
  35. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "x86_64" ]; then
  38. SLKCFLAGS="-O2 -fPIC"
  39. LIBDIRSUFFIX="64"
  40. else
  41. SLKCFLAGS="-O2"
  42. LIBDIRSUFFIX=""
  43. fi
  44. set -e
  45. rm -rf $PKG
  46. mkdir -p $TMP $PKG $OUTPUT
  47. cd $TMP
  48. rm -rf $PRGNAM-$VERSION
  49. tar xvf $CWD/${PRGNAM}_$VERSION.orig.tar.gz
  50. cd $PRGNAM-$VERSION
  51. chown -R root:root .
  52. find -L . \
  53. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  54. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  55. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  56. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  57. CFLAGS="$SLKCFLAGS" \
  58. CXXFLAGS="$SLKCFLAGS -std=c++11" \
  59. ./configure \
  60. --prefix=/usr/ \
  61. --sysconfdir=/etc \
  62. --localstatedir=/var \
  63. --libdir=/usr/lib$LIBDIRSUFFIX \
  64. --with-gtk-app \
  65. --without-gnome-app \
  66. --build=$ARCH-slackware-linux
  67. make
  68. make install-strip DESTDIR=$PKG
  69. mkdir -p $PKG/usr/share/applications/
  70. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  71. mv $PKG/usr/share/doc/ $PKG/usr/
  72. find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chmod 644 {} \;
  73. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  74. mv $PKG/usr/share/man $PKG/usr/
  75. find $PKG/usr/man -type f -exec gzip -9 {} \;
  76. rm -f $PKG/usr/lib*/*.la
  77. mkdir -p $PKG/install
  78. cat $CWD/slack-desc > $PKG/install/slack-desc
  79. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE