perl-Module-Implementation.SlackBuild 1.9 KB

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