rakarrack.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #!/bin/bash
  2. # Slackware build script for rakarrack
  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: BUILD=3, new-style icons.
  6. # 20140114 bkw: add 64-bit distortion fix and setcap stuff.
  7. # 20151126 bkw: fix build on -current, preparing for 14.2.
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=rakarrack
  10. VERSION=${VERSION:-0.6.1}
  11. BUILD=${BUILD:-3}
  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.bz2
  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. sed -i "/Icon=/s,=.*,=$PRGNAM," data/$PRGNAM.desktop
  52. # work around a bug that causes distorion/overdrive not to work on 64-bit.
  53. # this is a band-aid, not a real solution, but it seems to work OK.
  54. # http://sourceforge.net/p/rakarrack/discussion/778862/thread/e9559a34/
  55. patch -p1 < $CWD/64bit_distortion.diff
  56. # Slackware's extra/fltk doesn't have /usr/include/Fl -> FL
  57. sed -i '/#include/s,Fl/,FL/,' src/*
  58. CFLAGS="$SLKCFLAGS" \
  59. CXXFLAGS="$SLKCFLAGS" \
  60. ./configure \
  61. --prefix=/usr \
  62. --libdir=/usr/lib${LIBDIRSUFFIX} \
  63. --sysconfdir=/etc \
  64. --localstatedir=/var \
  65. --mandir=/usr/man \
  66. --docdir=/usr/doc/$PRGNAM-$VERSION \
  67. --build=$ARCH-slackware-linux
  68. make
  69. make install-strip DESTDIR=$PKG
  70. gzip $PKG/usr/man/man?/*.?
  71. rm -rf $PKG/usr/share/pixmaps/*
  72. for px in 32 64 128; do
  73. size=${px}x${px}
  74. dir=$PKG/usr/share/icons/hicolor/$size/apps
  75. mkdir -p $dir
  76. cp -a icons/icono_rakarrack_$size.png $dir/$PRGNAM.png
  77. done
  78. mkdir -p $PKG/usr/share/icons/hicolor/48x48/apps
  79. convert -resize 48x48 \
  80. icons/icono_rakarrack_128x128.png \
  81. $PKG/usr/share/icons/hicolor/48x48/apps/$PRGNAM.png
  82. ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  83. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  84. cp -a AUTHORS COPYING ChangeLog NEWS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  85. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  86. mkdir -p $PKG/install
  87. cat $CWD/slack-desc > $PKG/install/slack-desc
  88. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  89. # Only add capability stuff if not disabled:
  90. if [ "${SETCAP:-yes}" = "yes" ]; then
  91. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  92. # Only allow execution by audio group
  93. chown root:audio $PKG/usr/bin/$PRGNAM
  94. chmod 0750 $PKG/usr/bin/$PRGNAM
  95. fi
  96. cd $PKG
  97. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE