perl-Unicode-LineBreak.SlackBuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. # Slackware build script for perl-Unicode-LineBreak
  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-Unicode-LineBreak
  12. VERSION=${VERSION:-2019.001}
  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. if [ "$ARCH" = "i586" ]; then
  32. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "i686" ]; then
  35. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "x86_64" ]; then
  38. SLKCFLAGS="-O2 -fPIC"
  39. LIBDIRSUFFIX="64"
  40. else
  41. SLKCFLAGS="-O2"
  42. LIBDIRSUFFIX=""
  43. fi
  44. set -e
  45. rm -rf $PKG
  46. mkdir -p $TMP $PKG $OUTPUT
  47. cd $TMP
  48. rm -rf $SRCNAM-$VERSION
  49. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  50. cd $SRCNAM-$VERSION
  51. chown -R root:root .
  52. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  53. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  54. perl Makefile.PL --with-bundled-sombok --disable-libthai \
  55. PREFIX=/usr \
  56. INSTALLDIRS=vendor \
  57. INSTALLVENDORMAN3DIR=/usr/man/man3
  58. make LD="cc -Wl,-s"
  59. make test
  60. make install DESTDIR=$PKG
  61. gzip -9 $PKG/usr/man/man*/*
  62. find $PKG -name perllocal.pod -o -name ".packlist" -o -name "*.bs" | \
  63. xargs rm -f || true
  64. find $PKG -depth -type d -empty -delete || true
  65. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  66. cp -a ARTISTIC Changes Changes.REL1 GPL README Todo.REL1 $PKG/usr/doc/$PRGNAM-$VERSION
  67. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE