tal.SlackBuild 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # Slackware build script for tal
  3. # Copyright 2022 B. Watson <urchlay@slackware.uk>
  4. # Copyright 2018 Donald Cooley South Haven, Indiana USA
  5. # Written by Peter Wang <novalazy@gmail.com>
  6. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=tal
  9. VERSION=${VERSION:-1.9}
  10. BUILD=${BUILD:-2}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. if [ -z "$ARCH" ]; then
  14. case "$( uname -m )" in
  15. i?86) ARCH=i586 ;;
  16. arm*) ARCH=arm ;;
  17. *) ARCH=$( uname -m ) ;;
  18. esac
  19. fi
  20. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  21. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  22. exit 0
  23. fi
  24. TMP=${TMP:-/tmp/SBo}
  25. PKG=$TMP/package-$PRGNAM
  26. OUTPUT=${OUTPUT:-/tmp}
  27. if [ "$ARCH" = "i586" ]; then
  28. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  29. LIBDIRSUFFIX=""
  30. elif [ "$ARCH" = "i686" ]; then
  31. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "x86_64" ]; then
  34. SLKCFLAGS="-O2 -fPIC"
  35. LIBDIRSUFFIX="64"
  36. else
  37. SLKCFLAGS="-O2"
  38. LIBDIRSUFFIX=""
  39. fi
  40. set -e
  41. rm -rf $PKG
  42. mkdir -p $TMP $PKG $OUTPUT
  43. cd $TMP
  44. rm -rf $PRGNAM-$VERSION
  45. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  46. cd $PRGNAM-$VERSION
  47. chown -R root:root .
  48. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  49. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  50. make CFLAGS="$SLKCFLAGS -ansi" tal
  51. install -D -s -m0755 $PRGNAM $PKG/usr/bin
  52. mkdir -p $PKG/usr/man/man1
  53. gzip -9c tal.1 > $PKG/usr/man/man1/tal.1.gz
  54. # INSTALL contains a vim tip so let's extract it.
  55. PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
  56. mkdir -p $PKGDOC
  57. sed -n '/^For use with vim/,$p' INSTALL > $PKGDOC/vimtip.txt
  58. cp -a LICENSE $PKGDOC
  59. cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
  60. mkdir -p $PKG/install
  61. cat $CWD/slack-desc > $PKG/install/slack-desc
  62. cd $PKG
  63. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE