beancount.SlackBuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. # Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
  3. # Copyright 2009-2010 Eric Hameleers, Eindhoven, Netherlands
  4. # Slackware build script for beancount
  5. # Written by Lionel Young <redtricycle@gmail.com>
  6. # Based on http://slackbuilds.org/template.SlackBuild
  7. # 20220301 bkw: Modified by SlackBuilds.org, BUILD=2:
  8. # - remove 0-byte placeholder in doc dir.
  9. # - i486 => i586.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=beancount
  12. VERSION=${VERSION:-1.0}
  13. BUILD=${BUILD:-2}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) export ARCH=i586 ;;
  19. arm*) export ARCH=arm ;;
  20. *) export ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  24. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  25. exit 0
  26. fi
  27. TMP=${TMP:-/tmp/SBo}
  28. PKG=$TMP/package-$PRGNAM
  29. OUTPUT=${OUTPUT:-/tmp}
  30. if [ "$ARCH" = "i586" ]; then
  31. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "i686" ]; then
  34. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "x86_64" ]; then
  37. SLKCFLAGS="-O2 -fPIC"
  38. LIBDIRSUFFIX="64"
  39. else
  40. SLKCFLAGS="-O2"
  41. LIBDIRSUFFIX=""
  42. fi
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $PRGNAM-$VERSION
  48. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  49. cd $PRGNAM-$VERSION
  50. # Permissions
  51. chown -R root:root .
  52. find -L . \
  53. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  54. -exec chmod 755 {} \+ -o \
  55. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  56. -exec chmod 644 {} \+
  57. # Ensure header images and style sheet is included by bean-web
  58. patch -p1 --verbose < $CWD/beancount_web_fix.diff
  59. # Build and install
  60. python setup.py build
  61. python setup.py install --root=$PKG
  62. # Documentation
  63. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  64. cp -a \
  65. COPYING CHANGES README TODO \
  66. $PKG/usr/doc/$PRGNAM-$VERSION
  67. cp -aR \
  68. index.html style.css doc examples \
  69. $PKG/usr/doc/$PRGNAM-$VERSION
  70. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  71. # 20220404 bkw: 0-byte placeholder
  72. rm -f $PKG/usr/doc/$PRGNAM-$VERSION/examples/.keep
  73. # Install
  74. mkdir -p $PKG/install
  75. cat $CWD/slack-desc > $PKG/install/slack-desc
  76. cd $PKG
  77. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE