Advertisement
Guest User

Untitled

a guest
May 3rd, 2018
295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.24 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Slackware build script for Open Broadcaster Software
  4. #
  5. # Copyright 2015 Gethyn ThomasQuail <gethyn@bloodbathsoftworks.com>
  6. # All rights reserved.
  7. #
  8. # Based on:
  9. # SBo's cmake-template
  10. #
  11. # Redistribution and use of this script, with or without modification, is
  12. # permitted provided that the following conditions are met:
  13. #
  14. # 1. Redistributions of this script must retain the above copyright
  15. #    notice, this list of conditions and the following disclaimer.
  16. #
  17. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
  18. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  19. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  20. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  22. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  23. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  24. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  25. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  26. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27.  
  28. # Modified again by Eric Fernandes Ferreira <candelabrus@gmail.com> for my personal use
  29.  
  30. PRGNAM=obs-studio
  31. VERSION=${VERSION:-21.1.0}
  32. BUILD=${BUILD:-1}
  33. TAG=${TAG:-_SBo}
  34.  
  35. if [ -z "$ARCH" ]; then
  36.   case "$( uname -m )" in
  37.     i?86) ARCH=i586 ;;
  38.     arm*) ARCH=arm ;;
  39.        *) ARCH=$( uname -m ) ;;
  40.   esac
  41. fi
  42.  
  43. wget -c https://github.com/jp9000/obs-studio/archive/$VERSION.tar.gz
  44.  
  45. CWD=$(pwd)
  46. TMP=${TMP:-/tmp/SBo}
  47. PKG=$TMP/package-$PRGNAM
  48. OUTPUT=${OUTPUT:-/tmp}
  49.  
  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.  
  64. set -e
  65.  
  66. rm -rf $PKG
  67. mkdir -p $TMP $PKG $OUTPUT
  68. cd $TMP
  69. rm -rf $PRGNAM-$VERSION
  70. tar xvf $CWD/$VERSION.tar.gz
  71. cd $PRGNAM-$VERSION
  72. chown -R root:root .
  73. find -L . \
  74.  \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  75.   -o -perm 511 \) -exec chmod 755 {} \; -o \
  76.  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  77.   -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  78.  
  79. mkdir -p build
  80. cd build
  81.   cmake \
  82.     -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  83.     -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  84.     -DCMAKE_INSTALL_PREFIX=/usr \
  85.     -DOBS_MULTIARCH_SUFFIX="$LIBDIRSUFFIX" \
  86.     -DOBS_VERSION_OVERRIDE="$VERSION" \
  87.     -DUNIX_STRUCTURE=1 \
  88.     -DCMAKE_BUILD_TYPE=Release ..
  89.   make
  90.   make install DESTDIR=$PKG
  91. cd ..
  92.  
  93. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  94.   | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  95.  
  96. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  97. cp -a AUTHORS CONTRIBUTING* COPYING INSTALL README* $PKG/usr/doc/$PRGNAM-$VERSION
  98. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  99.  
  100. mkdir -p $PKG/install
  101. cat $CWD/slack-desc > $PKG/install/slack-desc
  102.  
  103. cd $PKG
  104. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement