pianobooster.SlackBuild 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. #!/bin/bash
  2. # Slackware build script for pianobooster
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Modified by Willy Sudiarto Raharjo <willysr@slackware-id.org>
  5. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  6. # 20210802 bkw: update for v1.0.0 and -current.
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=pianobooster
  9. SRCNAM=PianoBooster
  10. VERSION=${VERSION:-1.0.0}
  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 $SRCNAM-$VERSION
  46. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  47. cd $SRCNAM-$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. mkdir -p build
  52. cd build
  53. cmake \
  54. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  55. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  56. -DCMAKE_INSTALL_PREFIX=/usr \
  57. -DCMAKE_BUILD_TYPE=Release ../src
  58. make VERBOSE=1
  59. make install/strip DESTDIR=$PKG
  60. cd ..
  61. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  62. mv $PKG/usr/share/doc/$PRGNAM/* \
  63. $PKG/usr/share/licenses/$PRGNAM/* \
  64. $PKG/usr/doc/$PRGNAM-$VERSION
  65. rm -rf $PKG/usr/share/doc/ $PKG/usr/share/licenses/
  66. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  67. mkdir -p $PKG/install
  68. cat $CWD/slack-desc > $PKG/install/slack-desc
  69. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  70. cd $PKG
  71. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE