ledger.SlackBuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/bash
  2. # Slackware build script for ledger
  3. # Written by Lionel Young (redtricycle at gmail dot com)
  4. # Updated by simotrone (simotrone at gmail dot com)
  5. # 20220301 bkw: Modified by SlackBuilds.org, BUILD=2:
  6. # - fix conflict with utfcpp.
  7. # - don't include tools/ in the doc dir, it's upstream dev stuff.
  8. # - don't include empty /usr/share in package.
  9. # - include GLOSSARY.md in package, it looks useful.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=ledger
  12. VERSION=${VERSION:-3.2.1}
  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) ARCH=i586 ;;
  19. arm*) ARCH=arm ;;
  20. *) 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. # 20220301 bkw: no SLKCFLAGS here. cmake defaults to -O3 -fPIC, which is fine.
  28. TMP=${TMP:-/tmp/SBo}
  29. PKG=$TMP/package-$PRGNAM
  30. OUTPUT=${OUTPUT:-/tmp}
  31. set -e
  32. rm -rf $PKG
  33. mkdir -p $TMP $PKG/usr $OUTPUT
  34. cd $TMP
  35. rm -rf $PRGNAM-$VERSION
  36. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  37. cd $PRGNAM-$VERSION
  38. chown -R root:root .
  39. find -L . \
  40. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  41. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  42. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  43. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  44. patch -p1 < $CWD/CMakeLists.txt.patch
  45. patch -p1 < $CWD/boost-176.patch
  46. # 20220301 bkw: do not look for utfcpp's headers in /usr/include, use
  47. # only the bundled copy (otherwise the build breaks if utfcpp is installed).
  48. sed -i '/find_path(/s,$, NO_DEFAULT_PATH,' cmake/FindUtfcpp.cmake
  49. mkdir -p build
  50. cd build
  51. cmake \
  52. -DCMAKE_INSTALL_PREFIX=/usr \
  53. ..
  54. make # VERBOSE=1 # uncomment if needed
  55. make install/strip DESTDIR=$PKG
  56. cd ..
  57. mv $PKG/usr/share/man $PKG/usr
  58. rmdir $PKG/usr/share
  59. gzip -9 $PKG/usr/man/man*/*
  60. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/
  61. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  62. cp -a README.md doc/*.md contrib test/input/* \
  63. $PKG/usr/doc/$PRGNAM-$VERSION/
  64. mkdir -p $PKG/install
  65. cat $CWD/slack-desc > $PKG/install/slack-desc
  66. cd $PKG
  67. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE