lives.SlackBuild 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #!/bin/bash
  2. # Slackware build script for "lives".
  3. # Copyright 2014-2015 Yanes Checcacci Balod <yanes@pobox.com>, Brazil
  4. # Copyright 2015-2016 Marcel Saegebarth <marc@mos6581.de>
  5. # Copyright 2020 Lenard Spencer, Orlando,Florida, USA
  6. # All rights reserved.
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions are
  10. # met:
  11. #
  12. # * Redistributions of source code must retain the above copyright
  13. # notice, this list of conditions and the following disclaimer.
  14. #
  15. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  16. # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  17. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  18. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  19. # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  21. # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  22. # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  23. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  25. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. cd $(dirname $0) ; CWD=$(pwd)
  27. PRGNAM=lives
  28. SRCNAM=LiVES
  29. VERSION=${VERSION:-3.2.0}
  30. BUILD=${BUILD:-3}
  31. TAG=${TAG:-_SBo}
  32. PKGTYPE=${PKGTYPE:-tgz}
  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. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  41. # the name of the created package would be, and then exit. This information
  42. # could be useful to other scripts.
  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. # Check for a previous LiVES installation:
  64. if [ -e /usr/bin/lives ]; then
  65. echo "ERROR: A previous LiVES installation is detected!"
  66. echo "Please remove it before running this script."
  67. exit 1
  68. fi
  69. set -e
  70. rm -rf $PKG
  71. mkdir -p $TMP $PKG $OUTPUT
  72. cd $TMP
  73. rm -rf $PRGNAM-$VERSION
  74. tar xvf $CWD/$SRCNAM-$VERSION.tar.bz2
  75. cd $PRGNAM-$VERSION
  76. chown -R root:root .
  77. find -L . \
  78. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  79. -o -perm 511 \) -exec chmod 755 {} \; -o \
  80. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  81. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  82. CV="--disable-opencv" ; [ "${OPENCV:-no}" = "yes" ] && CV=""
  83. PA="--disable-pulse" ; [ "${PULSE:-yes}" = "yes" ] && PA=""
  84. CFLAGS="$SLKCFLAGS -I/usr/include/tirpc -Wl,-ltirpc" \
  85. CXXFLAGS="$SLKCFLAGS" \
  86. ./configure \
  87. --prefix=/usr \
  88. --libdir=/usr/lib${LIBDIRSUFFIX} \
  89. --sysconfdir=/etc \
  90. --localstatedir=/var \
  91. --mandir=/usr/man \
  92. --docdir=/usr/doc/$PRGNAM-$VERSION \
  93. $PA \
  94. $CV \
  95. --build=$ARCH-slackware-linux
  96. make -j1
  97. make -j1 install DESTDIR=$PKG
  98. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  99. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  100. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  101. cp -a \
  102. ABOUT-NLS AUTHORS COPYING ChangeLog FEATURES GETTING.STARTED INSTALL \
  103. NEWS README \
  104. $PKG/usr/doc/$PRGNAM-$VERSION
  105. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  106. (
  107. cd $PKG/usr/bin && rm -f lives && ln -s lives-exe lives
  108. )
  109. rm -f $PKG/usr/lib*/*.la
  110. mkdir -p $PKG/install
  111. cat $CWD/slack-desc > $PKG/install/slack-desc
  112. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  113. # Only add capability stuff if not disabled:
  114. if [ "${SETCAP:-yes}" = "yes" ]; then
  115. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  116. # Only allow execution by audio group
  117. chown root:audio $PKG/usr/bin/*
  118. chmod 0750 $PKG/usr/bin/*
  119. fi
  120. cd $PKG
  121. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE