camlp5.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #!/bin/bash
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. #
  16. # Slackware build script for camlp5
  17. # Written by adaptr (jeroen@adaptr.nl)
  18. # Rewrite for updated camlp5 Panagiotis Nikolaou, Culver City, CA
  19. cd $(dirname $0) ; CWD=$(pwd)
  20. PRGNAM=camlp5
  21. VERSION=${VERSION:-8.0}
  22. SRCVER=rel8.00.02
  23. BUILD=${BUILD:-1}
  24. TAG=${TAG:-_SBo}
  25. PKGTYPE=${PKGTYPE:-tgz}
  26. if [ -z "$ARCH" ]; then
  27. case "$( uname -m )" in
  28. i?86) ARCH=i586 ;;
  29. arm*) ARCH=arm ;;
  30. *) ARCH=$( uname -m ) ;;
  31. esac
  32. fi
  33. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  34. # the name of the created package would be, and then exit. This information
  35. # could be useful to other scripts.
  36. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  37. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  38. exit 0
  39. fi
  40. TMP=${TMP:-/tmp/SBo}
  41. PKG=$TMP/package-$PRGNAM
  42. OUTPUT=${OUTPUT:-/tmp}
  43. if [ "$ARCH" = "i586" ]; then
  44. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  45. LIBDIRSUFFIX=""
  46. elif [ "$ARCH" = "i686" ]; then
  47. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  48. LIBDIRSUFFIX=""
  49. elif [ "$ARCH" = "x86_64" ]; then
  50. SLKCFLAGS="-O2 -fPIC"
  51. LIBDIRSUFFIX="64"
  52. else
  53. SLKCFLAGS="-O2"
  54. LIBDIRSUFFIX=""
  55. fi
  56. set -e
  57. rm -rf $PKG
  58. mkdir -p $TMP $PKG $OUTPUT
  59. cd $TMP
  60. rm -rf $PRGNAM-$SRCVER
  61. tar xvf $CWD/$PRGNAM-$SRCVER.tar.gz
  62. cd $PRGNAM-$SRCVER
  63. chown -R root:root .
  64. find -L . \
  65. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  66. -o -perm 511 \) -exec chmod 755 {} \; -o \
  67. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  68. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  69. ## libdir must be under the ocaml install dir!
  70. ./configure \
  71. -prefix /usr \
  72. -libdir /usr/lib$LIBDIRSUFFIX/ocaml \
  73. -mandir /usr/man \
  74. -strict
  75. make world.opt
  76. make install DESTDIR=$PKG
  77. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  78. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  79. find $PKG/usr/man -type f -exec gzip -9 {} \;
  80. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  81. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  82. cp -a CHANGES LICENSE MODE README.md $PKG/usr/doc/$PRGNAM-$VERSION/
  83. # docs don't build correcty: revise it later
  84. ## Build TeX, PS, PDF, TeXinfo and HTML Documentation
  85. #cd doc/htmlp
  86. #
  87. #make all tex pdf ps info
  88. #cp -a camlp5.dvi camlp5.ps camlp5.pdf camlp5.tex $PKG/usr/doc/$PRGNAM-$VERSION/
  89. #
  90. #mkdir -p $PKG/usr/info
  91. #cp -a camlp5.info* $PKG/usr/info/
  92. #gzip -9 $PKG/usr/info/*.info*
  93. #
  94. #cd ..
  95. #cp -a html $PKG/usr/doc/$PRGNAM-$VERSION/
  96. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  97. mkdir -p $PKG/install
  98. cat $CWD/slack-desc > $PKG/install/slack-desc
  99. cd $PKG
  100. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE