heyu.SlackBuild 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. # Slackware build script for heyu
  3. # Written by B. Watson (urchlay@slackware.uk)
  4. # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
  5. cd $(dirname $0) ; CWD=$(pwd)
  6. PRGNAM=heyu
  7. VERSION=${VERSION:-2.10.3}
  8. BUILD=${BUILD:-1}
  9. TAG=${TAG:-_SBo}
  10. PKGTYPE=${PKGTYPE:-tgz}
  11. if [ -z "$ARCH" ]; then
  12. case "$( uname -m )" in
  13. i?86) ARCH=i586 ;;
  14. arm*) ARCH=arm ;;
  15. *) ARCH=$( uname -m ) ;;
  16. esac
  17. fi
  18. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  19. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  20. exit 0
  21. fi
  22. TMP=${TMP:-/tmp/SBo}
  23. PKG=$TMP/package-$PRGNAM
  24. OUTPUT=${OUTPUT:-/tmp}
  25. if [ "$ARCH" = "i586" ]; then
  26. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  27. elif [ "$ARCH" = "i686" ]; then
  28. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  29. elif [ "$ARCH" = "x86_64" ]; then
  30. SLKCFLAGS="-O2 -fPIC"
  31. fi
  32. set -e
  33. rm -rf $PKG
  34. mkdir -p $TMP $PKG $OUTPUT
  35. cd $TMP
  36. rm -rf $PRGNAM-$VERSION
  37. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  38. cd $PRGNAM-$VERSION
  39. chown -R root:root .
  40. find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
  41. \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
  42. ./Configure
  43. # Configure script doesn't support CFLAGS, and the Makefile's CFLAGS
  44. # include a bunch of program-specific defines, so:
  45. sed -i 's/-g -O/'"$SLKCFLAGS"/ Makefile
  46. # Don't do interactive "where do I install the config file?" step
  47. sed -i '/\.\/install\.sh *$/d' Makefile
  48. make
  49. strip $PRGNAM
  50. make install BIN=$PKG/usr/bin MAN=$PKG/usr/man/man1 MAN5=$PKG/usr/man/man5
  51. gzip -9 $PKG/usr/man/man?/*.?
  52. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  53. cp README* *.txt COPYING $PKG/usr/doc/$PRGNAM-$VERSION
  54. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  55. mkdir -p $PKG/etc/$PRGNAM
  56. cp x10.sched.sample $PKG/etc/$PRGNAM
  57. cp x10config.sample $PKG/etc/$PRGNAM/x10.conf.sample
  58. mkdir -p $PKG/install
  59. cat $CWD/slack-desc > $PKG/install/slack-desc
  60. cd $PKG
  61. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE