txt2regex.SlackBuild 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. # Slackware build script for txt2regex
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=txt2regex
  7. VERSION=${VERSION:-0.9}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. ARCH=noarch
  12. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  13. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  14. exit 0
  15. fi
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. set -e
  20. rm -rf $PKG
  21. mkdir -p $TMP $PKG $OUTPUT
  22. cd $TMP
  23. rm -rf $PRGNAM-$VERSION
  24. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  25. cd $PRGNAM-$VERSION
  26. chown -R root:root .
  27. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  28. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  29. # There's a MANDIR in the Makefile, but nothing uses it. Have to
  30. # install the man page, er, manually.
  31. make install DESTDIR=$PKG
  32. mkdir -p $PKG/usr/man/man1
  33. gzip -9c < man/$PRGNAM.man > $PKG/usr/man/man1/$PRGNAM.1.gz
  34. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  35. chmod -x tests/regex-tester.sh # no +x files in the doc dir!
  36. gzip -9 tests/regex-tester.txt # 116KB => 10KB
  37. cp -a *.md COPYRIGHT TODO tests man/*.html $PKG/usr/doc/$PRGNAM-$VERSION
  38. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  39. mkdir -p $PKG/install
  40. cat $CWD/slack-desc > $PKG/install/slack-desc
  41. cd $PKG
  42. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE