pstotext.SlackBuild 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash
  2. # Written by Ismael Cortés (leamsi.setroc@gmail.com)
  3. # I, as writer and author, give this script and its
  4. # intellectual property to the public domain.
  5. # Modified by Robby Workman - http://rlworkman.net
  6. cd $(dirname $0) ; CWD=$(pwd)
  7. PRGNAM=pstotext
  8. VERSION=${VERSION:-1.9}
  9. BUILD=${BUILD:-1}
  10. TAG=${TAG:-_SBo}
  11. PKGTYPE=${PKGTYPE:-tgz}
  12. if [ -z "$ARCH" ]; then
  13. case "$( uname -m )" in
  14. i?86) ARCH=i586 ;;
  15. arm*) ARCH=arm ;;
  16. *) ARCH=$( uname -m ) ;;
  17. esac
  18. fi
  19. # If the variable PRINT_PACKAGE_NAME is set, then this script will report what
  20. # the name of the created package would be, and then exit. This information
  21. # could be useful to other scripts.
  22. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
  23. echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
  24. exit 0
  25. fi
  26. TMP=${TMP:-/tmp/SBo}
  27. PKG=$TMP/package-$PRGNAM
  28. OUTPUT=${OUTPUT:-/tmp}
  29. if [ "$ARCH" = "i586" ]; then
  30. SLKCFLAGS="-O2 -march=i586 -mtune=i686"
  31. LIBDIRSUFFIX=""
  32. elif [ "$ARCH" = "i686" ]; then
  33. SLKCFLAGS="-O2 -march=i686 -mtune=i686"
  34. LIBDIRSUFFIX=""
  35. elif [ "$ARCH" = "x86_64" ]; then
  36. SLKCFLAGS="-O2 -fPIC"
  37. LIBDIRSUFFIX="64"
  38. else
  39. SLKCFLAGS="-O2"
  40. LIBDIRSUFFIX=""
  41. fi
  42. set -e
  43. rm -rf $PKG
  44. mkdir -p $TMP $PKG $OUTPUT
  45. cd $TMP
  46. rm -rf $PRGNAM-$VERSION
  47. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  48. cd $PRGNAM-$VERSION
  49. make CC="gcc $SLKCFLAGS"
  50. mkdir -p $PKG/usr/bin
  51. mv pstotext $PKG/usr/bin/
  52. chmod 0755 $PKG/usr/bin/pstotext
  53. strip --strip-unneeded $PKG/usr/bin/pstotext
  54. mkdir -p $PKG/usr/man/man1
  55. gzip -9c pstotext.1 > $PKG/usr/man/man1/pstotext.1.gz
  56. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
  57. cp -a pstotext.hlp pstotext.txt $PKG/usr/doc/$PRGNAM-$VERSION
  58. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  59. chmod 644 $PKG/usr/doc/$PRGNAM-$VERSION/*
  60. mkdir -p $PKG/install
  61. cat $CWD/slack-desc > $PKG/install/slack-desc
  62. cd $PKG
  63. chown -R root:root .
  64. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE