ntk.SlackBuild 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. # Slackware build script for non
  3. # Copyright 2013-22 Klaatu @ member.fsf.org
  4. # GNU All-Permissive License
  5. # Copying and distribution of this file, with or without modification,
  6. # are permitted in any medium without royalty provided the copyright
  7. # notice and this notice are preserved. This file is offered as-is,
  8. # without any warranty.
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=ntk
  11. VERSION=${VERSION:-1.3.1001}
  12. BUILD=${BUILD:-1}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i486 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  22. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  23. # the name of the created package would be, and then exit. This information
  24. # could be useful to other scripts.
  25. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  26. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  27. exit 0
  28. fi
  29. TMP=${TMP:-/tmp/SBo}
  30. PKG=$TMP/package-$PRGNAM
  31. OUTPUT=${OUTPUT:-/tmp}
  32. if [ "$ARCH" = "i486" ]; then
  33. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "i686" ]; then
  36. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  37. LIBDIRSUFFIX=""
  38. elif [ "$ARCH" = "x86_64" ]; then
  39. SLKCFLAGS="-O2 -fPIC"
  40. LIBDIRSUFFIX="64"
  41. else
  42. SLKCFLAGS="-O2"
  43. LIBDIRSUFFIX=""
  44. fi
  45. set -e
  46. rm -rf $PKG
  47. mkdir -p $TMP $PKG $OUTPUT
  48. cd $TMP
  49. rm -rf $PRGNAM
  50. TARBALL=$CWD/v"${VERSION}".tar.gz
  51. if [ ! -e "$TARBALL" ] ; then
  52. TARBALL=$CWD/$PRGNAM-v"${VERSION}".tar.gz
  53. fi
  54. tar xvf "$TARBALL"
  55. cd $PRGNAM
  56. chown -R root:root .
  57. find -L . \
  58. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  59. -o -perm 511 \) -exec chmod 755 {} \; -o \
  60. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  61. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  62. ./waf configure \
  63. --prefix=/usr \
  64. --libdir=/usr/lib${LIBDIRSUFFIX} \
  65. --sysconfdir=/etc \
  66. --localstatedir=/var \
  67. --mandir=/usr/man \
  68. --docdir=/usr/doc/$PRGNAM-$VERSION
  69. ./waf
  70. ./waf install --destdir=$PKG
  71. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  72. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  73. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  74. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  75. mkdir -p $PKG/install
  76. cat $CWD/slack-desc > $PKG/install/slack-desc
  77. cd $PKG
  78. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE