japa.SlackBuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. #!/bin/bash
  2. # Slackware build script for japa
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20211129 bkw: BUILD=2, new-style icons, update man page.
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=japa
  8. VERSION=${VERSION:-0.9.2}
  9. BUILD=${BUILD:-2}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  20. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  21. exit 0
  22. fi
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. if [ "$ARCH" = "i586" ]; then
  27. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  28. LIBDIRSUFFIX=""
  29. elif [ "$ARCH" = "i686" ]; then
  30. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "x86_64" ]; then
  33. SLKCFLAGS="-O2 -fPIC"
  34. LIBDIRSUFFIX="64"
  35. else
  36. SLKCFLAGS="-O2"
  37. LIBDIRSUFFIX=""
  38. fi
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG/usr/{bin,man/man1} $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM-$VERSION
  44. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  45. cd $PRGNAM-$VERSION
  46. chown -R root:root .
  47. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  48. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  49. if [ "${FORCE_SLACK_CFLAGS:-no}" = "yes" ]; then
  50. sed -i \
  51. -e '/march=native/d' \
  52. -e "s,-O2,$SLKCFLAGS," \
  53. source/Makefile
  54. fi
  55. sed -i 's,pkgconf,pkg-config,' source/Makefile
  56. make -C source PREFIX=/usr
  57. make -C source install PREFIX=$PKG/usr
  58. strip $PKG/usr/bin/$PRGNAM
  59. # man page written for this SlackBuild.
  60. gzip -c9 < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
  61. # the 32x32 icon comes from Debian.
  62. # the 48x48 icon is the 32x32 one, centered in a 48x48 transparent PNG.
  63. mkdir -p $PKG/usr/share/icons/hicolor/{32x32,48x48}/apps
  64. convert $CWD/$PRGNAM.xpm \
  65. $PKG/usr/share/icons/hicolor/32x32/apps/$PRGNAM.png
  66. convert -background none -extent 48x48 -gravity center \
  67. $CWD/$PRGNAM.xpm \
  68. $PKG/usr/share/icons/hicolor/48x48/apps/$PRGNAM.png
  69. mkdir -p $PKG/usr/share/pixmaps
  70. ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  71. cat $CWD/$PRGNAM.xpm > $PKG/usr/share/pixmaps/$PRGNAM.xpm
  72. # desktop files written for this SlackBuild
  73. mkdir -p $PKG/usr/share/applications
  74. for i in $PRGNAM $PRGNAM-alsa; do
  75. cat $CWD/$i.desktop > $PKG/usr/share/applications/$i.desktop
  76. done
  77. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  78. cp -a AUTHORS COPYING README $PKG/usr/doc/$PRGNAM-$VERSION
  79. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  80. mkdir -p $PKG/install
  81. cat $CWD/slack-desc > $PKG/install/slack-desc
  82. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  83. if [ "${SETCAP:-yes}" = "yes" ]; then
  84. cat $CWD/setcap.sh >> $PKG/install/doinst.sh
  85. chown root:audio $PKG/usr/bin/$PRGNAM
  86. chmod 0750 $PKG/usr/bin/$PRGNAM
  87. fi
  88. cd $PKG
  89. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE