Guest User

Untitled

a guest
May 5th, 2018
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. # Slackware build script for "jack2".
  4.  
  5. # Copyright 2014 Yanes Checcacci Balod <yanes@pobox.com>, Brazil
  6. # Copyright 2014-2015 Marcel Saegebarth <marc@mos6581.de>
  7. # All rights reserved.
  8. #
  9. # Redistribution and use of this script, with or without modification, is
  10. # permitted provided that the following conditions are met:
  11. #
  12. # 1. Redistributions of this script must retain the above copyright
  13. #    notice, this list of conditions and the following disclaimer.
  14. #
  15. #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  16. #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  17. #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
  18. #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  19. #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  20. #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  21. #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  22. #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  23. #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  24. #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  25.  
  26. # Modified again by Eric Fernandes Ferreira <candelabrus@gmail.com> for my personal Audio Project
  27.  
  28. PRGNAM=jack2
  29. VERSION=${VERSION:-1.9.12}
  30. BUILD=${BUILD:-1}
  31. TAG=${TAG:-_SBo}
  32.  
  33. if [ -z "$ARCH" ]; then
  34.   case "$( uname -m )" in
  35.     i?86) ARCH=i586 ;;
  36.     arm*) ARCH=arm ;;
  37.        *) ARCH=$( uname -m ) ;;
  38.   esac
  39. fi
  40.  
  41. # wget -c https://github.com/jackaudio/jack2/releases/download/v$VERSION/$PRGNAM-$VERSION.tar.gz
  42.  
  43. CWD=$(pwd)
  44. TMP=${TMP:-/tmp/SBo}
  45. PKG=$TMP/package-$PRGNAM
  46. OUTPUT=${OUTPUT:-/tmp}
  47.  
  48. if [ "$ARCH" = "i586" ]; then
  49.   SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  50.   LIBDIRSUFFIX=""
  51. elif [ "$ARCH" = "i686" ]; then
  52.   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  53.   LIBDIRSUFFIX=""
  54. elif [ "$ARCH" = "x86_64" ]; then
  55.   SLKCFLAGS="-O2 -fPIC"
  56.   LIBDIRSUFFIX="64"
  57. else
  58.   SLKCFLAGS="-O2"
  59.   LIBDIRSUFFIX=""
  60. fi
  61.  
  62. set -e
  63.  
  64. rm -rf $PKG
  65. mkdir -p $TMP $PKG $OUTPUT
  66. cd $TMP
  67. rm -rf $PRGNAM-$VERSION
  68. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  69. cd $PRGNAM-$VERSION
  70. chown -R root:root .
  71. find -L . \
  72.  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  73.   -o -perm 511 \) -exec chmod 755 {} \; -o \
  74.  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  75.   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  76.  
  77. CFLAGS="$SLKCFLAGS" \
  78. CXXFLAGS="$SLKCFLAGS" \
  79. ./waf configure \
  80.   --prefix=/usr \
  81.   --libdir=/usr/lib${LIBDIRSUFFIX} \
  82.   --mandir=/usr/man/man1 \
  83.   --doxygen=no \
  84.   --classic \
  85.   --profile \
  86.   --alsa \
  87.   --dbus
  88.  
  89. ./waf build
  90. ./waf install --destdir=$PKG
  91.  
  92. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  93.   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  94.  
  95. find $PKG/usr/man -type f -exec gzip -9 {} \;
  96. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  97.  
  98. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  99. cp -a ChangeLog README* TODO $PKG/usr/doc/$PRGNAM-$VERSION
  100. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  101.  
  102. mkdir -p $PKG/install
  103. cat $CWD/slack-desc > $PKG/install/slack-desc
  104.  
  105. # Only add capability stuff if not disabled:
  106. if [ "${SETCAP:-yes}" = "yes" ]; then
  107.   cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  108.   # Only allow execution by audio group
  109.   chown root:audio $PKG/usr/bin/*
  110.   chmod 0750 $PKG/usr/bin/*
  111. fi
  112.  
  113. cd $PKG
  114. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
RAW Paste Data