kbgoffice.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. #
  3. # SlackBuild for KBGOffice Assistant
  4. # Written by Georgi D. Sotirov <gdsotirov@dir.bg>
  5. # Modified by Martin A. Ivanov <tramni@abv.bg>
  6. #
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=kbgoffice
  9. VERSION=${VERSION:-2.1}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. if [ -z "$ARCH" ]; then
  14. case "$( uname -m )" in
  15. i?86) ARCH=i686 ;;
  16. arm*) ARCH=arm ;;
  17. *) ARCH=$( uname -m ) ;;
  18. esac
  19. fi
  20. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  21. # the name of the created package would be, and then exit. This information
  22. # could be useful to other scripts.
  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-$VERSION
  48. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . \
  52. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  53. -exec chmod 755 {} \; -o \
  54. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  55. -exec chmod 644 {} \;
  56. # Thanks debian
  57. patch -p1 < $CWD/gcc6.patch
  58. cd src
  59. sed "s:/usr/local:/usr:" -i.orig $PRGNAM.pro
  60. sed "s:/usr/local:/usr:" -i.orig main.cpp
  61. qmake-qt4 -config release
  62. CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" make
  63. make INSTALL_ROOT=$PKG install
  64. cd ..
  65. mkdir -p $PKG/usr/share/applications
  66. cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
  67. # er, no.
  68. rm -rf $PKG/${HOME:-root}/Desktop
  69. rmdir -p --ignore-fail-on-non-empty $PKG/${HOME:-root}
  70. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  71. cp -a \
  72. COPYING* ChangeLog INSTALL README THANKS TODO \
  73. $PKG/usr/doc/$PRGNAM-$VERSION
  74. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  75. find $PKG/usr/doc/$PRGNAM-$VERSION -type f -exec chown root:root {} \; -exec chmod 644 {} \;
  76. mkdir -p $PKG/install
  77. cat $CWD/slack-desc > $PKG/install/slack-desc
  78. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  79. cd $PKG
  80. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE