kphotoalbum.SlackBuild 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. #!/bin/bash
  2. # Slackware build script for kphotoalbum
  3. # By default the demo pictures and movie are packaged.
  4. cd $(dirname $0) ; CWD=$(pwd)
  5. PRGNAM=kphotoalbum
  6. VERSION=${VERSION:-5.7.0}
  7. BUILD=${BUILD:-1}
  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. # Default is to package the demo pictures and movie,
  28. # set DEMO to no to omit them.
  29. DEMO=${DEMO:-yes}
  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.xz
  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 \
  53. -o -perm 511 \) -exec chmod 755 {} \; -o \
  54. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  55. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  56. mkdir build && cd build
  57. cmake \
  58. -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
  59. -DKDE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \
  60. -DLIB_INSTALL_DIR:PATH=/usr/lib${LIBDIRSUFFIX} \
  61. -DCMAKE_INSTALL_PREFIX=/usr \
  62. ..
  63. make
  64. make install DESTDIR=$PKG
  65. cd -
  66. if [ "$DEMO" = "no" ]; then
  67. rm -r /$PKG/usr/share/apps/$PRGNAM/demo
  68. fi
  69. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  70. cp -a COPYING ChangeLog tips README.md \
  71. $PKG/usr/doc/$PRGNAM-$VERSION
  72. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  73. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
  74. | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
  75. mkdir -p $PKG/install
  76. cat $CWD/slack-desc > $PKG/install/slack-desc
  77. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  78. cd $PKG
  79. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE