zita-ajbridge.SlackBuild 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. # Slackware build script for zita-ajbridge
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20201104 bkw: updated for v0.8.4
  6. # 20191202 bkw: updated for v0.8.2
  7. # 20170122 bkw: updated for v0.7.0
  8. # 20151105 bkw: updated for v0.6.0, which now has man pages, so
  9. # got rid of the ones I wrote.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=zita-ajbridge
  12. VERSION=${VERSION:-0.8.4}
  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.bz2
  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. # Makefile in 0.6.0 doesn't create these:
  54. mkdir -p $PKG/usr/bin $PKG/usr/man/man1
  55. sed -i "s,-O2,$SLKCFLAGS," source/Makefile
  56. make -C source PREFIX=/usr MANDIR=/usr/man/man1 DESTDIR=$PKG all install
  57. strip $PKG/usr/bin/*
  58. # use symlinks instead of groff "so" mess
  59. for i in a2j j2a; do
  60. rm -f $PKG/usr/man/man1/zita-$i.1.gz
  61. ln -s $PRGNAM.1.gz $PKG/usr/man/man1/zita-$i.1.gz
  62. done
  63. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  64. cp -a README AUTHORS COPYING $PKG/usr/doc/$PRGNAM-$VERSION
  65. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  66. mkdir -p $PKG/install
  67. cat $CWD/slack-desc > $PKG/install/slack-desc
  68. # Only add capability stuff if not disabled:
  69. if [ "${SETCAP:-yes}" = "yes" ]; then
  70. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  71. # Only allow execution by audio group
  72. chown root:audio $PKG/usr/bin/*
  73. chmod 0750 $PKG/usr/bin/*
  74. fi
  75. cd $PKG
  76. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE