perl-Proc-Daemon.SlackBuild 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/bash
  2. # Slackware build script for perl-Proc-Daemon
  3. # Written by Thomas Morper <thomas@beingboiled.info>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=perl-Proc-Daemon
  6. VERSION=${VERSION:-0.21}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. SRCNAM=$(echo $PRGNAM | cut -f2- -d-)
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i486 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. set -e
  29. rm -rf $PKG
  30. mkdir -p $TMP $PKG $OUTPUT
  31. cd $TMP
  32. rm -rf $SRCNAM-$VERSION
  33. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  34. cd $SRCNAM-$VERSION
  35. chown -R root:root .
  36. find -L . \
  37. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  38. -exec chmod 755 {} \; -o \
  39. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  40. -exec chmod 644 {} \;
  41. perl Makefile.PL \
  42. PREFIX=/usr \
  43. INSTALLDIRS=vendor \
  44. INSTALLVENDORMAN1DIR=/usr/man/man1 \
  45. INSTALLVENDORMAN3DIR=/usr/man/man3
  46. make
  47. #make test # requires Proc::ProcessTable for Proc::Daemon > 0.14
  48. make install DESTDIR=$PKG
  49. find $PKG/usr/man -type f -exec gzip -9 {} \;
  50. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  51. find $PKG -name "perllocal.pod" -o -name ".packlist" -o -name "*.bs" -empty | xargs rm -f || true
  52. find $PKG -depth -type d -empty -delete || true
  53. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  54. cp -a \
  55. Changes MANIFEST \
  56. $PKG/usr/doc/$PRGNAM-$VERSION
  57. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  58. mkdir -p $PKG/install
  59. cat $CWD/slack-desc > $PKG/install/slack-desc
  60. cd $PKG
  61. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE