hexter.SlackBuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #!/bin/bash
  2. # Slackware build script for <hexter>
  3. # Written by Michales Michaloudes korgie@gmail.com
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=hexter
  6. VERSION=${VERSION:-1.0.0}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i586 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  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 [ "$ARCH" = "i586" ]; then
  25. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "i686" ]; then
  28. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "x86_64" ]; then
  32. SLKCFLAGS="-O2 -fPIC"
  33. LIBDIRSUFFIX="64"
  34. else
  35. SLKCFLAGS="-O2"
  36. LIBDIRSUFFIX=""
  37. fi
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM-$VERSION
  43. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  44. cd $PRGNAM-$VERSION
  45. chown -R root:root .
  46. find -L . \
  47. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  48. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  49. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  50. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  51. SLKCFLAGS+=" -lm"
  52. CFLAGS="$SLKCFLAGS" \
  53. CXXFLAGS="$SLKCFLAGS" \
  54. ./configure \
  55. --prefix=/usr \
  56. --libdir=/usr/lib${LIBDIRSUFFIX} \
  57. --sysconfdir=/etc \
  58. --localstatedir=/var \
  59. --mandir=/usr/man \
  60. --build=$ARCH-slackware-linux
  61. # --with-gtk-prefix=/usr/lib/gtk-2.0 \
  62. # --with-gnu-ld \
  63. make
  64. make install DESTDIR=$PKG
  65. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  66. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  67. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  68. cp -a \
  69. AUTHORS COPYING ChangeLog INSTALL TODO README \
  70. $PKG/usr/doc/$PRGNAM-$VERSION
  71. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  72. mkdir -p $PKG/install
  73. cat $CWD/slack-desc > $PKG/install/slack-desc
  74. cd $PKG
  75. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE