xpra.SlackBuild 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/bin/bash
  2. # Slackware build script for xpra
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=xpra
  7. VERSION=${VERSION:-4.3}
  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. CWD=$(pwd)
  23. TMP=${TMP:-/tmp/SBo}
  24. PKG=$TMP/package-$PRGNAM
  25. OUTPUT=${OUTPUT:-/tmp}
  26. # no SLKCFLAGS because I don't see how to force setup.py to use it.
  27. # no LIBDIRSUFFIX needed.
  28. set -e
  29. rm -rf $PKG
  30. mkdir -p $TMP $PKG $OUTPUT
  31. cd $TMP
  32. rm -rf $PRGNAM-$VERSION
  33. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  34. cd $PRGNAM-$VERSION
  35. tar xvf $CWD/$PRGNAM-$VERSION-prebuilt-docs.tar.xz
  36. chown -R root:root .
  37. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  38. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  39. sed -i 's,"share/man","man",' setup.py
  40. # without-strict turns off -Werror. without-docs because we don't want
  41. # pandoc *and its 139 deps* as a dependency. Include prebuilt docs
  42. # instead.
  43. python3 setup.py install \
  44. --root=$PKG \
  45. --without-docs \
  46. --without-strict \
  47. --without-debug
  48. # This is *much* faster than using 'file' to classify them.
  49. find $PKG/usr/lib* -name '*.so' | xargs strip --strip-unneeded
  50. gzip -9 $PKG/usr/man/man?/*
  51. # put the icons in the right places.
  52. cd $PKG/usr/share/icons
  53. for i in *.png; do
  54. px="$( identify $i | cut -d' ' -f3 )"
  55. mkdir -p hicolor/$px/apps
  56. mv $i hicolor/$px/apps
  57. done
  58. cd -
  59. mkdir -p $PKG/usr/share/pixmaps
  60. ln -s ../icons/hicolor/64x64/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  61. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  62. mkdir -p $PKGDOC/html
  63. # Instead of requiring pandoc's insanely long chain of deps, use
  64. # prebuilt docs. See mkdoc.sh for details.
  65. cp -a $PRGNAM-$VERSION-prebuilt-docs/* $PKGDOC/html
  66. cp -a COPYING README.md $PKGDOC
  67. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  68. mkdir -p $PKG/install
  69. cat $CWD/slack-desc > $PKG/install/slack-desc
  70. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  71. cd $PKG
  72. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE