swi-prolog.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #!/bin/sh
  2. # Slackware build script for swi prolog
  3. # written by Florian Kanngiesser (florian.kanngiesser@googlemail.com)
  4. PRGNAM=swi-prolog
  5. VERSION=${VERSION:-6.2.4}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. SRCNAM=pl
  9. if [ -z "$ARCH" ]; then
  10. case "$( uname -m )" in
  11. i?86) ARCH=i486 ;;
  12. arm*) ARCH=arm ;;
  13. *) ARCH=$( uname -m ) ;;
  14. esac
  15. fi
  16. # GMP requires gmplib.
  17. if [ "${GMP:-no}" = "no" ]; then
  18. SETGMP="out"
  19. fi
  20. CWD=$(pwd)
  21. TMP=${TMP:-/tmp/SBo}
  22. PKG=$TMP/package-$PRGNAM
  23. OUTPUT=${OUTPUT:-/tmp}
  24. if [ "$ARCH" = "i486" ]; then
  25. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "i686" ]; then
  28. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "x86_64" ]; then
  31. SLKCFLAGS="-O2 -fPIC"
  32. LIBDIRSUFFIX="64"
  33. else
  34. SLKCFLAGS="-O2"
  35. LIBDIRSUFFIX=""
  36. fi
  37. set -e
  38. rm -rf $PKG
  39. mkdir -p $TMP $PKG $OUTPUT
  40. cd $TMP
  41. rm -rf $SRCNAM-$VERSION
  42. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  43. cd $SRCNAM-$VERSION
  44. chown -R root:root .
  45. find -L . \
  46. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -perm 511 \) \
  47. -exec chmod 755 {} \; -o \
  48. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  49. -exec chmod 644 {} \;
  50. # Build with default options: In future hopefully we can build with BerkeleyDB
  51. # support (--with-db).
  52. CFLAGS="$SLKCFLAGS" \
  53. CXXFLAGS="$SLKCFLAGS" \
  54. ./configure \
  55. --prefix=/usr \
  56. --libdir=/usr/lib${LIBDIRSUFFIX} \
  57. --sysconfdir=/etc \
  58. --localstatedir=/var \
  59. --docdir=/usr/doc/$PRGNAM-$VERSION \
  60. --mandir=/usr/man \
  61. --with$SETGMP-gmp \
  62. --build=$ARCH-slackware-linux
  63. make all
  64. make install DESTDIR=$PKG
  65. cd packages
  66. CFLAGS="$SLKCFLAGS" \
  67. CXXFLAGS="$SLKCFLAGS" \
  68. ./configure \
  69. --with-cpp \
  70. --with-clib \
  71. --with-odbc \
  72. --with-table \
  73. --with-xpce \
  74. --with-sgml \
  75. --with-RDF \
  76. --with-semweb \
  77. --with-http \
  78. --with-chr \
  79. --with-clpqr \
  80. --with-nlp \
  81. --with-ssl \
  82. --with-tipc \
  83. --with-pldoc \
  84. --with-plunit \
  85. --with-zlib \
  86. --with-R \
  87. --with-protobufs \
  88. --with-PDT \
  89. --with-utf8proc \
  90. --with-archive \
  91. --without-jpl
  92. make all
  93. make install DESTDIR=$PKG
  94. cd -
  95. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  96. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  97. find $PKG/usr/man -type f -exec gzip -9 {} \;
  98. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  99. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  100. cp -a \
  101. COPYING INSTALL README* VERSION demo ReleaseNotes \
  102. $PKG/usr/doc/$PRGNAM-$VERSION
  103. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  104. mkdir -p $PKG/install
  105. cat $CWD/slack-desc > $PKG/install/slack-desc
  106. cd $PKG
  107. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}