ngjackspa.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #!/bin/bash
  2. # Slackware build script for ngjackspa
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211203 bkw: BUILD=2, QT=no by default.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=ngjackspa
  8. VERSION=${VERSION:-1.0}
  9. BUILD=${BUILD:-2}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  20. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  21. exit 0
  22. fi
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. if [ "$ARCH" = "i586" ]; then
  27. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  28. LIBDIRSUFFIX=""
  29. elif [ "$ARCH" = "i686" ]; then
  30. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "x86_64" ]; then
  33. SLKCFLAGS="-O2 -fPIC"
  34. LIBDIRSUFFIX="64"
  35. else
  36. SLKCFLAGS="-O2"
  37. LIBDIRSUFFIX=""
  38. fi
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM-$VERSION
  44. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  45. cd $PRGNAM-$VERSION
  46. chown -R root:root .
  47. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  48. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  49. # build options. QT=yes needs qt4 (missing from current repo as of 20211203).
  50. GTKMM="${GTKMM:-yes}"
  51. QT="${QT:-no}"
  52. # dike out the parts the user disabled
  53. [ "$GTKMM" = "no" ] && sed -i \
  54. -e '/^PROGS/s,gjackspa,,' \
  55. -e '/^MANLINKS/s,gjackspa\.1,,' \
  56. Makefile
  57. [ "$QT" = "no" ] && sed -i \
  58. -e '/^PROGS/s,qjackspa,,' \
  59. -e '/^MANLINKS/s,qjackspa\.1,,' \
  60. Makefile
  61. # strip on install
  62. sed -i -e 's,-m 0755,-s &,' Makefile
  63. DOCDIR=/usr/doc/$PRGNAM-$VERSION
  64. make \
  65. CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS -std=c++11" \
  66. docdir=$DOCDIR \
  67. prefix=/usr \
  68. mandir=/usr/man \
  69. DESTDIR=$PKG \
  70. all install install-doc
  71. # don't need this cruft
  72. rm -f $PKG/qjackspa.gdb-index $PKG/$DOCDIR/*.html
  73. cp -a NEWS README BUGS ChangeLog $PKG/$DOCDIR
  74. cat $CWD/$PRGNAM.SlackBuild > $PKG/$DOCDIR/$PRGNAM.SlackBuild
  75. mkdir -p $PKG/install
  76. sed -e "s,%GTKMM%,$GTKMM," -e "s,%QT%,$QT," \
  77. $CWD/slack-desc > $PKG/install/slack-desc
  78. if [ "${SETCAP:-yes}" = "yes" ]; then
  79. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  80. chown root:audio $PKG/usr/bin/*
  81. chmod 0750 $PKG/usr/bin/*
  82. fi
  83. cd $PKG
  84. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE