xpra.SlackBuild 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #!/bin/bash
  2. # Slackware build script for xpra
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20230112 bkw: update for v4.4.3.
  6. # 20221217 bkw: BUILD=2.
  7. # - fix paths in config file (do not include $PKG).
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=xpra
  10. VERSION=${VERSION:-4.4.3}
  11. BUILD=${BUILD:-1}
  12. TAG=${TAG:-_SBo}
  13. PKGTYPE=${PKGTYPE:-tgz}
  14. if [ -z "$ARCH" ]; then
  15. case "$( uname -m )" in
  16. i?86) ARCH=i586 ;;
  17. arm*) ARCH=arm ;;
  18. *) ARCH=$( uname -m ) ;;
  19. esac
  20. fi
  21. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  22. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  23. exit 0
  24. fi
  25. TMP=${TMP:-/tmp/SBo}
  26. PKG=$TMP/package-$PRGNAM
  27. OUTPUT=${OUTPUT:-/tmp}
  28. # no SLKCFLAGS because I don't see how to force setup.py to use it.
  29. # no LIBDIRSUFFIX needed.
  30. set -e
  31. rm -rf $PKG
  32. mkdir -p $TMP $PKG $OUTPUT
  33. cd $TMP
  34. rm -rf $PRGNAM-$VERSION
  35. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  36. cd $PRGNAM-$VERSION
  37. tar xvf $CWD/$PRGNAM-$VERSION-prebuilt-docs.tar.xz
  38. chown -R root:root .
  39. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  40. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  41. # setup.py is slightly broken...
  42. patch -p1 < $CWD/setup_cuda_bin.diff
  43. sed -i 's,"share/man","man",' setup.py
  44. # without-strict turns off -Werror. without-docs because we don't want
  45. # pandoc *and its 139 deps* as a dependency. Include prebuilt docs
  46. # instead.
  47. # 20230112 bkw: pandoc now has 196 deps... Could use pandoc-bin, but
  48. # it doesn't do 32-bit. Still using prebuilt docs for now.
  49. python3 setup.py install \
  50. --root=$PKG \
  51. --without-docs \
  52. --without-strict \
  53. --without-debug
  54. # 20221217 bkw: grrr. $PKG getting hardcoded in config file.
  55. sed -i "s,$PKG,,g" $PKG/etc/xpra/conf.d/55_server_x11.conf
  56. # 20230112 bkw: a few things are getting installed in the wrong place.
  57. mkdir -p $PKG/lib
  58. mv $PKG/usr/lib/udev $PKG/lib
  59. if [ -d $PKG/usr/lib64 ]; then
  60. mv $PKG/usr/lib/cups $PKG/usr/lib64
  61. fi
  62. # /usr/lib/{sysusers.d,tmpfiles.d} are for systemd. Apparently they
  63. # are in the correct place, I'll leave them there (they won't hurt
  64. # anything and apparently there are Slackware derivatives that use
  65. # systemd).
  66. # rm -rf $PKG/usr/lib/{sysusers.d,tmpfiles.d}
  67. # This is *much* faster than using 'file' to classify them.
  68. find $PKG/usr/lib* -name '*.so' | xargs strip --strip-unneeded
  69. gzip -9 $PKG/usr/man/man?/*
  70. # put the icons in the right places.
  71. cd $PKG/usr/share/icons
  72. for i in *.png; do
  73. px="$( identify $i | cut -d' ' -f3 )"
  74. mkdir -p hicolor/$px/apps
  75. mv $i hicolor/$px/apps
  76. done
  77. cd -
  78. mkdir -p $PKG/usr/share/pixmaps
  79. ln -s ../icons/hicolor/64x64/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
  80. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  81. mkdir -p $PKGDOC/html
  82. # Instead of requiring pandoc's insanely long chain of deps, use
  83. # prebuilt docs. See mkdoc.sh for details.
  84. cp -a $PRGNAM-$VERSION-prebuilt-docs/* $PKGDOC/html
  85. cp -a COPYING README.md $PKGDOC
  86. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$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