wavelet-denoise.SlackBuild 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. #!/bin/bash
  2. # Slackware build script for wavelet-denoise
  3. # Originally written by klaatu for separate+
  4. # Adapted to wavelet-denoise by Stefano Guidoni
  5. # 20220222 bkw: Modified by SlackBuilds.org, BUILD=2:
  6. # - fix build on 15.0.
  7. # - actually install files to $PKG/usr instead of the real /usr!
  8. # - actually use SLKCFLAGS.
  9. # - i486 => i586.
  10. # - don't install useless INSTALL doc.
  11. # - use a download URL that exists.
  12. cd $(dirname $0) ; CWD=$(pwd)
  13. PRGNAM=wavelet-denoise
  14. VERSION=${VERSION:-0.3.1}
  15. BUILD=${BUILD:-2}
  16. TAG=${TAG:-_SBo}
  17. PKGTYPE=${PKGTYPE:-tgz}
  18. if [ -z "$ARCH" ]; then
  19. case "$( uname -m )" in
  20. i?86) ARCH=i586 ;;
  21. x86_64) ARCH=x86_64 ;;
  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 -xzf $CWD/$PRGNAM-$VERSION.tar.gz
  52. cd $PRGNAM-$VERSION
  53. chown -R root:root .
  54. find -L . \
  55. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  56. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  57. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  58. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  59. SLKCFLAGS+=" -fcommon"
  60. sed -i -e "s,-O3,$SLKCFLAGS," \
  61. -e '/^LIBS/s,$, -lm,' \
  62. src/Makefile
  63. make
  64. # 20220225 bkw: do not use 'make install'! It ignores DESTDIR and spams
  65. # your /usr. However, it's safe to install the translations... but
  66. # the stupid thing won't create the required directories by itself.
  67. mkdir -p $PKG/usr/share/locale/{de,ru,it,et,pl}/LC_MESSAGES
  68. make -C po install LOCALEDIR=$PKG/usr/share/locale
  69. mkdir -p $PKG/usr/lib$LIBDIRSUFFIX/gimp/2.0/plug-ins
  70. install -s src/wavelet-denoise $PKG/usr/lib$LIBDIRSUFFIX/gimp/2.0/plug-ins
  71. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  72. cp -a \
  73. AUTHORS README ChangeLog COPYING THANKS TRANSLATIONS \
  74. $PKG/usr/doc/$PRGNAM-$VERSION
  75. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cd $PKG
  79. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE