eawpats.SlackBuild 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #!/bin/bash
  2. # Slackware build script for eawpats
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # If the main download URL goes away, try
  6. # http://www.george.ca/interests/eawpats12_full.tar.gz
  7. # This is the original author's site, but it's more polite to download
  8. # from the gentoo mirror (see .info file)
  9. # 20230111 bkw: BUILD=4, symlink eawpats.cfg to /etc/timidity.cfg (the
  10. # "old" location), since SDL 1.2's SDL_mixer still uses it. Makes the
  11. # music work in odamex (and probably various other games). Also add
  12. # a douninst.sh that will remove the symlinks if they still point
  13. # to eawpats.cfg.
  14. # 20191201 bkw: symlink eawpats.cfg to timidity.cfg in doinst.sh,
  15. # if there's no timidity.cfg already. This makes things Just Work(tm).
  16. # 20140511 bkw: one patch was missing due to tar being silly.
  17. # When extracting (with tar, which is really tar-1.26 on slack 14.1):
  18. # tar: eawpats/charang.pat: implausibly old time stamp 1969-12-31 18:59:59
  19. # The file gets extracted fine, it's just a warning. But the old tar-1.13
  20. # used by makepkg just ignores the file, so it doesn't end up
  21. # in the package! The fix is just to touch it after extraction.
  22. # I only ever noticed this because allegro's pat2dat chokes on
  23. # missing patches.
  24. cd $(dirname $0) ; CWD=$(pwd)
  25. PRGNAM=eawpats
  26. VERSION=${VERSION:-12}
  27. SRCVER=${VERSION}_full
  28. ARCH=noarch
  29. BUILD=${BUILD:-4}
  30. TAG=${TAG:-_SBo}
  31. PKGTYPE=${PKGTYPE:-tgz}
  32. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  33. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  34. exit 0
  35. fi
  36. TMP=${TMP:-/tmp/SBo}
  37. PKG=$TMP/package-$PRGNAM
  38. OUTPUT=${OUTPUT:-/tmp}
  39. set -e
  40. rm -rf $PKG
  41. mkdir -p $TMP $PKG $OUTPUT
  42. cd $TMP
  43. rm -rf $PRGNAM
  44. tar xvf $CWD/$PRGNAM$SRCVER.tar.gz
  45. cd $PRGNAM
  46. chown -R root:root .
  47. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  48. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  49. # see above
  50. touch charang.pat
  51. # Un-DOSify text files
  52. find . -type f -print0 | xargs -0 file | grep 'text.*CRLF' | \
  53. cut -d: -f1 | xargs perl -i -pe 's/\r//g'
  54. mkdir -p $PKG/usr/share/sounds/$PRGNAM $PKG/etc/timidity
  55. egrep -v '^($|#)' linuxconfig/timidity.cfg | \
  56. sed 's,/home/user,/usr/share/sounds,' > \
  57. $PKG/etc/timidity/$PRGNAM.cfg.new
  58. rm -rf winconfig linuxconfig
  59. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  60. mv *.txt $PKG/usr/doc/$PRGNAM-$VERSION
  61. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  62. mv * $PKG/usr/share/sounds/$PRGNAM
  63. mkdir -p $PKG/install
  64. cat $CWD/slack-desc > $PKG/install/slack-desc
  65. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  66. cat $CWD/douninst.sh > $PKG/install/douninst.sh
  67. cd $PKG
  68. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE