perl-Text-CharWidth.SlackBuild 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/bash
  2. # Slackware build script for perl-Text-CharWidth
  3. # Originally written 2014 Didier Spaier Paris, France
  4. # Now maintained by B. Watson (yalhcru@gmail.com)
  5. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  6. # 20220110 bkw:
  7. # - take over maintenance.
  8. # - simplify build.
  9. # - tweak README and slack-desc.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=perl-Text-CharWidth
  12. VERSION=${VERSION:-0.04}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. SRCNAM="$(printf $PRGNAM | cut -d- -f2-)"
  17. if [ -z "$ARCH" ]; then
  18. case "$( uname -m )" in
  19. i?86) ARCH=i586 ;;
  20. arm*) ARCH=arm ;;
  21. *) ARCH=$( uname -m ) ;;
  22. esac
  23. fi
  24. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  25. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  26. exit 0
  27. fi
  28. TMP=${TMP:-/tmp/SBo}
  29. PKG=$TMP/package-$PRGNAM
  30. OUTPUT=${OUTPUT:-/tmp}
  31. set -e
  32. rm -rf $PKG
  33. mkdir -p $TMP $PKG $OUTPUT
  34. cd $TMP
  35. rm -rf $SRCNAM-$VERSION
  36. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  37. cd $SRCNAM-$VERSION
  38. chown -R root:root .
  39. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  40. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  41. perl Makefile.PL \
  42. PREFIX=/usr \
  43. INSTALLDIRS=vendor \
  44. INSTALLVENDORMAN3DIR=/usr/man/man3
  45. make LD="cc -Wl,-s"
  46. make test
  47. make install DESTDIR=$PKG
  48. gzip -9 $PKG/usr/man/man*/*
  49. find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | \
  50. xargs rm -f || true
  51. find $PKG -depth -type d -empty -delete || true
  52. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  53. cp -a Changes README $PKG/usr/doc/$PRGNAM-$VERSION
  54. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  55. mkdir -p $PKG/install
  56. cat $CWD/slack-desc > $PKG/install/slack-desc
  57. cd $PKG
  58. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE