llcon.SlackBuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/sh
  2. # Slackware build script for llcon
  3. # Written by otzy_007 <oz@oprod.net
  4. PRGNAM=llcon
  5. VERSION=${VERSION:-3.1.2}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. # Automatically determine the architecture we're building on:
  9. if [ -z "$ARCH" ]; then
  10. case "$( uname -m )" in
  11. i?86) ARCH=i486 ;;
  12. arm*) ARCH=arm ;;
  13. # Unless $ARCH is already set, use uname -m for all other archs:
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. CWD=$(pwd)
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  21. if [ "$ARCH" = "i486" ]; then
  22. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  23. LIBDIRSUFFIX=""
  24. elif [ "$ARCH" = "i686" ]; then
  25. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "x86_64" ]; then
  28. SLKCFLAGS="-O2 -fPIC"
  29. LIBDIRSUFFIX="64"
  30. else
  31. SLKCFLAGS="-O2"
  32. LIBDIRSUFFIX=""
  33. fi
  34. set -e
  35. rm -rf $PKG
  36. mkdir -p $TMP $PKG $OUTPUT
  37. cd $TMP
  38. rm -rf $PRGNAM-$VERSION
  39. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  40. cd $PRGNAM-$VERSION
  41. chown -R root:root .
  42. find . \
  43. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  44. -exec chmod 755 {} \; -o \
  45. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  46. -exec chmod 644 {} \;
  47. CFLAGS="$SLKCFLAGS" \
  48. CXXFLAGS="$SLKCFLAGS" \
  49. ./configure \
  50. --prefix=/usr \
  51. --libdir=/usr/lib${LIBDIRSUFFIX} \
  52. --sysconfdir=/etc \
  53. --localstatedir=/var \
  54. --mandir=/usr/man \
  55. --docdir=/usr/doc/$PRGNAM-$VERSION \
  56. --build=$ARCH-slackware-linux
  57. make
  58. make install DESTDIR=$PKG
  59. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  60. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  61. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  62. cp -a \
  63. README NEWS AUTHORS COPYING TODO ChangeLog INSTALL \
  64. $PKG/usr/doc/$PRGNAM-$VERSION
  65. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  66. find $PKG/usr/doc -type f -exec chmod 0644 {} \;
  67. mkdir -p $PKG/install
  68. cat $CWD/slack-desc > $PKG/install/slack-desc
  69. cd $PKG
  70. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}