ghostscript.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. ##
  2. ## ghostscript.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.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 7.04
  27. %define V_mini 704
  28. %define V_font 6.0
  29. %define V_jpeg 6b
  30. %define V_png 1.2.1
  31. %define V_zlib 1.1.4
  32. # package options
  33. %ifndef with_x11
  34. %define with_x11 %{l_test -p x11}
  35. %endif
  36. # package information
  37. Name: ghostscript
  38. Summary: Ghostscript, Postscript and PDF Rendering Engine
  39. URL: http://www.cs.wisc.edu/~ghost/
  40. Vendor: Aladdin Enterprises
  41. Packager: The OpenPKG Project
  42. Distribution: OpenPKG [BASE]
  43. Group: Graphics
  44. License: Aladdin
  45. Version: %{V_real}
  46. Release: 20021013
  47. # list of sources
  48. Source0: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs%{V_mini}/ghostscript-%{V_real}.tar.bz2
  49. Source1: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs%{V_mini}/jpegsrc.v%{V_jpeg}.tar.gz
  50. Source2: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs%{V_mini}/libpng-%{V_png}.tar.gz
  51. Source3: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs%{V_mini}/zlib-%{V_zlib}.tar.gz
  52. Source4: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-std-%{V_font}.tar.gz
  53. Source5: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-other-%{V_font}.tar.gz
  54. # build information
  55. Prefix: %{l_prefix}
  56. BuildRoot: %{l_buildroot}
  57. BuildPreReq: OpenPKG, openpkg >= 20021002, gcc
  58. PreReq: OpenPKG, openpkg >= 20021002
  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 ability to
  67. convert PostScript language files to many raster formats, view them on
  68. displays, and print them on printers that don't have PostScript
  69. language capability built in. It also works with Portable Document Format
  70. files (PDF), providing the same set of functionality as with PostScript.
  71. Options:
  72. --define 'with_x11 %{with_x11}'
  73. %prep
  74. %setup0 -q -c
  75. %setup1 -q -T -D -a 1
  76. %setup2 -q -T -D -a 2
  77. %setup3 -q -T -D -a 3
  78. %setup4 -q -T -D -a 4
  79. %setup5 -q -T -D -a 5
  80. mv jpeg-%{V_jpeg} gs%{version}/jpeg
  81. mv libpng-%{V_png} gs%{version}/libpng
  82. mv zlib-%{V_zlib} gs%{version}/zlib
  83. %build
  84. mtcflags=""
  85. mtldflags=""
  86. case "%{l_target}" in
  87. *-freebsd* ) mtcflags=""; mtldflags="-lc_r" ;;
  88. *-linux* ) mtcflags=""; mtldflags="-lpthread" ;;
  89. *-solaris* ) mtcflags=""; mtldflags="-lpthread" ;;
  90. esac
  91. cd gs%{version}
  92. %if "%{with_x11}" == "yes"
  93. x11_inc="-I`%{l_prefix}/etc/rc --query x11_incdir`"
  94. x11_lib="-L`%{l_prefix}/etc/rc --query x11_libdir`"
  95. %else
  96. x11_inc=""
  97. x11_lib=""
  98. %endif
  99. %{l_shtool} subst \
  100. -e "s;^STDLIBS=-lpthread -lm;STDLIBS=$mtldflags -lm;" \
  101. -e "s;^prefix = /usr/local;prefix = %{l_prefix};" \
  102. -e "s;CC=gcc;CC=%{l_cc};" \
  103. -e "s;GCFLAGS=.*\\(-fno.*\\)\$;GCFLAGS=\$1;" \
  104. -e "s;XCFLAGS=.*\$;XCFLAGS=$mtcflags;" \
  105. -e "s;XINCLUDE=.*\$;XINCLUDE=$x11_inc;" \
  106. -e "s;XLIBDIRS=.*\$;XLIBDIRS=$x11_lib;" \
  107. src/unix-gcc.mak
  108. %if "%{with_x11}" != "yes"
  109. %{l_shtool} subst \
  110. -e 's;DEVICE_DEVS=.*$;DEVICE_DEVS=;' \
  111. src/unix-gcc.mak
  112. %endif
  113. %{l_make} %{l_mflags} -f src/unix-gcc.mak
  114. %install
  115. rm -rf $RPM_BUILD_ROOT
  116. ( cd gs%{version}
  117. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  118. %{l_make} %{l_mflags} -f src/unix-gcc.mak install DEVICE_DEVS="" \
  119. prefix=$RPM_BUILD_ROOT%{l_prefix}
  120. )
  121. %{l_shtool} mkdir -f -p -m 755 \
  122. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts
  123. %{l_shtool} install -c fonts/* \
  124. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts/
  125. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/%{V_real}/doc
  126. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/de
  127. for prg in eps2eps gsbj gsdj gslj gsdj500 ps2pdf12; do
  128. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  129. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prg.1
  130. done
  131. mv $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf13 \
  132. $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf
  133. for prg in fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh; do
  134. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  135. done
  136. for man in ansi2knr.1; do
  137. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$man
  138. done
  139. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  140. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  141. %files -f files
  142. %clean
  143. rm -rf $RPM_BUILD_ROOT