drumkv1.SlackBuild 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #!/bin/bash
  2. # Slackware build script for drumkv1
  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. # 20191210 bkw: update for 0.9.11, document optional liblo dep, have slack-desc
  9. # tell user whether or not optional deps are included.
  10. # 20181216 bkw: update for 0.9.4. Sadly, qt4 support was dropped.
  11. # 20180828 bkw: update for 0.9.2
  12. # 20180702 bkw: update for 0.9.1, install French man page correctly.
  13. # 20180615 bkw: update for 0.9.0
  14. # 20180101 bkw: update for 0.8.6
  15. # 20171220 bkw: updated for v0.8.5. Skipped 0.8.4 due to compile errors.
  16. # 20170627 bkw: update for 0.8.3
  17. # 20170614 bkw: update for 0.8.2, drop qt5 dep, build with qt4
  18. cd $(dirname $0) ; CWD=$(pwd)
  19. PRGNAM=drumkv1
  20. VERSION=${VERSION:-0.9.23}
  21. BUILD=${BUILD:-1}
  22. TAG=${TAG:-_SBo}
  23. PKGTYPE=${PKGTYPE:-tgz}
  24. if [ -z "$ARCH" ]; then
  25. case "$( uname -m )" in
  26. i?86) ARCH=i586 ;;
  27. arm*) ARCH=arm ;;
  28. *) ARCH=$( uname -m ) ;;
  29. esac
  30. fi
  31. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  32. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  33. exit 0
  34. fi
  35. TMP=${TMP:-/tmp/SBo}
  36. PKG=$TMP/package-$PRGNAM
  37. OUTPUT=${OUTPUT:-/tmp}
  38. if [ "$ARCH" = "i586" ]; then
  39. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  40. LIBDIRSUFFIX=""
  41. elif [ "$ARCH" = "i686" ]; then
  42. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  43. LIBDIRSUFFIX=""
  44. elif [ "$ARCH" = "x86_64" ]; then
  45. SLKCFLAGS="-O2 -fPIC"
  46. LIBDIRSUFFIX="64"
  47. else
  48. SLKCFLAGS="-O2"
  49. LIBDIRSUFFIX=""
  50. fi
  51. set -e
  52. rm -rf $PKG
  53. mkdir -p $TMP $PKG $OUTPUT
  54. cd $TMP
  55. rm -rf $PRGNAM-$VERSION
  56. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  57. cd $PRGNAM-$VERSION
  58. chown -R root:root .
  59. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  60. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  61. export PATH=/usr/lib$LIBDIRSUFFIX/qt5/bin:$PATH
  62. LDFLAGS="-Wl,-s" \
  63. CFLAGS="$SLKCFLAGS" \
  64. CXXFLAGS="$SLKCFLAGS" \
  65. ./configure \
  66. --prefix=/usr \
  67. --libdir=/usr/lib${LIBDIRSUFFIX} \
  68. --sysconfdir=/etc \
  69. --localstatedir=/var \
  70. --mandir=/usr/man \
  71. --docdir=/usr/doc/$PRGNAM-$VERSION \
  72. --build=$ARCH-slackware-linux
  73. make
  74. make install DESTDIR=$PKG
  75. # I dunno what this is actually for, but as of 0.8.5 it got moved. Move
  76. # it back to where it belongs, for Slack 14.2.
  77. [ -d $PKG/usr/share/metainfo ] && \
  78. mv $PKG/usr/share/metainfo $PKG/usr/share/appdata
  79. # See comments in synthv1.SlackBuild to understand this.
  80. mkdir -p $PKG/usr/man/fr.UTF-8/man1
  81. mv $PKG/usr/man/fr/man1/$PRGNAM.1.gz $PKG/usr/man/fr.UTF-8/man1/$PRGNAM.1.gz
  82. zcat $PKG/usr/man/fr.UTF-8/man1/$PRGNAM.1.gz | \
  83. iconv -f UTF-8 -t ISO-8859-1 | \
  84. gzip -9c \
  85. > $PKG/usr/man/fr/man1/$PRGNAM.1.gz
  86. # binaries already stripped, man page already gzipped. make symlink
  87. # to man page, to match the actual name of the binary.
  88. for i in man1 fr/man1 fr.UTF-8/man1; do
  89. ln -s $PRGNAM.1.gz $PKG/usr/man/$i/${PRGNAM}_jack.1.gz
  90. done
  91. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  92. cp -a AUTHORS COPYING ChangeLog README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  93. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  94. LIBLO=no
  95. LV2=no
  96. ldd $PKG/usr/bin/${PRGNAM}_jack | grep -q liblo && LIBLO=yes
  97. [ -e $PKG/usr/lib$LIBDIRSUFFIX/lv2/$PRGNAM.lv2 ] && LV2=yes
  98. mkdir -p $PKG/install
  99. sed -e "s,@LIBLO@,$LIBLO," -e "s,@LV2@,$LV2," $CWD/slack-desc \
  100. > $PKG/install/slack-desc
  101. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  102. if [ "${SETCAP:-yes}" = "yes" ]; then
  103. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  104. chown root:audio $PKG/usr/bin/${PRGNAM}_jack
  105. chmod 0750 $PKG/usr/bin/${PRGNAM}_jack
  106. fi
  107. cd $PKG
  108. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE