lv2-mda-metapiano.SlackBuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. # Slackware build script for lv2-mda-metapiano
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211202 bkw: BUILD=2
  6. # - actually use SLKCFLAGS.
  7. # - fix homepage.
  8. # - use upstream's release tarball.
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=lv2-mda-metapiano
  11. VERSION=${VERSION:-0.0.2}
  12. BUILD=${BUILD:-2}
  13. TAG=${TAG:-_SBo}
  14. PKGTYPE=${PKGTYPE:-tgz}
  15. if [ -z "$ARCH" ]; then
  16. case "$( uname -m )" in
  17. i?86) ARCH=i586 ;;
  18. arm*) ARCH=arm ;;
  19. *) ARCH=$( uname -m ) ;;
  20. esac
  21. fi
  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. # upstream's tarball and directory name include these:
  44. GITVER=${GITVER:-1a272c3}
  45. GITNAM="lv2-mdametapiano"
  46. TARNAM=$GITNAM-$VERSION-$GITVER
  47. rm -rf $PKG
  48. mkdir -p $TMP $PKG $OUTPUT
  49. cd $TMP
  50. rm -rf $TARNAM
  51. # we get 2 different filenames depending on whether the download was
  52. # done with a client that does or does not respect the Content-disposition
  53. # HTTP header. Browsers usually do, wget doesn't, unless it's instructed
  54. # to (via command line option or wgetrc). handle both filenames here.
  55. # for github, there's a "magic" URL that gives us the same filename
  56. # either way, but this isn't a github project.
  57. for i in $VERSION $TARNAM; do
  58. [ -e $CWD/$i.tar.gz ] && tar xvf $CWD/$i.tar.gz && break
  59. done
  60. cd $TARNAM
  61. chown -R root:root .
  62. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  63. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  64. # sneak our flags in as "warnings". -Wl,-s strips the libs.
  65. runmake() {
  66. make \
  67. TYPE=$1 \
  68. WARNINGS="$SLKCFLAGS -Wl,-s"
  69. make install \
  70. TYPE=$1 \
  71. INSTALL_DIR=$PKG/usr/lib$LIBDIRSUFFIX/lv2
  72. make clean
  73. }
  74. runmake mdaPiano
  75. runmake mdaEPiano
  76. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  77. cp -a LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
  78. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  79. mkdir -p $PKG/install
  80. cat $CWD/slack-desc > $PKG/install/slack-desc
  81. cd $PKG
  82. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE