SimpleSysexxer.SlackBuild 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #!/bin/bash
  2. # Slackware build script for <SimpleSysexxer>
  3. # Written by Michales Michaloudes korgie@gmail.com
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=SimpleSysexxer
  6. VERSION=${VERSION:-0.3}
  7. BUILD=${BUILD:-2}
  8. TAG=${TAG:-_SBo}
  9. PKGTYPE=${PKGTYPE:-tgz}
  10. if [ -z "$ARCH" ]; then
  11. case "$( uname -m )" in
  12. i?86) ARCH=i586 ;;
  13. arm*) ARCH=arm ;;
  14. *) ARCH=$( uname -m ) ;;
  15. esac
  16. fi
  17. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  18. # the name of the created package would be, and then exit. This information
  19. # could be useful to other scripts.
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. if [ "$ARCH" = "i586" ]; then
  28. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "i686" ]; then
  31. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. LIBDIRSUFFIX="64"
  36. else
  37. SLKCFLAGS="-O2"
  38. LIBDIRSUFFIX=""
  39. fi
  40. set -e
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  46. cd $PRGNAM-$VERSION
  47. chown -R root:root .
  48. find -L . \
  49. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  50. -exec chmod 755 {} \; -o \
  51. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  52. -exec chmod 644 {} \;
  53. sed -i "s%-O0 -g3%$SLKCFLAGS%" $PRGNAM.pro
  54. qmake-qt4 SimpleSysexxer.pro
  55. make
  56. # manual copy of translations
  57. mkdir -p $PKG/usr/share/simplesysexxer/locale
  58. cp -p $TMP/$PRGNAM-$VERSION/binincludes/translations/*qm $PKG/usr/share/simplesysexxer/locale/
  59. # INSTALL_ROOT for .desktop file and icons
  60. make install DESTDIR=$PKG INSTALL_ROOT=$PKG
  61. # Add categories to .desktop or the icon will go in lost+found in menu of KDE
  62. sed -i -e 's/Categories.*/Categories=KDE;Qt;MIDI;Audio;Sound;AudioVideo/' $PKG/usr/share/applications/simplesysexxer.desktop
  63. # Move executable
  64. mv $PKG/usr/local/bin $PKG/usr
  65. rmdir $PKG/usr/local
  66. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  67. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  68. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  69. cd $TMP/$PRGNAM-$VERSION
  70. cp -a GPL-2 BUILDING CHANGELOG COPYRIGHT CREDITS $PKG/usr/doc/$PRGNAM-$VERSION
  71. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  72. mkdir -p $PKG/install
  73. cat $CWD/slack-desc > $PKG/install/slack-desc
  74. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  75. cd $PKG
  76. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE