pulseaudio.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/bin/sh
  2. # Slackware build script for pulseaudio
  3. # Written by crocket (crockabiscuit@gmail.com)
  4. PRGNAM=pulseaudio
  5. VERSION=${VERSION:-2.0}
  6. BUILD=${BUILD:-1}
  7. TAG=${TAG:-_SBo}
  8. if [ -z "$ARCH" ]; then
  9. case "$( uname -m )" in
  10. i?86) ARCH=i486 ;;
  11. arm*) ARCH=arm ;;
  12. *) ARCH=$( uname -m ) ;;
  13. esac
  14. fi
  15. CWD=$(pwd)
  16. TMP=${TMP:-/tmp/SBo}
  17. PKG=$TMP/package-$PRGNAM
  18. OUTPUT=${OUTPUT:-/tmp}
  19. if [ "$ARCH" = "i486" ]; then
  20. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  21. LIBDIRSUFFIX=""
  22. elif [ "$ARCH" = "i686" ]; then
  23. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  24. LIBDIRSUFFIX=""
  25. elif [ "$ARCH" = "x86_64" ]; then
  26. SLKCFLAGS="-O2 -fPIC"
  27. LIBDIRSUFFIX="64"
  28. else
  29. SLKCFLAGS="-O2"
  30. LIBDIRSUFFIX=""
  31. fi
  32. if ! grep -q ^pulse: /etc/group ; then
  33. echo " Must have a pulse group to run this script."
  34. echo " # groupadd -g 216 pulse"
  35. exit 1
  36. elif ! grep -q ^pulse: /etc/passwd ; then
  37. echo " Must have a pulse user to run this script."
  38. echo " # useradd -g pulse -u 216 -d /var/lib/pulse pulse"
  39. exit 1
  40. fi
  41. set -eu
  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.xz
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. find . \
  50. \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  51. -exec chmod 755 {} \; -o \
  52. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  53. -exec chmod 644 {} \;
  54. if pkg-config --exists orc-0.4 ; then
  55. ORC=yes
  56. else
  57. ORC=no
  58. fi
  59. CFLAGS="$SLKCFLAGS" \
  60. CXXFLAGS="$SLKCFLAGS" \
  61. ./configure \
  62. --prefix=/usr \
  63. --libdir=/usr/lib${LIBDIRSUFFIX} \
  64. --sysconfdir=/etc \
  65. --localstatedir=/var \
  66. --mandir=/usr/man \
  67. --disable-tcpwrap \
  68. --enable-orc=${ORC} \
  69. --disable-static \
  70. --disable-hal \
  71. --enable-hal-compat \
  72. --disable-solaris \
  73. --disable-waveout \
  74. --with-system-user=pulse \
  75. --with-system-group=pulse \
  76. --with-access-group=audio \
  77. --build=$ARCH-slackware-linux
  78. make
  79. make install-strip DESTDIR=$PKG
  80. mv $PKG/etc/pulse/client.conf $PKG/etc/pulse/client.conf.new
  81. mv $PKG/etc/pulse/default.pa $PKG/etc/pulse/default.pa.new
  82. mv $PKG/etc/pulse/daemon.conf $PKG/etc/pulse/daemon.conf.new
  83. mkdir -p $PKG/etc/rc.d
  84. cp $CWD/rc.pulseaudio $PKG/etc/rc.d/rc.pulseaudio.new
  85. find $PKG/usr/man -type f -exec gzip -9 {} \;
  86. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  87. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  88. cp -a *GPL LICENSE README $PKG/usr/doc/$PRGNAM-$VERSION
  89. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  90. mkdir -p $PKG/install
  91. cat $CWD/slack-desc > $PKG/install/slack-desc
  92. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  93. cd $PKG
  94. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}