pianobooster.SlackBuild 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/sh
  2. # Slackware build script for pianobooster
  3. # Written by B. Watson (yalhcru@gmail.com)
  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. PRGNAM=pianobooster
  7. VERSION=${VERSION:-0.6.4b}
  8. BUILD=${BUILD:-2}
  9. TAG=${TAG:-_SBo}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i486 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. CWD=$(pwd)
  18. TMP=${TMP:-/tmp/SBo}
  19. PKG=$TMP/package-$PRGNAM
  20. OUTPUT=${OUTPUT:-/tmp}
  21. if [ "$ARCH" = "i486" ]; then
  22. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  23. LIBDIRSUFFIX=""
  24. elif [ "$ARCH" = "i686" ]; then
  25. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  26. LIBDIRSUFFIX=""
  27. elif [ "$ARCH" = "x86_64" ]; then
  28. SLKCFLAGS="-O2 -fPIC"
  29. LIBDIRSUFFIX="64"
  30. else
  31. SLKCFLAGS="-O2"
  32. LIBDIRSUFFIX=""
  33. fi
  34. set -e
  35. rm -rf $PKG
  36. mkdir -p $TMP $PKG $OUTPUT
  37. cd $TMP
  38. rm -rf $PRGNAM-src-$VERSION
  39. tar xvf $CWD/$PRGNAM-src-$VERSION.tar.gz
  40. cd $PRGNAM-src-$VERSION
  41. chown -R root:root .
  42. find -L . \
  43. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  44. -exec chmod 755 {} \; -o \
  45. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  46. -exec chmod 644 {} \;
  47. # remove unneeded flag
  48. sed -i '/mwindows/d' src/CMakeLists.txt
  49. cd build
  50. cmake \
  51. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  52. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  53. -DCMAKE_INSTALL_PREFIX=/usr \
  54. -DCMAKE_BUILD_TYPE=Release ../src
  55. # DSO GL and pthread fix
  56. sed -i "s/$/-lGL -lpthread/" CMakeFiles/pianobooster.dir/link.txt
  57. make VERBOSE=1
  58. make install/strip DESTDIR=$PKG
  59. cd ..
  60. # Make the .desktop file validate.
  61. sed -i 's/Education;/&AudioVideo;/' $PKG/usr/share/applications/$PRGNAM.desktop
  62. # Don't need (will install docs manually below).
  63. rm -rf $PKG/usr/share/doc
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a \
  66. README.txt gplv3.txt license.txt \
  67. $PKG/usr/doc/$PRGNAM-$VERSION
  68. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  69. mkdir -p $PKG/install
  70. cat $CWD/slack-desc > $PKG/install/slack-desc
  71. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  72. cd $PKG
  73. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}