wgetpaste.SlackBuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/bash
  2. # Slackware build script for wgetpaste
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20201024 bkw: Attempted update for v2.30, but it appears to be
  6. # broken. The default dpaste service works fine in 2.29 and not
  7. # at all in 2.30. Only reason I'm "updating" the build is to add
  8. # comments here and in the README.
  9. # 20191130 bkw: update for v2.29. Currently only dpaste works.
  10. # 20140818 bkw:
  11. # - Updated to 2.25.
  12. # - Rewrote man page in pod.
  13. # 20150124 bkw:
  14. # - Changed the default service from bpaste to dpaste, since bpaste
  15. # seems to have stopped working.
  16. # - Get rid of zlin.dk service, as it's gone away.
  17. # - Tested all services. As of this writing, these services work:
  18. # dpaste codepad gists poundpython
  19. # These do NOT work:
  20. # bpaste ca
  21. # I haven't tried very hard to get the non-working ones to work, let me know
  22. # if you manage it. I notice ca has captchas now, so it'll likely never
  23. # work with a script.
  24. # - Documented non-working services in man page.
  25. # - Replaced no_gentooisms.diff with some sed stuff.
  26. # - Bumped BUILD to 2.
  27. # 20160721 bkw:
  28. # - Updated to 2.28.
  29. # - Leave default service as-is (it's now poundpython).
  30. # - Really remove no_gentooisms.diff.
  31. cd $(dirname $0) ; CWD=$(pwd)
  32. PRGNAM=wgetpaste
  33. VERSION=${VERSION:-2.29}
  34. BUILD=${BUILD:-1}
  35. TAG=${TAG:-_SBo}
  36. PKGTYPE=${PKGTYPE:-tgz}
  37. ARCH=noarch
  38. ZSHDIR=/usr/share/zsh/site-functions
  39. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  40. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  41. exit 0
  42. fi
  43. TMP=${TMP:-/tmp/SBo}
  44. PKG=$TMP/package-$PRGNAM
  45. OUTPUT=${OUTPUT:-/tmp}
  46. set -e
  47. rm -rf $PKG
  48. mkdir -p $TMP $OUTPUT $PKG/usr/bin $PKG/etc/$PRGNAM.d $PKG/usr/man/man1 $PKG/$ZSHDIR
  49. cd $TMP
  50. rm -rf $PRGNAM-$VERSION
  51. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  52. cd $PRGNAM-$VERSION
  53. chown -R root:root .
  54. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  55. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  56. # Un-gentoo-ize the help and error messages, use wgetpaste_info for the
  57. # -i and -I options.
  58. sed -i \
  59. -e 's,emerge --info,wgetpaste_info,g' \
  60. -e 's,emerge x11-misc/,install ,g' \
  61. -e 's,x11-misc/,,g' \
  62. -e '/^INFO_ARGS/s,"[^"]*","",' \
  63. $PRGNAM
  64. # used to do this:
  65. ## -e '/^DEFAULT_SERVICE/s,bpaste,dpaste,' \
  66. ## Set default paste service to something that works,
  67. ## since bpaste has stopped working.
  68. # no longer needed as the default is now poundpython, per upstream.
  69. # No 'make install', do it manually:
  70. install -groot -oroot -m0755 $PRGNAM $PKG/usr/bin
  71. install -groot -oroot -m0644 _$PRGNAM $PKG/$ZSHDIR
  72. install -groot -oroot -m0644 $CWD/$PRGNAM.example $PKG/etc/$PRGNAM.conf.sample
  73. install -groot -oroot -m0755 $CWD/${PRGNAM}_info $PKG/usr/bin
  74. # Man page made from --help output, by way of POD.
  75. gzip -9c $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
  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