helm.SlackBuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/bash
  2. # Slackware build script for helm
  3. # Written by Zbigniew Baniewski, <Zbigniew [dot] Baniewski [at] gmail [dot] com>
  4. # 20220323 bkw: Modified by SlackBuilds.org: fix 32-bit build.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=helm
  7. VERSION=${VERSION:-0.9.0}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. # 20220323 bkw: This is a lie: nothing actually uses SLKCFLAGS
  26. # or LIBDIRSUFFIX, after they get set here. Leaving in case the
  27. # maintainer wants to apply the flags (if not, please delete this
  28. # whole stanza).
  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 $PRGNAM-$VERSION
  47. tar zxvf $CWD/${PRGNAM}-${VERSION}.tar.gz
  48. cd $PRGNAM-$VERSION
  49. chown -R root:root .
  50. find -L . \
  51. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  52. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  53. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  54. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  55. patch -p1 < $CWD/helm-0.9.0-gcc91.patch
  56. # No need for /usr/doc/helm
  57. cat $CWD/0001-doc-fix.patch | patch -p1 || exit 1
  58. # 20220323 bkw: 32-bit build needs this.
  59. [ "$ARCH" != "x86_64" ] && \
  60. sed -i 's,__sigemptyset,sigemptyset,' \
  61. JUCE/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c
  62. make
  63. make install DESTDIR=$PKG
  64. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  65. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  66. mv $PKG/usr/share/man $PKG/usr/
  67. find $PKG/usr/man -type f -exec gzip -9 {} \;
  68. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  69. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  70. cp -a changelog COPYING \
  71. $PKG/usr/doc/$PRGNAM-$VERSION
  72. cp -a docs/helm_manual.pdf docs/thank_you.txt \
  73. $PKG/usr/doc/$PRGNAM-$VERSION
  74. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  75. mkdir -p $PKG/install
  76. cat $CWD/slack-desc > $PKG/install/slack-desc
  77. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  78. cd $PKG
  79. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE