ascii.SlackBuild 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #!/bin/bash
  2. # Generated by Alien's SlackBuild Toolkit: http://slackware.com/~alien/AST
  3. # Copyright 2009 Eric Hameleers <alien@slackware.com>, Eindhoven, Netherlands
  4. # Slackware build script for ascii
  5. # Based on http://slackbuilds.org/template.SlackBuild
  6. # Written by cteg <comsublant@gmx.net>
  7. cd $(dirname $0) ; CWD=$(pwd)
  8. PRGNAM=ascii
  9. VERSION=${VERSION:-3.12}
  10. BUILD=${BUILD:-1}
  11. TAG=${TAG:-_SBo}
  12. PKGTYPE=${PKGTYPE:-tgz}
  13. if [ -z "$ARCH" ]; then
  14. case "$( uname -m )" in
  15. i?86) ARCH=i486 ;;
  16. arm*) ARCH=arm ;;
  17. *) ARCH=$( uname -m ) ;;
  18. esac
  19. fi
  20. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  21. # the name of the created package would be, and then exit. This information
  22. # could be useful to other scripts.
  23. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  24. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  25. exit 0
  26. fi
  27. TMP=${TMP:-/tmp/SBo}
  28. PKG=$TMP/package-$PRGNAM
  29. OUTPUT=${OUTPUT:-/tmp}
  30. if [ "$ARCH" = "i486" ]; then
  31. SLKCFLAGS="-O2 -march=i486 -mtune=i686"
  32. LIBDIRSUFFIX=""
  33. elif [ "$ARCH" = "i686" ]; then
  34. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  35. LIBDIRSUFFIX=""
  36. elif [ "$ARCH" = "x86_64" ]; then
  37. SLKCFLAGS="-O2 -fPIC"
  38. LIBDIRSUFFIX="64"
  39. else
  40. SLKCFLAGS="-O2"
  41. LIBDIRSUFFIX=""
  42. fi
  43. set -e
  44. rm -rf $PKG
  45. mkdir -p $TMP $PKG $OUTPUT
  46. cd $TMP
  47. rm -rf $PRGNAM-$VERSION
  48. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  49. cd $PRGNAM-$VERSION
  50. chown -R root:root .
  51. find -L . \
  52. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  53. -o -perm 511 \) -exec chmod 755 {} \; -o \
  54. \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  55. -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
  56. make \
  57. CFLAGS="$SLKCFLAGS" \
  58. CXXFLAGS="$SLKCFLAGS"
  59. mkdir -p $PKG/usr/bin $PKG/usr/man/man1
  60. cp -a ascii $PKG/usr/bin
  61. strip --strip-unneeded $PKG/usr/bin/ascii
  62. gzip -9c ascii.1 > $PKG/usr/man/man1/ascii.1.gz
  63. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  64. cp -a README COPYING ascii.cgi $PKG/usr/doc/$PRGNAM-$VERSION
  65. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  66. mkdir -p $PKG/install
  67. cat $CWD/slack-desc > $PKG/install/slack-desc
  68. cd $PKG
  69. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE