ghostscript.spec 6.6 KB

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