gambit.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #!/bin/bash
  2. # Slackware build script for gambit
  3. # Written by Brian P. O'Hanlon <brainpo -at- gmail.com>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM="gambit"
  6. VERSION=${VERSION:-4.6.8}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. SOURCE_BASE="gambc-v$(echo $VERSION | tr \. _)-devel"
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i486 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. if [ "$ARCH" = "i486" ]; then
  29. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. #rm -rf $PRGNAM-$VERSION
  46. rm -rf $SOURCE_BASE
  47. tar xvf $CWD/${SOURCE_BASE}.tgz
  48. cd $SOURCE_BASE
  49. chown -R root:root .
  50. find -L . \
  51. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  52. -exec chmod 755 {} \; -o \
  53. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  54. -exec chmod 644 {} \;
  55. CFLAGS="$SLKCFLAGS" \
  56. CXXFLAGS="$SLKCFLAGS" \
  57. ./configure \
  58. --prefix=/usr \
  59. --libdir=/usr/lib${LIBDIRSUFFIX} \
  60. --mandir=/usr/man \
  61. --docdir=/usr/doc/$PRGNAM-$VERSION \
  62. --enable-single-host \
  63. --build=$ARCH-slackware-linux
  64. make bootstrap
  65. make bootclean
  66. make
  67. make check
  68. make install docdir=/usr/doc/$PRGNAM-$VERSION DESTDIR=$PKG
  69. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  70. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  71. find $PKG/usr/man -type f -exec gzip -9 {} \;
  72. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  73. rm -f $PKG/usr/info/dir
  74. gzip -9 $PKG/usr/info/*.info*
  75. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  76. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  77. mkdir -p $PKG/install
  78. cat $CWD/slack-desc > $PKG/install/slack-desc
  79. cd $PKG
  80. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE