shiboken.SlackBuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #!/bin/bash
  2. # Slackware build script for shiboken
  3. # Written by Grissiom <chaos.proton@gmail.com>
  4. # Updated by kchan <kenneth.t.chan@gmail.com>
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=shiboken
  7. VERSION=${VERSION:-1.2.2}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. if [ "$ARCH" = "i586" ]; then
  26. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  27. LIBDIRSUFFIX=""
  28. elif [ "$ARCH" = "i686" ]; then
  29. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "x86_64" ]; then
  32. SLKCFLAGS="-O2 -fPIC"
  33. LIBDIRSUFFIX="64"
  34. else
  35. SLKCFLAGS="-O2"
  36. LIBDIRSUFFIX=""
  37. fi
  38. set -e
  39. rm -rf $PKG
  40. mkdir -p $TMP $PKG $OUTPUT
  41. cd $TMP
  42. rm -rf $PRGNAM-$VERSION
  43. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  44. cd $PRGNAM-$VERSION
  45. chown -R root:root .
  46. find -L . \
  47. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  48. -exec chmod 755 {} \+ -o \
  49. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  50. -exec chmod 644 {} \+
  51. mkdir -p build
  52. cd build
  53. cmake \
  54. -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
  55. -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
  56. -DCMAKE_INSTALL_PREFIX=/usr \
  57. -DCMAKE_VERBOSE_MAKEFILE:BOOL="on" \
  58. -DLIB_SUFFIX=${LIBDIRSUFFIX} \
  59. -DBUILD_TESTS:BOOL=OFF \
  60. -DENABLE_GCC_OPTIMIZATION:BOOL=ON \
  61. -DCMAKE_BUILD_TYPE=Release \
  62. ..
  63. make
  64. make install DESTDIR=$PKG
  65. cd ..
  66. find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
  67. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  68. mv $PKG/usr/share/man $PKG/usr
  69. rmdir $PKG/usr/share
  70. find $PKG/usr/man -type f -exec gzip -9 {} \;
  71. for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
  72. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  73. cp -a ChangeLog COPYING* \
  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