Guest User

Untitled

a guest
May 2nd, 2018
289
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. # SlackBuild script for ssr
  4.  
  5. # Copyright 2014 Benjamin Trigona-Harany <slackbuilds@jaxartes.net>
  6. # All rights reserved.
  7. #
  8. # Redistribution and use of this script, with or without modification, is
  9. # permitted provided that the following conditions are met:
  10. #
  11. # 1. Redistributions of this script must retain the above copyright
  12. #    notice, this list of conditions and the following disclaimer.
  13. #
  14. #  THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  15. #  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16. #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
  17. #  EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  18. #  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  19. #  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  20. #  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  21. #  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  22. #  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  23. #  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24.  
  25. # Modified again by Eric Fernandes Ferreira <candelabrus@gmail.com> for my personal use
  26.  
  27. PRGNAM=ssr
  28. VERSION=${VERSION:-0.3.10}
  29. BUILD=${BUILD:-1}
  30. TAG=${TAG:-_SBo}
  31.  
  32. if [ -z "$ARCH" ]; then
  33.   case "$( uname -m )" in
  34.     i?86) ARCH=i586 ;;
  35.     arm*) ARCH=arm ;;
  36.        *) ARCH=$( uname -m ) ;;
  37.   esac
  38. fi
  39.  
  40. wget -c https://github.com/MaartenBaert/ssr/archive/$VERSION.tar.gz
  41.  
  42. CWD=$(pwd)
  43. TMP=${TMP:-/tmp/SBo}
  44. PKG=$TMP/package-$PRGNAM
  45. OUTPUT=${OUTPUT:-/tmp}
  46.  
  47. if [ "$ARCH" = "i586" ]; then
  48.   SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  49.   LIBDIRSUFFIX=""
  50. elif [ "$ARCH" = "i686" ]; then
  51.   SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  52.   LIBDIRSUFFIX=""
  53. elif [ "$ARCH" = "x86_64" ]; then
  54.   SLKCFLAGS="-O2 -fPIC"
  55.   LIBDIRSUFFIX="64"
  56. else
  57.   SLKCFLAGS="-O2"
  58.   LIBDIRSUFFIX=""
  59. fi
  60.  
  61. set -e
  62.  
  63. rm -rf $PKG
  64. mkdir -p $TMP $PKG $OUTPUT
  65. cd $TMP
  66. rm -rf $PRGNAM-$VERSION
  67. tar xvf $CWD/$VERSION.tar.gz
  68. cd $PRGNAM-$VERSION
  69. chown -R root:root .
  70. find -L . \
  71.  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  72.   -o -perm 511 \) -exec chmod 755 {} \; -o \
  73.  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  74.   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  75.  
  76. mkdir -p build
  77. cd build
  78.   cmake \
  79.     -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  80.     -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  81.     -DCMAKE_INSTALL_PREFIX=/usr \
  82.     -DWITH_QT5=FALSE \
  83.     -DWITH_JACK=TRUE \
  84.     -DCMAKE_BUILD_TYPE=Release ..
  85.   make
  86.   make install DESTDIR=$PKG
  87. cd ..
  88.  
  89. # Don't package .la files:
  90. rm -f $PKG/usr/lib${LIBDIRSUFFIX}/*.la
  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. mv $PKG/usr/share/man $PKG/usr
  96. find $PKG/usr/man -type f -exec gzip -9 {} \;
  97. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  98.  
  99. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  100. cp -a AUTHORS* CHANGELOG* COPYING README* *.txt $PKG/usr/doc/$PRGNAM-$VERSION
  101. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  102.  
  103. mkdir -p $PKG/install
  104. cat $CWD/slack-desc > $PKG/install/slack-desc
  105. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  106.  
  107. cd $PKG
  108. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
RAW Paste Data