qjackctl.SlackBuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #!/bin/bash
  2. # Slackware build script for "qjackctl".
  3. # Copyright 2009, Erik W. Hanson, Minneapolis, MN, USA
  4. # Copyright 2012, James M. Brewster, Baltimore, MD, USA
  5. # Copyright 2014-2016 Marcel Saegebarth <email removed>
  6. # Copyright 2020 B. Watson
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  16. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  18. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25. # 20230106 bkw: update for v0.9.9.
  26. # 20220614 bkw: update for v0.9.7.
  27. # 20211126 bkw:
  28. # - update for v0.9.5.
  29. # - use cmake (got reports that autotools builds don't run correctly).
  30. # - get rid of 14.2 french man page support.
  31. # - actually use SLKCFLAGS.
  32. # - old-style icon (symlink really).
  33. # 20210306 bkw: update for v0.9.1.
  34. # 20201218 bkw: update for v0.9.0.
  35. # 20200204 bkw:
  36. # - take over maintenance
  37. # - update for v0.6.1
  38. # - fix French man page
  39. cd $(dirname $0) ; CWD=$(pwd)
  40. PRGNAM=qjackctl
  41. VERSION=${VERSION:-0.9.9}
  42. BUILD=${BUILD:-1}
  43. TAG=${TAG:-_SBo}
  44. PKGTYPE=${PKGTYPE:-tgz}
  45. if [ -z "$ARCH" ]; then
  46. case "$( uname -m )" in
  47. i?86) ARCH=i586 ;;
  48. arm*) ARCH=arm ;;
  49. *) ARCH=$( uname -m ) ;;
  50. esac
  51. fi
  52. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  53. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  54. exit 0
  55. fi
  56. TMP=${TMP:-/tmp/SBo}
  57. PKG=$TMP/package-$PRGNAM
  58. OUTPUT=${OUTPUT:-/tmp}
  59. # cmake's gotten smart enough to deduce lib/lib64, so no need for LIBDIRSUFFIX.
  60. if [ "$ARCH" = "i586" ]; then
  61. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  62. elif [ "$ARCH" = "i686" ]; then
  63. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  64. elif [ "$ARCH" = "x86_64" ]; then
  65. SLKCFLAGS="-O2 -fPIC"
  66. else
  67. SLKCFLAGS="-O2"
  68. fi
  69. set -eu
  70. rm -rf $PKG
  71. mkdir -p $TMP $PKG $OUTPUT
  72. cd $TMP
  73. rm -rf $PRGNAM-$VERSION
  74. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  75. cd $PRGNAM-$VERSION
  76. chown -R root:root .
  77. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  78. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  79. SLKCFLAGS+=" -DNDEBUG"
  80. mkdir -p build
  81. cd build
  82. cmake \
  83. -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
  84. -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS" \
  85. -DCMAKE_INSTALL_PREFIX=/usr \
  86. -DCMAKE_INSTALL_MANDIR=/usr/man \
  87. -DCMAKE_BUILD_TYPE=Release ..
  88. make VERBOSE=1
  89. make install/strip DESTDIR=$PKG
  90. cd ..
  91. gzip $PKG/usr/man/*/man1/* $PKG/usr/man/man1/*
  92. mkdir -p $PKG/usr/share/pixmaps
  93. ln -s ../icons/hicolor/32x32/apps/org.rncbc.qjackctl.png \
  94. $PKG/usr/share/pixmaps/$PRGNAM.png
  95. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  96. cp -a ChangeLog README LICENSE \
  97. $PKG/usr/doc/$PRGNAM-$VERSION
  98. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  99. mkdir -p $PKG/install
  100. cat $CWD/slack-desc > $PKG/install/slack-desc
  101. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  102. # Only add capability stuff if not disabled:
  103. if [ "${SETCAP:-no}" = "yes" ]; then
  104. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  105. # Only allow execution by audio group
  106. chown root:audio $PKG/usr/bin/*
  107. chmod 0750 $PKG/usr/bin/*
  108. fi
  109. cd $PKG
  110. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE