aces-dev.SlackBuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/bin/bash
  2. # Slackware build script for aces-dev
  3. # Copyright 2016-22 Klaatu <klaatu@member.fsf.org>
  4. # All rights reserved.
  5. #
  6. # GNU All-Permissive License
  7. # Copying and distribution of this file, with or without modification,
  8. # are permitted in any medium without royalty provided the copyright
  9. # notice and this notice are preserved. This file is offered as-is,
  10. # without any warranty.
  11. cd $(dirname $0) ; CWD=$(pwd)
  12. PRGNAM=aces-dev
  13. VERSION=${VERSION:-1.3}
  14. BUILD=${BUILD:-1}
  15. DOCDIR=${DOCDIR:-1}
  16. TAG=${TAG:-_SBo}
  17. PKGTYPE=${PKGTYPE:-tgz}
  18. ARCH="noarch"
  19. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  20. # the name of the created package would be, and then exit. This information
  21. # could be useful to other scripts.
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. ARCH=${ARCH:-noarch}
  30. set -e
  31. rm -rf $PKG
  32. mkdir -p $TMP $PKG $OUTPUT
  33. cd $TMP
  34. rm -rf $PRGNAM-$VERSION
  35. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  36. cd $PRGNAM-$VERSION
  37. chown -R root:root .
  38. find -L . \
  39. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  40. -o -perm 511 \) -exec chmod 755 {} \; -o \
  41. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  42. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  43. PREFIX=${PREFIX:-/usr}
  44. mkdir -p $PKG/$PREFIX/bin
  45. find . -type f -name "*.py" -exec install -D -m 0755 {} $PKG/$PREFIX/bin/ \;
  46. find . -type f -name "*.csh" -exec install -D -m 0755 {} $PKG/$PREFIX/bin/ \;
  47. ## install utilities
  48. install -D transforms/renameCTL.py $PKG/usr/bin
  49. mkdir -p $PKG/usr/share/$PRGNAM-$VERSION
  50. rsync -av formats $PKG/usr/share/$PRGNAM-$VERSION/
  51. rsync -av transforms/ctl $PKG/usr/share/$PRGNAM-$VERSION/
  52. rsync -av images $PKG/usr/share/$PRGNAM-$VERSION/
  53. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  54. cp -a CHANGELOG.md LICENSE.md README.md $PKG/usr/doc/$PRGNAM-$VERSION
  55. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  56. mkdir -p $PKG/install
  57. cat $CWD/slack-desc > $PKG/install/slack-desc
  58. cd $PKG
  59. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE