ecl.SlackBuild 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/bin/bash
  2. # Slackware build script for ecl (embeddedable common-lisp)
  3. # Copyright 2013 Markus Hutmacher <mailing@markhu.de>
  4. #
  5. # Permission to use, copy, modify, and distribute this software for any purpose
  6. # with or without fee is hereby granted, provided that the above copyright
  7. # notice and this permission notice appear in all copies.
  8. #
  9. # THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  10. # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  11. # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  12. # AUTHORS AND COPYRIGHT HOLDERS AND THEIR CONTRIBUTORS BE LIABLE FOR ANY
  13. # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  14. # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  15. # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  16. # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  17. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  18. # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  19. cd $(dirname $0) ; CWD=$(pwd)
  20. PRGNAM=ecl
  21. VERSION=${VERSION:-21.2.1}
  22. BUILD=${BUILD:-1}
  23. TAG=${TAG:-_SBo}
  24. PKGTYPE=${PKGTYPE:-tgz}
  25. DOCS="CHANGELOG COPYING INSTALL LICENSE README.md"
  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=${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-$VERSION
  61. tar xvf $CWD/$PRGNAM-$VERSION.tgz
  62. cd $PRGNAM-$VERSION
  63. chown -R root:root .
  64. find -L . \
  65. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  66. -exec chmod 755 {} \; -o \
  67. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  68. -exec chmod 644 {} \;
  69. CFLAGS="$SLKCFLAGS" \
  70. ./configure \
  71. --prefix=/usr \
  72. --libdir=/usr/lib${LIBDIRSUFFIX} \
  73. --mandir=/usr/man \
  74. --sysconfdir=/etc \
  75. --localstatedir=/var \
  76. --build=$ARCH-slackware-linux
  77. make
  78. make install DESTDIR=$PKG
  79. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | \
  80. grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  81. find $PKG/usr/man -type f -exec gzip -9 {} \;
  82. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  83. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  84. cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
  85. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  86. mkdir -p $PKG/install
  87. cat $CWD/slack-desc > $PKG/install/slack-desc
  88. cd $PKG
  89. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE