ghostscript.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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: 20030918
  44. # package options
  45. %option with_x11 yes
  46. # list of sources
  47. Source0: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/gs%{V_comp}/ghostscript-%{V_real}.tar.bz2
  48. Source1: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v%{V_jpeg}.tar.gz
  49. Source2: http://osdn.dl.sourceforge.net/sourceforge/libpng/libpng-%{V_png}.tar.gz
  50. Source3: http://www.gzip.org/zlib/zlib-%{V_zlib}.tar.gz
  51. Source4: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-std-%{V_font_std}.tar.gz
  52. Source5: ftp://mirror.cs.wisc.edu/pub/mirrors/ghost/AFPL/fonts/ghostscript-fonts-other-%{V_font_other}.tar.gz
  53. # build information
  54. Prefix: %{l_prefix}
  55. BuildRoot: %{l_buildroot}
  56. BuildPreReq: OpenPKG, openpkg >= 20030909, gcc, make
  57. PreReq: OpenPKG, openpkg >= 20030909
  58. %if "%{with_x11}" == "yes"
  59. BuildPreReq: X11
  60. PreReq: X11
  61. %endif
  62. AutoReq: no
  63. AutoReqProv: no
  64. %description
  65. Ghostscript is an interpreter for the PostScript language, with the
  66. ability to convert PostScript language files to many raster formats,
  67. view them on displays, and print them on printers that don't have
  68. PostScript language capability built in. It also works with Portable
  69. Document Format files (PDF), providing the same set of functionality
  70. as with PostScript.
  71. %prep
  72. %setup0 -q -c
  73. %setup1 -q -T -D -a 1
  74. %setup2 -q -T -D -a 2
  75. %setup3 -q -T -D -a 3
  76. %setup4 -q -T -D -a 4
  77. %setup5 -q -T -D -a 5
  78. mv jpeg-%{V_jpeg} ghostscript-%{version}/jpeg
  79. mv libpng-%{V_png} ghostscript-%{version}/libpng
  80. mv zlib-%{V_zlib} ghostscript-%{version}/zlib
  81. %build
  82. mtcflags=""
  83. mtldflags=""
  84. case "%{l_platform -t}" in
  85. *-freebsd* ) mtcflags=""; mtldflags="-lc_r" ;;
  86. *-linux* ) mtcflags=""; mtldflags="-lpthread" ;;
  87. *-sunos* ) mtcflags=""; mtldflags="-lpthread" ;;
  88. esac
  89. cd ghostscript-%{version}
  90. %if "%{with_x11}" == "yes"
  91. x11_inc="-I`%{l_prefix}/etc/rc --query x11_incdir`"
  92. x11_lib="-L`%{l_prefix}/etc/rc --query x11_libdir`"
  93. %else
  94. x11_inc=""
  95. x11_lib=""
  96. %endif
  97. %{l_shtool} subst \
  98. -e "s;^STDLIBS=-lpthread -lm;STDLIBS=$mtldflags -lm;" \
  99. -e "s;^prefix = /usr/local;prefix = %{l_prefix};" \
  100. -e "s;CC=gcc;CC=%{l_cc};" \
  101. -e "s;GCFLAGS=.*\\(-fno.*\\)\$;GCFLAGS=\$1;" \
  102. -e "s;XCFLAGS=.*\$;XCFLAGS=$mtcflags;" \
  103. -e "s;XINCLUDE=.*\$;XINCLUDE=$x11_inc;" \
  104. -e "s;XLIBDIRS=.*\$;XLIBDIRS=$x11_lib;" \
  105. src/unix-gcc.mak
  106. %if "%{with_x11}" != "yes"
  107. %{l_shtool} subst \
  108. -e 's;DEVICE_DEVS=.*$;DEVICE_DEVS=;' \
  109. src/unix-gcc.mak
  110. %endif
  111. %{l_make} %{l_mflags} -f src/unix-gcc.mak
  112. %install
  113. rm -rf $RPM_BUILD_ROOT
  114. ( cd ghostscript-%{version}
  115. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  116. %{l_make} %{l_mflags} -f src/unix-gcc.mak install DEVICE_DEVS="" \
  117. prefix=$RPM_BUILD_ROOT%{l_prefix}
  118. ) || exit $?
  119. %{l_shtool} mkdir -f -p -m 755 \
  120. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts
  121. %{l_shtool} install -c fonts/* \
  122. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts/
  123. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/%{V_real}/doc
  124. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/de
  125. for prg in eps2eps gsbj gsdj gslj gsdj500 ps2pdf12 ps2pdf13; do
  126. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  127. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prg.1
  128. done
  129. mv $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf14 \
  130. $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf
  131. for prg in fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh; do
  132. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  133. done
  134. for man in ansi2knr.1; do
  135. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$man
  136. done
  137. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  138. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  139. %files -f files
  140. %clean
  141. rm -rf $RPM_BUILD_ROOT