html2ps.SlackBuild 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/sh
  2. # Slackware build script for html2ps
  3. # Copyright 2012-2014 Robby Workman, Northport, Alabama, USA
  4. # All rights reserved.
  5. #
  6. # Redistribution and use of this script, with or without modification, is
  7. # permitted provided that the following conditions are met:
  8. #
  9. # 1. Redistributions of this script must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. #
  12. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  13. # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  15. # EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  17. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  18. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  19. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  20. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  21. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  22. PRGNAM=html2ps
  23. VERSION=${VERSION:-1.0b7}
  24. BUILD=${BUILD:-3}
  25. TAG=${TAG:-_SBo}
  26. ARCH=noarch
  27. CWD=$(pwd)
  28. TMP=${TMP:-/tmp/SBo}
  29. PKG=$TMP/package-$PRGNAM
  30. OUTPUT=${OUTPUT:-/tmp}
  31. # We'll default to "letter"
  32. PAPER=${PAPER:-letter}
  33. # Paper type choices are:
  34. # A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10,
  35. # B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, B10,
  36. # letter, legal, arche, archd, archc, archb, archa,
  37. # flsa, flse, halfletter, 11x17, ledger, other
  38. rm -rf $PKG
  39. mkdir -p $TMP $PKG $OUTPUT
  40. cd $TMP
  41. rm -rf $PRGNAM-$VERSION
  42. tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
  43. cd $PRGNAM-$VERSION
  44. chown -R root:root .
  45. find -L . \
  46. \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
  47. -exec chmod 755 {} \; -o \
  48. \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
  49. -exec chmod 644 {} \;
  50. # Create the skeleton directory
  51. mkdir -p \
  52. $PKG/usr/bin \
  53. $PKG/usr/man/man1 \
  54. $PKG/usr/man/man5 \
  55. $PKG/usr/share/html2ps \
  56. $PKG/usr/doc/$PRGNAM-$VERSION
  57. # get rid of 'Use of assignment to $[ is deprecated' warning
  58. patch -p1 < $CWD/no_deprecated_assignment.diff
  59. # hardcode the answers to all the questions it wants to ask
  60. patch -p1 < $CWD/noninteractive_install.diff
  61. # noninteractive_install needs these
  62. export PKG VERSION
  63. ./install
  64. # Install xhtml2ps stuff
  65. mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps
  66. cp -a contrib/xhtml2ps/xhtml2ps $PKG/usr/bin
  67. cat $CWD/xhtml2ps.desktop > $PKG/usr/share/applications/xhtml2ps.desktop
  68. cat $CWD/xhtml2ps.png > $PKG/usr/share/pixmaps/xhtml2ps.png
  69. # Now filter out the "$PKG" strings:
  70. sed -i "s,$PKG,,g" $(find $PKG -type f -print)
  71. find $PKG/usr/man -type f -exec gzip -9 {} \;
  72. mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/xhtml2ps/
  73. cp -a COPYING README html2ps.ps $PKG/usr/doc/$PRGNAM-$VERSION
  74. cp -a contrib/xhtml2ps/LICENSE $PKG/usr/doc/$PRGNAM-$VERSION/LICENSE.xhtml2ps
  75. cp -a contrib/xhtml2ps/README $PKG/usr/doc/$PRGNAM-$VERSION/README.xhtml2ps
  76. cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
  77. mkdir -p $PKG/install
  78. cat $CWD/slack-desc > $PKG/install/slack-desc
  79. cat $CWD/doinst.sh > $PKG/install/doinst.sh
  80. cd $PKG
  81. /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}