jack1.SlackBuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. #!/bin/bash
  2. # Slackware build script for jack1-legacy, adapted from
  3. # jack-audio-connection-kit.SlackBuild.
  4. # Copyright 2007-2014 Heinz Wiesinger, Amsterdam, The Netherlands
  5. # All rights reserved.
  6. #
  7. # Redistribution and use of this script, with or without modification, is
  8. # permitted provided that the following conditions are met:
  9. #
  10. # 1. Redistributions of this script must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. #
  13. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  14. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  15. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  16. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  18. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  19. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  20. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  21. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  22. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  23. # Modified by Robby Workman <rworkman@slackbuilds.org>
  24. # No additional license terms added :)
  25. # Modified, renamed, and now maintained by B. Watson <yalhcru@gmail.com>
  26. # This build was renamed from jack-audio-connection-kit to jack1.
  27. # If you need to see the commit log for the old name, use a command like:
  28. # git log -- audio/jack-audio-connection-kit
  29. cd $(dirname $0) ; CWD=$(pwd)
  30. PRGNAM=jack1
  31. VERSION=${VERSION:-0.125.0}
  32. BUILD=${BUILD:-2}
  33. TAG=${TAG:-_SBo}
  34. PKGTYPE=${PKGTYPE:-tgz}
  35. SRCNAM=jack-audio-connection-kit
  36. if [ -z "$ARCH" ]; then
  37. case "$( uname -m )" in
  38. i?86) ARCH=i586 ;;
  39. arm*) ARCH=arm ;;
  40. *) ARCH=$( uname -m ) ;;
  41. esac
  42. fi
  43. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  44. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  45. exit 0
  46. fi
  47. TMP=${TMP:-/tmp/SBo}
  48. PKG=$TMP/package-$PRGNAM
  49. OUTPUT=${OUTPUT:-/tmp}
  50. if [ "$ARCH" = "i586" ]; then
  51. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  52. LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "i686" ]; then
  54. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  55. LIBDIRSUFFIX=""
  56. elif [ "$ARCH" = "x86_64" ]; then
  57. SLKCFLAGS="-O2 -fPIC"
  58. LIBDIRSUFFIX="64"
  59. else
  60. SLKCFLAGS="-O2"
  61. LIBDIRSUFFIX=""
  62. fi
  63. set -e
  64. rm -rf $PKG
  65. mkdir -p $TMP $PKG $OUTPUT
  66. cd $TMP
  67. rm -rf $SRCNAM-$VERSION
  68. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  69. cd $SRCNAM-$VERSION
  70. chown -R root:root .
  71. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  72. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  73. # respect march and mtune flags: fixes building on x86_64
  74. sed -i 's|-march=native \-mtune=native||' configure.ac
  75. autoreconf -fi
  76. CFLAGS="$SLKCFLAGS" \
  77. CXXFLAGS="$SLKCFLAGS" \
  78. ./configure \
  79. --prefix=/usr \
  80. --libdir=/usr/lib${LIBDIRSUFFIX} \
  81. --sysconfdir=/etc \
  82. --localstatedir=/var \
  83. --with-html-dir=/usr/doc/$PRGNAM-$VERSION \
  84. --mandir=/usr/man \
  85. --enable-optimize \
  86. --with-default-tmpdir=/dev/shm \
  87. --build=$ARCH-slackware-linux \
  88. --host=$ARCH-slackware-linux
  89. make
  90. make install-strip DESTDIR=$PKG
  91. gzip -9 $PKG/usr/man/man?/*.?
  92. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  93. cp -a AUTHORS COPYING* README TODO $PKG/usr/doc/$PRGNAM-$VERSION
  94. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  95. rm -f $PKG/usr/lib*/*.la
  96. mkdir -p $PKG/install
  97. cat $CWD/slack-desc > $PKG/install/slack-desc
  98. # Only add capability stuff if not disabled:
  99. if [ "${SETCAP:-yes}" = "yes" ]; then
  100. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  101. # Only allow execution by audio group
  102. chown root:audio $PKG/usr/bin/*
  103. chmod 0750 $PKG/usr/bin/*
  104. fi
  105. cd $PKG
  106. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE