anki.SlackBuild 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. # Slackware build script for anki
  3. # Written by Giuseppe Scalzi <giuseppe[at]osgate[dot]org>
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=anki
  6. VERSION=${VERSION:-2.1.16}
  7. BUILD=${BUILD:-1}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. ARCH="noarch"
  11. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  12. # the name of the created package would be, and then exit. This information
  13. # could be useful to other scripts.
  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. set -e
  22. rm -rf $PKG
  23. mkdir -p $TMP $PKG $OUTPUT
  24. cd $TMP
  25. rm -rf $PRGNAM-$VERSION
  26. tar xvf $CWD/$PRGNAM-$VERSION-source.tgz
  27. cd $PRGNAM-$VERSION
  28. chown -R root:root .
  29. find -L . \
  30. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  31. -o -perm 511 \) -exec chmod 755 {} \; -o \
  32. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  33. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  34. DESTDIR=$PKG make install
  35. # Move the man file to the correct directory and gzip it
  36. mv $PKG/usr/share/man/ $PKG/usr/man
  37. find $PKG/usr/man -type f -exec gzip -9 {} \;
  38. # `make install` puts the docs in the wrong place for Slackware
  39. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  40. mv $PKG/usr/share/doc/anki/* $PKG/usr/doc/$PRGNAM-$VERSION
  41. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  42. mkdir -p $PKG/install
  43. cat $CWD/slack-desc > $PKG/install/slack-desc
  44. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  45. cd $PKG
  46. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE