doclifter.SlackBuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. # Slackware build script for doclifter
  3. # Originally written 2015 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. # - relicense as WTFPL with permission from Didier.
  9. # - update for v2.20.
  10. # - tweak README and slack-desc.
  11. # - simplify build.
  12. # - document plotutils optional dep (search for pic2plot in the man page).
  13. cd $(dirname $0) ; CWD=$(pwd)
  14. PRGNAM=doclifter
  15. VERSION=${VERSION:-2.20}
  16. BUILD=${BUILD:-1}
  17. TAG=${TAG:-_SBo}
  18. PKGTYPE=${PKGTYPE:-tgz}
  19. # We're packaging only Python scripts, so:
  20. ARCH=noarch
  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 $PRGNAM-$VERSION
  33. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  34. cd $PRGNAM-$VERSION
  35. chown -R root:root .
  36. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  37. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  38. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  39. mkdir -p $PKGDOC/html $PKG/usr/man/man1 $PKG/usr/bin
  40. for i in {doc,man}lifter; do
  41. install -m0755 $i $PKG/usr/bin
  42. gzip -9c < $i.1 > $PKG/usr/man/man1/$i.1.gz
  43. xmlto xhtml-nochunks $i.xml
  44. cp -a $i.html $PKGDOC/html
  45. done
  46. cp -a COPYING README TODO PATCHES $PKGDOC
  47. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  48. mkdir -p $PKG/install
  49. cat $CWD/slack-desc > $PKG/install/slack-desc
  50. cd $PKG
  51. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE