coq.SlackBuild 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/bin/sh
  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 coq
  17. # Written by William Bowman (wilbowma@indiana.edu)
  18. PRGNAM=coq
  19. VERSION=${VERSION:-8.3pl2}
  20. BUILD=${BUILD:-1}
  21. TAG=${TAG:-_SBo}
  22. if [ -z "$ARCH" ]; then
  23. case "$( uname -m )" in
  24. i?86) ARCH=i486 ;;
  25. arm*) ARCH=arm ;;
  26. *) ARCH=$( uname -m ) ;;
  27. esac
  28. fi
  29. CWD=$(pwd)
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. # This is built using the ocaml compiler, not GCC, so SLKCFLAGS are
  34. # not used.
  35. if [ "$ARCH" = "i486" ]; then
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "i686" ]; then
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "x86_64" ]; then
  40. LIBDIRSUFFIX="64"
  41. else
  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.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 -o -perm 511 \) \
  54. -exec chmod 755 {} \; -o \
  55. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  56. -exec chmod 644 {} \;
  57. if hash ocamlopt || hash ocamlopt.opt ; then
  58. OPT="-opt"
  59. else
  60. OPT=""
  61. fi
  62. ./configure \
  63. -prefix /usr \
  64. -libdir /usr/lib${LIBDIRSUFFIX}/coq \
  65. -arch $ARCH \
  66. $OPT
  67. make world
  68. umask 022
  69. COQINSTALLPREFIX=$PKG make install
  70. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  71. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  72. find $PKG/usr/man -type f -exec gzip -9 {} \;
  73. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  74. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  75. cp -a \
  76. CHANGES COMPATIBILITY COPYRIGHT CREDITS INSTALL* LICENSE README* \
  77. $PKG/usr/doc/$PRGNAM-$VERSION
  78. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  79. zcat $CWD/gpl.txt.gz > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM-SlackBuild-license
  80. mkdir -p $PKG/install
  81. cat $CWD/slack-desc > $PKG/install/slack-desc
  82. # Delete this if they don't have emacs. I don't like needless things
  83. if [ `which emacs | grep "no emacs"` ]; then
  84. rm -rf $PKG/usr/lib${LIBDIRSUFFIX}/emacs
  85. fi
  86. cd $PKG
  87. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}