herrie.SlackBuild 4.1 KB

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