ghostscript.spec 6.7 KB

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