txr.SlackBuild 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. #!/bin/bash
  2. # Slackware build script for txr
  3. # Written by B. Watson (yalhcru@gmail.com)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. # 20220518 bkw: Note: txr-274 isn't the latest release, but txr-275
  6. # fails to pass its own "make tests". I'm submitting the newest
  7. # version that does pass.
  8. cd $(dirname $0) ; CWD=$(pwd)
  9. PRGNAM=txr
  10. VERSION=${VERSION:-274}
  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. if [ "$ARCH" = "i586" ]; then
  29. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  30. LIBDIRSUFFIX=""
  31. elif [ "$ARCH" = "i686" ]; then
  32. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  33. LIBDIRSUFFIX=""
  34. elif [ "$ARCH" = "x86_64" ]; then
  35. SLKCFLAGS="-O2 -fPIC"
  36. LIBDIRSUFFIX="64"
  37. else
  38. SLKCFLAGS="-O2"
  39. LIBDIRSUFFIX=""
  40. fi
  41. set -e
  42. rm -rf $PKG
  43. mkdir -p $TMP $PKG $OUTPUT
  44. cd $TMP
  45. rm -rf $PRGNAM-$VERSION
  46. tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
  47. cd $PRGNAM-$VERSION
  48. chown -R root:root .
  49. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  50. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  51. # 20220506 bkw: N.B. this is not a regular autoconf script.
  52. ./configure \
  53. --prefix=/usr \
  54. --opt-flags="$SLKCFLAGS" \
  55. --mandir=man \
  56. --parallelmake \
  57. --install-prefix=$PKG
  58. make VERBOSE=1
  59. [ "${MAKETESTS:-no}" = "yes" ] && make tests
  60. make install
  61. strip $PKG/usr/bin/$PRGNAM
  62. gzip -9 $PKG/usr/man/man*/*
  63. # 20220519 bkw: install vim syntax stuff, but don't use
  64. # the main vim dir with the version number embedded in it
  65. # (e.g. /usr/share/vim/vim82). vim finds the files just fine here,
  66. # and they survive across vim updates:
  67. VIMF=$PKG/usr/share/vim/vimfiles
  68. mkdir -p $VIMF/{syntax,ftdetect}
  69. cp -a *.vim $VIMF/syntax
  70. cat <<EOF >$VIMF/ftdetect/txr.vim
  71. autocmd BufRead,BufNewFile *.txr set filetype=txr | set lisp
  72. autocmd BufRead,BufNewFile *.tl,*.tlo set filetype=tl | set lisp
  73. EOF
  74. # 20220519 bkw: don't include ChangeLog-2009-2015, it's >700KB and the
  75. # author stopped updating it over 150 releases ago. HACKING-toc.txr is
  76. # a script, not documentation.
  77. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  78. mkdir -p $PKGDOC
  79. cp -a HACKING RELNOTES $PKGDOC
  80. ln -s ../../share/$PRGNAM/{META,}LICENSE $PKGDOC
  81. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  82. mkdir -p $PKG/install
  83. cat $CWD/slack-desc > $PKG/install/slack-desc
  84. cd $PKG
  85. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE