xtrlock.SlackBuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # Slackware build script for xtrlock
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20210219 bkw: updated for v2.15.
  6. # 20201208 bkw: updated for v2.14, although the only changes
  7. # since 2.13 are in the debian packagaing (which we don't/can't
  8. # use). Basically just updating it to avoid people asking for it to
  9. # be updated.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=xtrlock
  12. VERSION=${VERSION:-2.15}
  13. BUILD=${BUILD:-1}
  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. 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.xz
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  52. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  53. # work around slack 14.2 bug (only happens when upgrading from 14.2):
  54. touch host.def
  55. xmkmf -a
  56. make
  57. make install install.man DESTDIR=$PKG CCOPTIONS="$SLKCFLAGS -DSHADOW_PWD"
  58. for i in $PKG/usr/bin/$PRGNAM; do
  59. strip $i
  60. chown root:shadow $i
  61. chmod 2751 $i
  62. done
  63. gzip -9 $PKG/usr/man/man1/$PRGNAM.1x
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a *.txt $PKG/usr/doc/$PRGNAM-$VERSION
  66. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  67. mkdir -p $PKG/install
  68. cat $CWD/slack-desc > $PKG/install/slack-desc
  69. cd $PKG
  70. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE