lv2file.SlackBuild 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. #!/bin/bash
  2. # Slackware build script for lv2file
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20220615 bkw: update for v0.95.
  6. # 20170301 bkw:
  7. # - use long-format github URL (thanks, David!)
  8. # 20141021 bkw:
  9. # update for 0.84, get rid of argtable patch as it's no longer needed.
  10. cd $(dirname $0) ; CWD=$(pwd)
  11. PRGNAM=lv2file
  12. VERSION=${VERSION:-0.95}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) ARCH=i586 ;;
  19. arm*) ARCH=arm ;;
  20. *) ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  24. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  25. exit 0
  26. fi
  27. TMP=${TMP:-/tmp/SBo}
  28. PKG=$TMP/package-$PRGNAM
  29. OUTPUT=${OUTPUT:-/tmp}
  30. if [ "$ARCH" = "i586" ]; then
  31. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "i686" ]; then
  34. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "x86_64" ]; then
  37. SLKCFLAGS="-O2 -fPIC"
  38. LIBDIRSUFFIX="64"
  39. else
  40. SLKCFLAGS="-O2"
  41. LIBDIRSUFFIX=""
  42. fi
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $PRGNAM-upstream-$VERSION
  48. tar xvf $CWD/$PRGNAM-upstream-$VERSION.tar.gz
  49. cd $PRGNAM-upstream-$VERSION
  50. chown -R root:root .
  51. # egregious permissions, instead of find/chown do this:
  52. chmod 755 .
  53. chmod 644 *
  54. if [ "${FORCE_SLACK_FLAGS:-no}" = "yes" ]; then
  55. sed -i "s/-O3/$SLKCFLAGS/" Makefile
  56. else
  57. sed -i "s/-O3/-O3 -fPIC/" Makefile
  58. fi
  59. make
  60. strip $PRGNAM
  61. make install DESTDIR=$PKG
  62. mkdir -p $PKG/usr/man/man1
  63. gzip -9c < $PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
  64. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  65. cp -a README LICENSE $PKG/usr/doc/$PRGNAM-$VERSION
  66. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  67. mkdir -p $PKG/install
  68. cat $CWD/slack-desc > $PKG/install/slack-desc
  69. cd $PKG
  70. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE