ghostscript.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ##
  2. ## ghostscript.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2003 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package versions
  26. %define V_real 8.11
  27. %define V_comp 811
  28. %define V_font_std 8.11
  29. %define V_font_other 6.0
  30. %define V_jpeg 6b
  31. %define V_png 1.2.5
  32. %define V_zlib 1.1.4
  33. # package information
  34. Name: ghostscript
  35. Summary: Ghostscript, Postscript and PDF Rendering Engine
  36. URL: http://www.cs.wisc.edu/~ghost/
  37. Vendor: Aladdin Enterprises
  38. Packager: The OpenPKG Project
  39. Distribution: OpenPKG [BASE]
  40. Group: Graphics
  41. License: Aladdin
  42. Version: %{V_real}
  43. Release: 20031011
  44. # package options
  45. %option with_x11 yes
  46. %option with_a4 yes
  47. # list of sources
  48. Source0: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs%{V_comp}/ghostscript-%{V_real}.tar.bz2
  49. Source1: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{V_jpeg}.tar.gz
  50. Source2: http://osdn.dl.sourceforge.net/sourceforge/libpng/libpng-%{V_png}.tar.gz
  51. Source3: http://www.gzip.org/zlib/zlib-%{V_zlib}.tar.gz
  52. Source4: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-std-%{V_font_std}.tar.gz
  53. Source5: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-other-%{V_font_other}.tar.gz
  54. # build information
  55. Prefix: %{l_prefix}
  56. BuildRoot: %{l_buildroot}
  57. BuildPreReq: OpenPKG, openpkg >= 20030909, gcc, make
  58. PreReq: OpenPKG, openpkg >= 20030909
  59. %if "%{with_x11}" == "yes"
  60. BuildPreReq: X11
  61. PreReq: X11
  62. %endif
  63. AutoReq: no
  64. AutoReqProv: no
  65. %description
  66. Ghostscript is an interpreter for the PostScript language, with the
  67. ability to convert PostScript language files to many raster formats,
  68. view them on displays, and print them on printers that don't have
  69. PostScript language capability built in. It also works with Portable
  70. Document Format files (PDF), providing the same set of functionality
  71. as with PostScript.
  72. %prep
  73. %setup0 -q -c
  74. %setup1 -q -T -D -a 1
  75. %setup2 -q -T -D -a 2
  76. %setup3 -q -T -D -a 3
  77. %setup4 -q -T -D -a 4
  78. %setup5 -q -T -D -a 5
  79. mv jpeg-%{V_jpeg} ghostscript-%{version}/jpeg
  80. mv libpng-%{V_png} ghostscript-%{version}/libpng
  81. mv zlib-%{V_zlib} ghostscript-%{version}/zlib
  82. %build
  83. mtcflags=""
  84. mtldflags=""
  85. case "%{l_platform -t}" in
  86. *-freebsd* ) mtcflags=""; mtldflags="-lc_r" ;;
  87. *-linux* ) mtcflags=""; mtldflags="-lpthread" ;;
  88. *-sunos* ) mtcflags=""; mtldflags="-lpthread" ;;
  89. esac
  90. cd ghostscript-%{version}
  91. %if "%{with_x11}" == "yes"
  92. x11_inc="-I`%{l_prefix}/etc/rc --query x11_incdir`"
  93. x11_lib="-L`%{l_prefix}/etc/rc --query x11_libdir`"
  94. %else
  95. x11_inc=""
  96. x11_lib=""
  97. %endif
  98. %if "%{with_a4}" == "yes"
  99. mtcflags="$mtcflags -DA4"
  100. %endif
  101. %{l_shtool} subst \
  102. -e "s;^STDLIBS=-lpthread -lm;STDLIBS=$mtldflags -lm;" \
  103. -e "s;^prefix = /usr/local;prefix = %{l_prefix};" \
  104. -e "s;CC=gcc;CC=%{l_cc};" \
  105. -e "s;GCFLAGS=.*\\(-fno.*\\)\$;GCFLAGS=\$1;" \
  106. -e "s;XCFLAGS=.*\$;XCFLAGS=$mtcflags;" \
  107. -e "s;XINCLUDE=.*\$;XINCLUDE=$x11_inc;" \
  108. -e "s;XLIBDIRS=.*\$;XLIBDIRS=$x11_lib;" \
  109. src/unix-gcc.mak
  110. %if "%{with_x11}" != "yes"
  111. %{l_shtool} subst \
  112. -e 's;DEVICE_DEVS=.*$;DEVICE_DEVS=;' \
  113. src/unix-gcc.mak
  114. %endif
  115. %{l_make} %{l_mflags} -f src/unix-gcc.mak
  116. %install
  117. rm -rf $RPM_BUILD_ROOT
  118. ( cd ghostscript-%{version}
  119. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  120. %{l_make} %{l_mflags} -f src/unix-gcc.mak install DEVICE_DEVS="" \
  121. prefix=$RPM_BUILD_ROOT%{l_prefix}
  122. ) || exit $?
  123. %{l_shtool} mkdir -f -p -m 755 \
  124. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts
  125. %{l_shtool} install -c fonts/* \
  126. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts/
  127. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/%{V_real}/doc
  128. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/de
  129. for prg in eps2eps gsbj gsdj gslj gsdj500 ps2pdf12 ps2pdf13; do
  130. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  131. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prg.1
  132. done
  133. mv $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf14 \
  134. $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf
  135. for prg in fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh; do
  136. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  137. done
  138. for man in ansi2knr.1; do
  139. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$man
  140. done
  141. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  142. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  143. %files -f files
  144. %clean
  145. rm -rf $RPM_BUILD_ROOT