p4d.SlackBuild 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/bash
  2. # Slackware build script for p4d
  3. # Based on Slackbuild script for p4 by Andy Bailey <GooseYArd@gmail.com>
  4. # Written by David Sullins <david.sullins@gmail.com>
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=p4d
  7. VERSION=${VERSION:-2018.2.1740258}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  19. # the name of the created package would be, and then exit. This information
  20. # could be useful to other scripts.
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. set -e
  29. mkdir -p $TMP $PKG $OUTPUT
  30. mkdir -p $PKG/usr/bin
  31. cp $CWD/$PRGNAM $PKG/usr/bin
  32. chown root:root $PKG/usr/bin/$PRGNAM
  33. chmod 0755 $PKG/usr/bin/$PRGNAM
  34. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  35. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  36. mkdir -p $PKG/install
  37. cat $CWD/slack-desc > $PKG/install/slack-desc
  38. cd $PKG
  39. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE