atunes.SlackBuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. # Slackware build script for aTunes
  3. # Written by Diogo Leal(estranho) - diogo@diogoleal.com
  4. # 20220408 bkw: Modified by SlackBuilds.org, BUILD=2:
  5. # - this isn't quite noarch. remove 32-bit libJXGrabKey.so
  6. # from the package for non-x86 ARCH.
  7. # - add a /usr/bin/atunes wrapper.
  8. # - absolute path to icon in .desktop file.
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=atunes
  11. VERSION=${VERSION:-3.1.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. set -e
  30. rm -rf $PKG
  31. mkdir -p $TMP $PKG $OUTPUT
  32. rm -rf $TMP/$PRGNAM-$VERSION
  33. cd $TMP
  34. tar xvf $CWD/$PRGNAM-$VERSION-bin.tar.gz
  35. cd $PRGNAM-$VERSION
  36. chown -R root:root .
  37. find -L . \
  38. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  39. -o -perm 511 \) -exec chmod 755 {} \+ -o \
  40. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  41. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
  42. cp aTunes.sh aTunes
  43. chmod +x aTunes
  44. mkdir -p $PKG/opt/aTunes
  45. rm -rf *.exe *.dll *.ico win_tools
  46. cp -a * $PKG/opt/aTunes
  47. install -D -m 644 $CWD/atunes.desktop $PKG/usr/share/applications/atunes.desktop
  48. install -D -m 644 $CWD/atunes.png $PKG/usr/share/pixmaps/atunes.png
  49. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  50. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  51. # 20220408 bkw: the precompiled JNI library needed for global hotkey
  52. # support is 32-bit x86. remove it from the package if we can't use it.
  53. case "$ARCH" in
  54. i?86) ;; # OK
  55. *) rm -f $PKG/opt/aTunes/libJXGrabKey.so ;;
  56. esac
  57. # 20220408 bkw: add this wrapper so we can run the app from the shell
  58. # just by typing its name.
  59. mkdir -p $PKG/usr/bin
  60. cat > $PKG/usr/bin/$PRGNAM <<EOF
  61. #!/bin/sh
  62. exec /opt/aTunes/aTunes \"\$@\"
  63. EOF
  64. chmod 755 $PKG/usr/bin/$PRGNAM
  65. sed -i '/^Icon/s,atunes,/usr/share/pixmaps/atunes.png,' \
  66. $PKG/usr/share/applications/atunes.desktop
  67. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  68. cp -a license.txt $PKG/usr/doc/$PRGNAM-$VERSION
  69. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  70. mkdir -p $PKG/install
  71. cat $CWD/slack-desc > $PKG/install/slack-desc
  72. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  73. cd $PKG
  74. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE