carla.SlackBuild 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. #!/bin/bash
  2. # Slackware build script for <carla>
  3. #
  4. # Michales (clavisound) Michaloudes korgie@gmail.com <2018-2021>
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=carla
  7. VERSION=${VERSION:-2.4.1}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. SRCNAM=Carla
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  20. # the name of the created package would be, and then exit. This information
  21. # could be useful to other scripts.
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "i686" ]; then
  33. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "x86_64" ]; then
  36. SLKCFLAGS="-O2 -fPIC"
  37. LIBDIRSUFFIX="64"
  38. else
  39. SLKCFLAGS="-O2"
  40. LIBDIRSUFFIX=""
  41. fi
  42. set -e
  43. rm -rf $PKG
  44. mkdir -p $TMP $PKG $OUTPUT
  45. cd $TMP
  46. rm -rf $SRCNAM-$VERSION
  47. tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
  48. cd $SRCNAM-$VERSION
  49. chown -R root:root .
  50. # upstream ships archive with broken symlinks, remove
  51. find -L . -type l -exec rm -f {} \+
  52. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  53. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  54. sed -i -e /CARLA_LIBDIR/s/\"lib\"/\"lib$LIBDIRSUFFIX\"/ data/carla-single
  55. make PREFIX=/usr LIBDIR=/usr/lib$LIBDIRSUFFIX
  56. make install PREFIX=/usr LIBDIR=/usr/lib$LIBDIRSUFFIX DESTDIR=$PKG
  57. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  58. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  59. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  60. cp -a \
  61. INSTALL.md README.md doc/* \
  62. $PKG/usr/doc/$PRGNAM-$VERSION
  63. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  64. mkdir -p $PKG/install
  65. cat $CWD/slack-desc > $PKG/install/slack-desc
  66. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE