flowblade.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #!/bin/bash
  2. # Slackware build script for flowblade
  3. # Copyright 2015-2016 klaatu @member.fsf.org
  4. # GNU All-Permissive License
  5. # Copying and distribution of this file, with or without modification,
  6. # are permitted in any medium without royalty provided the copyright
  7. # notice and this notice are preserved. This file is offered as-is,
  8. # without any warranty.
  9. cd $(dirname $0) ; CWD=$(pwd)
  10. PRGNAM=flowblade
  11. VERSION=${VERSION:-24564a}
  12. SRCVERSION=${SRCVERSION:-24564ae0899af9ee92ad31bd884ba804a3137d3b}
  13. BUILD=${BUILD:-1}
  14. TAG=${TAG:-_SBo}
  15. PKGTYPE=${PKGTYPE:-tgz}
  16. if [ -z "$ARCH" ]; then
  17. case "$( uname -m )" in
  18. i?86) ARCH=i586 ;;
  19. arm*) ARCH=arm ;;
  20. *) ARCH=$( uname -m ) ;;
  21. esac
  22. fi
  23. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  24. # the name of the created package would be, and then exit. This information
  25. # could be useful to other scripts.
  26. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  27. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  28. exit 0
  29. fi
  30. TMP=${TMP:-/tmp/SBo}
  31. PKG=$TMP/package-$PRGNAM
  32. OUTPUT=${OUTPUT:-/tmp}
  33. if [ "$ARCH" = "i586" ]; then
  34. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "i686" ]; then
  37. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  38. LIBDIRSUFFIX=""
  39. elif [ "$ARCH" = "x86_64" ]; then
  40. SLKCFLAGS="-O2 -fPIC"
  41. LIBDIRSUFFIX="64"
  42. else
  43. SLKCFLAGS="-O2"
  44. LIBDIRSUFFIX=""
  45. fi
  46. PYTHONDIR=$(python3 -c "import sys, os; print(os.path.join('/usr/lib${LIBDIRSUFFIX}', 'python%s' % sys.version[:3], 'site-packages'))")
  47. set -e
  48. rm -rf $PKG
  49. mkdir -p $TMP $PKG $OUTPUT
  50. cd $TMP
  51. rm -rf $PRGNAM-$VERSION
  52. mkdir $PRGNAM-$VERSION
  53. tar xvf $CWD/$PRGNAM-$SRCVERSION.tar.gz --strip-components=1 \
  54. -C $PRGNAM-$VERSION
  55. mv $PRGNAM-$VERSION/README.md $PRGNAM-$VERSION/$PRGNAM-trunk
  56. cd $PRGNAM-$VERSION/$PRGNAM-trunk
  57. chown -R root:root .
  58. find -L . \
  59. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  60. -o -perm 511 \) -exec chmod 755 {} \; -o \
  61. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  62. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  63. # this has been submitted upstream but for now patch it here
  64. patch -p2 < $CWD/mlt7.patch
  65. # install
  66. python3 setup.py install --root=$PKG
  67. # replace PY path in main script
  68. sed -i "s|/usr/share/pyshared|$PYTHONDIR|" $PKG/usr/bin/$PRGNAM
  69. # remove unnecessary files
  70. rm -fr $PKG/usr/lib/mime
  71. rmdir $PKG/usr/lib || true
  72. # stripper
  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. # man
  76. mkdir -p $PKG/usr/man/man1/
  77. mv $PKG/usr/share/man/man1/$PRGNAM.1 $PKG/usr/man/man1/$PRGNAM.1
  78. rmdir $PKG/usr/share/man/man1 $PKG/usr/share/man
  79. find $PKG/usr/man -type f -exec gzip -9 {} \;
  80. # doc
  81. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  82. echo `pwd`
  83. cp -a \
  84. AUTHORS COPYING README.md \
  85. $PKG/usr/doc/$PRGNAM-$VERSION
  86. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  87. mkdir -p $PKG/install
  88. cat $CWD/slack-desc > $PKG/install/slack-desc
  89. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  90. cd $PKG
  91. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE