pli.SlackBuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/bin/bash
  2. # Slackware build script for pli
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20230103 bkw: update for v0.9.10e, fix PKGTYPE mess.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=pli
  8. VERSION=${VERSION:-0.9.10e}
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. # static binary and library are for this arch.
  13. ARCH=i586
  14. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  15. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  16. exit 0
  17. fi
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  21. # wrapper/frontend script version.
  22. PLICLVER=${PLICLVER:-0.0.1}
  23. set -e
  24. rm -rf $PKG
  25. mkdir -p $TMP $PKG $OUTPUT
  26. cd $TMP
  27. rm -rf $PRGNAM-$VERSION
  28. tar xvf $CWD/$PRGNAM-$VERSION.tgz
  29. cd $PRGNAM-$VERSION
  30. chown -R root:root .
  31. # permissions are bad, please don't revert this to template.
  32. find . -type f -a -exec chmod 644 {} \+ -o -exec chmod 755 {} \+
  33. # binary-only software, no compilation, just install it where it goes.
  34. # AUR has a pli build:
  35. # https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=pli-bin
  36. # but they don't include the includes, or the ISAM stuff (libpbl),
  37. # or the alt/ dir.
  38. PKGLIB=$PKG/usr/lib
  39. PRIVLIB=$PKGLIB/$PRGNAM-$VERSION
  40. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  41. PKGMAN=$PKG/usr/man/man1
  42. mkdir -p $PKG/usr/bin $PRIVLIB $PKGDOC $PKGMAN
  43. install -s -oroot -groot -m0755 plic $PRIVLIB/plic
  44. install -oroot -groot -m0644 lib/libprf.a $PRIVLIB/libprf.a
  45. install -oroot -groot -m0644 lib/libpbl.a $PRIVLIB/libpbl.a
  46. cp -a lib/{alt,include,source} $PRIVLIB
  47. ln -s $PRGNAM-$VERSION $PKG/usr/lib/$PRGNAM
  48. ln -s ../lib/$PRGNAM/plic $PKG/usr/bin/plic
  49. ln -s $PRGNAM/libprf.a $PKGLIB/libprf.a
  50. ln -s $PRGNAM/libpbl.a $PKGLIB/libpbl.a
  51. gzip -9c < $CWD/plic.1 > $PKGMAN/plic.1.gz
  52. # wrapper script. written by the SlackBuild author, but not
  53. # Slackware-specific, so it's not kept in SBo's git repo.
  54. install -oroot -groot -m0755 $CWD/plicl-$PLICLVER $PKG/usr/bin/plicl
  55. sh $CWD/plicl-$PLICLVER --man | gzip -9c > $PKGMAN/plicl.1.gz
  56. # don't need 2 copies of the lgpl
  57. rm -f lib/lgpl.html
  58. cp -a *.gif *.pdf *.html lib/*.html samples $PKGDOC
  59. cat $CWD/README_SBo.txt > $PKGDOC/README_SBo.txt
  60. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  61. mkdir -p $PKG/install
  62. cat $CWD/slack-desc > $PKG/install/slack-desc
  63. cd $PKG
  64. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE