jlscp.SlackBuild 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #!/bin/bash
  2. # Slackware build script for jlscp
  3. # Written by klaatu@member.fsf.org
  4. # 20220331 bkw: Modified by SlackBuilds.org: fail if JAVA_HOME not set
  5. # and can't be set from profile.d script. This avoid creating a /jre
  6. # in the package root.
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=jlscp
  9. VERSION=${VERSION:-0.8}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. ARCH=noarch
  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.tar.bz2
  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 -o -perm 511 \) \
  31. -exec chmod 755 {} \+ -o \
  32. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  33. -exec chmod 644 {} \+
  34. if [ -z "$JAVA_HOME" ]; then
  35. source /etc/profile.d/zulu-openjdk8.sh
  36. fi
  37. if [ -z "$JAVA_HOME" ]; then
  38. cat <<EOF
  39. *** No JDK found. Install zulu-openjdk8 or another *jdk package and
  40. *** try again.
  41. EOF
  42. exit 1
  43. fi
  44. # here is the install, such as it is
  45. mkdir -p $PKG/$JAVA_HOME/jre/lib/ext
  46. cp lib/$PRGNAM.jar $PKG/$JAVA_HOME/jre/lib/ext/
  47. # docs
  48. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  49. cp -ar \
  50. doc AUTHORS COPYING ChangeLog \
  51. README examples \
  52. $PKG/usr/doc/$PRGNAM-$VERSION
  53. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  54. mkdir -p $PKG/install
  55. cat $CWD/slack-desc > $PKG/install/slack-desc
  56. cd $PKG
  57. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE