herrie.SlackBuild 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #!/bin/sh
  2. # Slackware build script for herrie
  3. # Written by Phillip Warner <pc_warner@yahoo.com>
  4. PRGNAM=herrie
  5. VERSION=${VERSION:-2.2}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. # Automatically determine the architecture we're building on:
  9. if [ -z "$ARCH" ]; then
  10. case "$( uname -m )" in
  11. i?86) ARCH=i486 ;;
  12. arm*) ARCH=arm ;;
  13. # Unless $ARCH is already set, use uname -m for all other archs:
  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. ########################
  22. # Experimental Patches #
  23. #
  24. # I have found these to be stable on my systems,
  25. # and they might be included in future upstream
  26. # sources, but for now you use these at your own risk.
  27. #
  28. # Please read README.SBo for more information on the
  29. # functionality that these patches add.
  30. AUTOQUIT=${AUTOQUIT:-NO}
  31. SIGNALS=${SIGNALS:-NO}
  32. FILTER=${FILTER:-NO}
  33. ########################
  34. if [ "$ARCH" = "i486" ]; then
  35. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  36. LIBDIRSUFFIX=""
  37. elif [ "$ARCH" = "i686" ]; then
  38. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  39. LIBDIRSUFFIX=""
  40. elif [ "$ARCH" = "x86_64" ]; then
  41. SLKCFLAGS="-O2 -fPIC"
  42. LIBDIRSUFFIX="64"
  43. else
  44. SLKCFLAGS="-O2"
  45. LIBDIRSUFFIX=""
  46. fi
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG/usr $OUTPUT
  50. cd $TMP
  51. rm -rf $PRGNAM-$VERSION
  52. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  53. cd $PRGNAM-$VERSION
  54. chown -R root:root .
  55. find . \
  56. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  57. -exec chmod 755 {} \; -o \
  58. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  59. -exec chmod 644 {} \;
  60. if [ "$AUTOQUIT" == "YES" ]; then
  61. patch -p2 < $CWD/patches/herrie-autoquit.diff
  62. fi
  63. if [ "$SIGNALS" == "YES" ]; then
  64. patch -p2 < $CWD/patches/herrie-2.1-signals.diff
  65. fi
  66. if [ "$FILTER" == "YES" ]; then
  67. if [ "$AUTOQUIT" == "YES" ]; then
  68. patch -p2 < $CWD/patches/herrie-2.1-filters.diff
  69. else
  70. patch -p2 < $CWD/patches/herrie-2.1-filters-orig.diff
  71. fi
  72. fi
  73. ####################CONFIG OPTIONS###########################
  74. #no_http Disable support for HTTP audio streams
  75. #no_modplug Disable libmodplug linkage
  76. #no_mp3 Disable MP3 audio file support
  77. #no_nls Disable native language support
  78. #no_scrobbler Disable AudioScrobbler support
  79. #no_sndfile Disable libsndfile linkage (Wave/FLAC support)
  80. #no_vorbis Disable Ogg Vorbis support
  81. #no_xspf Disable XSPF playlist support
  82. #alsa Use ALSA audio output
  83. #ao Use libao audio output
  84. #coreaudio Use Apple CoreAudio audio output
  85. #oss Use Open Sound System output
  86. #null Use placeholder audio output
  87. #pulse Use PulseAudio audio output
  88. #ncurses Use ncurses instead of ncursesw (breaks UTF-8 support)
  89. #xcurses Build application against XCurses (PDCurses)
  90. #no_strip Do not strip the application binary on installation
  91. #strict Turn on stricter compiler flags for GCC
  92. #verbose Print commands during compilation
  93. #############################################################
  94. CFLAGS="$SLKCFLAGS" \
  95. CXXFLAGS="$SLKCFLAGS" \
  96. PREFIX="/usr" \
  97. CONFDIR="/etc" \
  98. MANDIR="/usr/man" \
  99. ./configure \
  100. no_sndfile \
  101. no_modplug \
  102. no_scrobbler \
  103. no_xspf \
  104. alsa
  105. CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" force_arch="$ARCH" make
  106. make install DESTDIR=$PKG
  107. if [ "$SIGNALS" == "YES" ]; then
  108. install -m 0755 $CWD/herriectl $PKG/usr/bin/herriectl
  109. fi
  110. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  111. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  112. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  113. cp -a COPYING README ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION
  114. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  115. cat $CWD/README.SBo > $PKG/usr/doc/$PRGNAM-$VERSION/README.SBo
  116. mkdir -p $PKG/install
  117. cat $CWD/slack-desc > $PKG/install/slack-desc
  118. cd $PKG
  119. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}