ghostscript.spec 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. ##
  2. ## ghostscript.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2010 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.70
  25. %define V_comp 870
  26. %define V_font_std 8.11
  27. %define V_font_other 6.0
  28. %define V_jpeg 8b
  29. %define V_png 1.4.2
  30. %define V_zlib 1.2.5
  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: 20100516
  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: http://www.ijg.org/files/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. BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make
  56. PreReq: OpenPKG, openpkg >= 20100101
  57. %if "%{with_x11}" == "yes"
  58. BuildPreReq: X11
  59. PreReq: X11
  60. %endif
  61. %description
  62. Ghostscript is an interpreter for the PostScript language, with the
  63. ability to convert PostScript language files to many raster formats,
  64. view them on displays, and print them on printers that don't have
  65. PostScript language capability built in. It also works with Portable
  66. Document Format files (PDF), providing the same set of functionality
  67. as with PostScript.
  68. %track
  69. prog ghostscript = {
  70. version = %{version}
  71. url = http://sourceforge.net/projects/ghostscript/files/
  72. regex = ghostscript-(__VER__)\.tar\.bz2
  73. }
  74. prog ghostscript:jpegsrc = {
  75. version = v%{V_jpeg}
  76. url = http://www.ijg.org/files/
  77. regex = jpegsrc.(__VER__)\.tar\.gz
  78. }
  79. prog ghostscript:png = {
  80. version = %{V_png}
  81. url = http://sourceforge.net/projects/libpng/files/
  82. regex = libpng-(\d+\.\d+\.\d+)\.tar\.gz
  83. }
  84. prog ghostscript:zlib = {
  85. version = %{V_zlib}
  86. url = http://www.zlib.net/
  87. regex = zlib-(__VER__)\.tar\.gz
  88. }
  89. %prep
  90. %setup -q -c
  91. %setup -q -T -D -a 1
  92. %setup -q -T -D -a 2
  93. %setup -q -T -D -a 3
  94. %setup -q -T -D -a 4
  95. %setup -q -T -D -a 5
  96. mv jpeg-%{V_jpeg} ghostscript-%{version}/jpeg
  97. mv libpng-%{V_png} ghostscript-%{version}/libpng
  98. mv zlib-%{V_zlib} ghostscript-%{version}/zlib
  99. %patch -p0 -d ghostscript-%{version}
  100. %build
  101. mtcflags=""
  102. mtldflags=""
  103. case "%{l_platform -t}" in
  104. *-freebsd* ) mtcflags=""; mtldflags="-lc_r" ;;
  105. *-linux* ) mtcflags=""; mtldflags="-lpthread" ;;
  106. *-sunos* ) mtcflags=""; mtldflags="-lpthread" ;;
  107. esac
  108. cd ghostscript-%{version}
  109. %if "%{with_x11}" == "yes"
  110. x11_inc="-Ijpeg -I`%{l_rc} --query x11_incdir`"
  111. x11_lib="-L`%{l_rc} --query x11_libdir`"
  112. x11_ext=""
  113. [ -f `%{l_rc} --query x11_libdir`/libSM.a ] && x11_ext="$x11_ext -lSM"
  114. [ -f `%{l_rc} --query x11_libdir`/libICE.a ] && x11_ext="$x11_ext -lICE"
  115. %else
  116. x11_inc=""
  117. x11_lib=""
  118. x11_ext=""
  119. %endif
  120. %if "%{with_a4}" == "yes"
  121. mtcflags="$mtcflags -DA4"
  122. %endif
  123. %{l_shtool} subst \
  124. -e "s;^STDLIBS=-lpthread -lm;STDLIBS=$mtldflags -lm;" \
  125. -e "s;^EXTRALIBS=.*$;EXTRALIBS=$x11_lib $x11_ext;" \
  126. -e "s;^prefix = /usr/local;prefix = %{l_prefix};" \
  127. -e "s;CC=gcc;CC=%{l_cc};" \
  128. -e "s;GCFLAGS=.*\\(-fno.*\\)\$;GCFLAGS=\$1;" \
  129. -e "s;XCFLAGS=.*\$;XCFLAGS=$mtcflags;" \
  130. -e "s;XINCLUDE=.*\$;XINCLUDE=$x11_inc;" \
  131. -e "s;XLIBDIRS=.*\$;XLIBDIRS=$x11_lib;" \
  132. base/unix-gcc.mak
  133. %if "%{with_x11}" != "yes"
  134. %{l_shtool} subst \
  135. -e 's;DEVICE_DEVS=.*$;DEVICE_DEVS=;' \
  136. base/unix-gcc.mak
  137. %endif
  138. %{l_make} %{l_mflags} -f base/unix-gcc.mak
  139. %install
  140. ( cd ghostscript-%{version}
  141. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  142. %{l_make} %{l_mflags} -f base/unix-gcc.mak install DEVICE_DEVS="" \
  143. prefix=$RPM_BUILD_ROOT%{l_prefix}
  144. ) || exit $?
  145. %{l_shtool} mkdir -f -p -m 755 \
  146. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts
  147. %{l_shtool} install -c fonts/* \
  148. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts/
  149. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/%{V_real}/doc
  150. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/de
  151. for prg in eps2eps gsbj gsdj gslj gsdj500 ps2pdf12 ps2pdf13; do
  152. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  153. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prg.1
  154. done
  155. mv $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf14 \
  156. $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf
  157. for prg in fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh; do
  158. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  159. done
  160. for man in ansi2knr.1; do
  161. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$man
  162. done
  163. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  164. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  165. %files -f files
  166. %clean