ecasound.SlackBuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. #!/bin/bash
  2. # Slackware build script for ecasound
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20230106 bkw: BUILD=3, fix homepare, remove useless INSTALL from doc dir.
  6. # 20211128 bkw: BUILD=2, add python3 support.
  7. # 20200117 bkw: Updated for v2.9.3.
  8. # 20191202 bkw:
  9. # - Updated for v2.9.2.
  10. # - removed python_module_dir.diff and ruby2.patch from 2.9.1,
  11. # they're no longer needed. This means you can no longer build
  12. # 2.9.1 with this script.
  13. cd $(dirname $0) ; CWD=$(pwd)
  14. PRGNAM=ecasound
  15. VERSION=${VERSION:-2.9.3}
  16. BUILD=${BUILD:-3}
  17. TAG=${TAG:-_SBo}
  18. PKGTYPE=${PKGTYPE:-tgz}
  19. if [ -z "$ARCH" ]; then
  20. case "$( uname -m )" in
  21. i?86) ARCH=i586 ;;
  22. arm*) ARCH=arm ;;
  23. *) ARCH=$( uname -m ) ;;
  24. esac
  25. fi
  26. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  27. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  28. exit 0
  29. fi
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. if [ "$ARCH" = "i586" ]; then
  34. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "i686" ]; then
  37. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "x86_64" ]; then
  40. SLKCFLAGS="-O2 -fPIC"
  41. LIBDIRSUFFIX="64"
  42. else
  43. SLKCFLAGS="-O2"
  44. LIBDIRSUFFIX=""
  45. fi
  46. set -e
  47. rm -rf $PKG
  48. mkdir -p $TMP $PKG $OUTPUT
  49. cd $TMP
  50. rm -rf $PRGNAM-$VERSION
  51. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  52. cd $PRGNAM-$VERSION
  53. chown -R root:root .
  54. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  55. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  56. # --disable-static and --enable-shared are accepted, but ignored.
  57. # This is deliberate: upstream doesn't want shared libs. See:
  58. # http://www.eca.cx/ecasound-list/2002/10/0031.html
  59. setpyver() {
  60. PYVER=$( python -c 'import sys; print("%d.%d" % sys.version_info[0:2])' )
  61. echo "=== PYVER='$PYVER'"
  62. }
  63. conf() {
  64. CFLAGS="$SLKCFLAGS" \
  65. CXXFLAGS="$SLKCFLAGS" \
  66. ./configure \
  67. --disable-arts \
  68. --prefix=/usr \
  69. --libdir=/usr/lib${LIBDIRSUFFIX} \
  70. --sysconfdir=/etc \
  71. --localstatedir=/var \
  72. --mandir=/usr/man \
  73. --docdir=/usr/doc/$PRGNAM-$VERSION \
  74. --with-python-modules=/usr/lib$LIBDIRSUFFIX/python$PYVER \
  75. --enable-python-force-site-packages \
  76. --disable-all-static \
  77. --build=$ARCH-slackware-linux
  78. }
  79. # first time around, build everything, with python2 support.
  80. setpyver
  81. conf
  82. make
  83. make install-strip DESTDIR=$PKG
  84. # 2nd build, python3 support only. configure has "python" hardcoded as
  85. # the executable (can't pass python3), so fake it out with $PATH.
  86. mkdir pytmp
  87. ln -s /usr/bin/python3 pytmp/python
  88. export PATH=$(pwd)/pytmp:$PATH
  89. setpyver
  90. make clean
  91. conf
  92. make -C pyecasound install DESTDIR=$PKG
  93. # Per -current guidelines (and does no harm on 14.2):
  94. rm -f $PKG/usr/lib$LIBDIRSUFFIX/*.la
  95. # Kind of a twist for a SlackBuild: bunch of identical man pages are getting
  96. # installed, and we want them to be symlinks instead of copies.
  97. cd $PKG/usr/man/man1
  98. toolsum="$( cat ecatools.1 | md5sum )"
  99. for manpage in $( /bin/ls * | grep -v ecatools ); do
  100. if [ "$toolsum" = "$( cat $manpage | md5sum )" ]; then
  101. rm -f $manpage
  102. ln -s ecatools.1 $manpage
  103. fi
  104. done
  105. cd -
  106. find $PKG/usr/man -type f -exec gzip -9 {} \;
  107. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  108. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  109. cp -a AUTHORS BUGS COPYING* README RELNOTES TODO \
  110. $PKG/usr/doc/$PRGNAM-$VERSION
  111. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  112. mkdir -p $PKG/install
  113. cat $CWD/slack-desc > $PKG/install/slack-desc
  114. # Only add capability stuff if not disabled:
  115. if [ "${SETCAP:-yes}" = "yes" ]; then
  116. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  117. # Only allow execution by audio group
  118. chown root:audio $PKG/usr/bin/$PRGNAM
  119. chmod 0750 $PKG/usr/bin/$PRGNAM
  120. fi
  121. cd $PKG
  122. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE