vlna.SlackBuild 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. # Slackware build script for vlna
  3. # Petr Kletecka petr@kle.cz <2014>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=vlna
  6. VERSION=${VERSION:-1.5}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i586 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  18. # the name of the created package would be, and then exit. This information
  19. # could be useful to other scripts.
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. set -e
  28. rm -rf $PKG
  29. mkdir -p $TMP $PKG $OUTPUT
  30. cd $TMP
  31. rm -rf $PRGNAM-$VERSION
  32. tar xf $CWD/${PRGNAM}-${VERSION}.tar.gz
  33. cd $PRGNAM-$VERSION
  34. chown -R root:root .
  35. find -L . \
  36. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  37. -o -perm 511 \) -exec chmod 755 {} \; -o \
  38. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  39. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  40. CFLAGS="$SLKCFLAGS" \
  41. CXXFLAGS="$SLKCFLAGS" \
  42. ./configure \
  43. --prefix=/usr \
  44. --libdir=/usr/lib${LIBDIRSUFFIX} \
  45. --sysconfdir=/etc \
  46. --localstatedir=/var \
  47. --mandir=/usr/man \
  48. --docdir=/usr/doc/$PRGNAM-$VERSION \
  49. --build=$ARCH-slackware-linux
  50. make
  51. make DESTDIR=$PKG install
  52. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  53. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  54. mkdir -p $PKG/usr/share/doc/${PRGNAM}-${VERSION}/
  55. cat README > $PKG/usr/share/doc/${PRGNAM}-${VERSION}/README
  56. cat README.en > $PKG/usr/share/doc/${PRGNAM}-${VERSION}/README.en
  57. cat ChangeLog > $PKG/usr/share/doc/${PRGNAM}-${VERSION}/ChangeLog
  58. find $PKG/usr/man -type f -exec gzip -9 {} \;
  59. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  60. mkdir -p $PKG/install
  61. cat $CWD/slack-desc > $PKG/install/slack-desc
  62. cd $PKG
  63. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE