home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / ap / ghostscr / slackbui < prev   
Text File  |  1995-10-10  |  3KB  |  106 lines

  1. #!/bin/sh
  2. # Set initial variables:
  3. CWD=`pwd`
  4. if [ "$TMP" = "" ]; then
  5.   TMP=/tmp
  6. fi
  7. PKG1=$TMP/package-ghostscr
  8. PKG2=$TMP/package-gs_x11
  9. SRC=/devel/manpagesrc
  10. INFO=/devel/info-pages/usr/info
  11. TEX=/devel/texinfo-docs
  12.  
  13. if [ ! -d $TMP ]; then
  14.   mkdir -p $TMP # location to build the source
  15. fi
  16. for dir in $PKG1 $PKG2 ; do
  17.   if [ ! -d $dir ]; then
  18.     mkdir -p $dir # place for the package to be built
  19.   fi
  20. done
  21.  
  22. # Explode the package framework:
  23. cd $PKG1
  24. explodepkg $CWD/_ghostscr.tar.gz
  25. cd $PKG2
  26. explodepkg $CWD/_gs_x11.tar.gz
  27.  
  28. # Function to handle manpage source:
  29. man2gz () { # $1 is source page name, $2 is target name for preformatted
  30.             # output (full path && name) and $3 is the same, but for the
  31.             # source.
  32.   mkdir -p `dirname $2`
  33.   groff -Tascii -mandoc $1 | gzip -9c > $2
  34.   if [ ! "$3" = "" ]; then
  35.     mkdir -p `dirname $3`
  36.     cat $1 > $3 
  37.   fi 
  38. }
  39.  
  40. echo "+===================+"
  41. echo "| ghostscript-2.6.2 |"
  42. echo "+===================+"
  43. cd $TMP
  44. tar xzvf $CWD/ghostscript-2.6.2.tar.gz
  45. cd gs262
  46. # Patch the source:
  47. zcat $CWD/Makefile-no-x11.gz > Makefile
  48. zcat $CWD/gdevlinux.c.gz > gdevlinux.c
  49. zcat $CWD/gs.1.diff.gz | patch
  50. zcat $CWD/gs.c.diff.gz | patch
  51. # Save the patches in the new package:
  52. zcat $CWD/Makefile.gz > $PKG1/usr/src/ghostscript-2.6.2/Makefile
  53. zcat $CWD/Makefile-no-x11.gz > $PKG1/usr/src/ghostscript-2.6.2/Makefile-no-x11
  54. zcat $CWD/gdevlinux.c.gz > $PKG1/usr/src/ghostscript-2.6.2/gdevlinux.c
  55. zcat $CWD/gs.1.diff.gz > $PKG1/usr/src/ghostscript-2.6.2/gs.1.diff
  56. zcat $CWD/gs.c.diff.gz > $PKG1/usr/src/ghostscript-2.6.2/gs.c.diff
  57. # Build the first package:
  58. make
  59. cat bdftops > $PKG1/usr/bin/bdftops
  60. cat font2c > $PKG1/usr/bin/font2c
  61. cat gs > $PKG1/usr/bin/gs
  62. cat gsbj > $PKG1/usr/bin/gsbj
  63. cat gsdj > $PKG1/usr/bin/gsdj
  64. cat gslj > $PKG1/usr/bin/gslj
  65. cat gslp > $PKG1/usr/bin/gslp
  66. cat gsnd > $PKG1/usr/bin/gsnd
  67. cat ps2ascii > $PKG1/usr/bin/ps2ascii
  68. cat ps2epsi > $PKG1/usr/bin/ps2epsi
  69. cat gs.1 | gzip -9c > $PKG1/usr/man/man1/gs.1.gz
  70. for file in README gslp.ps gs_init.ps gs_dps1.ps gs_fonts.ps gs_lev2.ps \
  71.   gs_statd.ps gs_type0.ps gs_dbt_e.ps gs_sym_e.ps quit.ps Fontmap uglyr.gsf \
  72.   bdftops.ps decrypt.ps font2c.ps impath.ps landscap.ps level1.ps prfont.ps \
  73.   ps2ascii.ps ps2epsi.ps ps2image.ps pstoppm.ps showpage.ps type1ops.ps \
  74.   wrfont.ps ; do 
  75.   cp $file $PKG1/usr/lib/ghostscript
  76. done
  77. for file in NEWS ansi2knr.1 devices.doc drivers.doc fonts.doc gs.1 hershey.doc \
  78.   history.doc humor.doc language.doc lib.doc make.doc ps2epsi.doc \
  79.   psfiles.doc readme.doc use.doc xfonts.doc ; do 
  80.   cp $file $PKG1/usr/lib/ghostscript/doc
  81. done
  82. for file in chess.ps cheq.ps colorcir.ps golfer.ps escher.ps snowflak.ps \
  83.   tiger.ps ; do 
  84.   cp $file $PKG1/usr/lib/ghostscript/examples
  85. done
  86. chown -R root.root $PKG1/usr/lib/ghostscript
  87. find $PKG1/usr/lib/ghostscript -type f -exec chmod 644 {} \;
  88. # Now, we need to make the /usr/bin/gs with X11 support:
  89. make clean
  90. zcat $CWD/Makefile.gz > Makefile
  91. make
  92. cat gs > $PKG2/usr/bin/gs
  93.  
  94. # Build the package:
  95. cd $PKG1
  96. tar czvf $TMP/ghostscr.tgz .
  97. cd $PKG2
  98. tar czvf $TMP/gs_x11.tgz .
  99.  
  100. # Clean up the extra stuff:
  101. if [ "$1" = "--cleanup" ]; then
  102.   rm -rf $TMP/gs262
  103.   rm -rf $PKG1
  104.   rm -rf $PKG2
  105. fi
  106.