ghostscript.spec 5.7 KB

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