padthv1.SlackBuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. #!/bin/bash
  2. # Slackware build script for padthv1
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211205 bkw: update for 0.9.23
  6. # 20201106 bkw: update for 0.9.18
  7. # 20200114 bkw: update for 0.9.12
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=padthv1
  10. VERSION=${VERSION:-0.9.23}
  11. BUILD=${BUILD:-1}
  12. TAG=${TAG:-_SBo}
  13. PKGTYPE=${PKGTYPE:-tgz}
  14. if [ -z "$ARCH" ]; then
  15. case "$( uname -m )" in
  16. i?86) ARCH=i586 ;;
  17. arm*) ARCH=arm ;;
  18. *) ARCH=$( uname -m ) ;;
  19. esac
  20. fi
  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. if [ "$ARCH" = "i586" ]; then
  29. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf $PRGNAM-$VERSION
  46. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  50. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  51. export PATH=/usr/lib$LIBDIRSUFFIX/qt5/bin:$PATH
  52. LDFLAGS="-Wl,-s" \
  53. CFLAGS="$SLKCFLAGS" \
  54. CXXFLAGS="$SLKCFLAGS" \
  55. ./configure \
  56. --prefix=/usr \
  57. --libdir=/usr/lib${LIBDIRSUFFIX} \
  58. --sysconfdir=/etc \
  59. --localstatedir=/var \
  60. --mandir=/usr/man \
  61. --docdir=/usr/doc/$PRGNAM-$VERSION \
  62. --build=$ARCH-slackware-linux
  63. make
  64. make install DESTDIR=$PKG
  65. # I dunno what this is actually for, but as of 0.8.5 it got moved. Move
  66. # it back to where it belongs, for Slack 14.2.
  67. [ -d $PKG/usr/share/metainfo ] && \
  68. mv $PKG/usr/share/metainfo $PKG/usr/share/appdata
  69. mkdir -p $PKG/usr/man/fr.UTF-8/man1
  70. mv $PKG/usr/man/fr/man1/$PRGNAM.1.gz $PKG/usr/man/fr.UTF-8/man1/$PRGNAM.1.gz
  71. zcat $PKG/usr/man/fr.UTF-8/man1/$PRGNAM.1.gz | \
  72. iconv -f UTF-8 -t ISO-8859-1 | \
  73. gzip -9c \
  74. > $PKG/usr/man/fr/man1/$PRGNAM.1.gz
  75. # binaries already stripped, man page already gzipped. make symlink
  76. # to man page, to match the actual name of the binary.
  77. for i in man1 fr/man1 fr.UTF-8/man1; do
  78. ln -s $PRGNAM.1.gz $PKG/usr/man/$i/${PRGNAM}_jack.1.gz
  79. done
  80. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  81. cp -a AUTHORS COPYING ChangeLog README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  82. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  83. LIBLO=no
  84. LV2=no
  85. ldd $PKG/usr/bin/${PRGNAM}_jack | grep -q liblo && LIBLO=yes
  86. [ -e $PKG/usr/lib$LIBDIRSUFFIX/lv2/$PRGNAM.lv2 ] && LV2=yes
  87. mkdir -p $PKG/install
  88. sed -e "s,@LIBLO@,$LIBLO," -e "s,@LV2@,$LV2," $CWD/slack-desc \
  89. > $PKG/install/slack-desc
  90. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  91. if [ "${SETCAP:-yes}" = "yes" ]; then
  92. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  93. chown root:audio $PKG/usr/bin/${PRGNAM}_jack
  94. chmod 0750 $PKG/usr/bin/${PRGNAM}_jack
  95. fi
  96. cd $PKG
  97. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE