ghostscript.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. ##
  2. ## ghostscript.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2013 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 9.02
  25. %define V_comp 902
  26. %define V_font_std 8.11
  27. %define V_font_other 6.0
  28. %define V_jpeg 9
  29. %define V_png 1.4.8
  30. %define V_zlib 1.2.8
  31. # package information
  32. Name: ghostscript
  33. Summary: Ghostscript, Postscript and PDF Rendering Engine
  34. URL: http://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: 20130923
  43. # package options
  44. %option with_a4 yes
  45. # list of sources
  46. Source0: http://switch.dl.sourceforge.net/ghostscript/ghostscript-%{V_real}.tar.gz
  47. Source1: http://www.ijg.org/files/jpegsrc.v%{V_jpeg}.tar.gz
  48. Source2: http://switch.dl.sourceforge.net/sourceforge/libpng/libpng-%{V_png}.tar.gz
  49. Source3: http://www.zlib.net/zlib-%{V_zlib}.tar.gz
  50. Source4: http://switch.dl.sourceforge.net/ghostscript/ghostscript-fonts-std-%{V_font_std}.tar.gz
  51. Source5: http://switch.dl.sourceforge.net/ghostscript/ghostscript-fonts-other-%{V_font_other}.tar.gz
  52. Patch0: ghostscript.patch
  53. # build information
  54. BuildPreReq: OpenPKG, openpkg >= 20100101, gcc, make
  55. PreReq: OpenPKG, openpkg >= 20100101
  56. %description
  57. Ghostscript is an interpreter for the PostScript language, with the
  58. ability to convert PostScript language files to many raster formats,
  59. view them on displays, and print them on printers that don't have
  60. PostScript language capability built in. It also works with Portable
  61. Document Format files (PDF), providing the same set of functionality
  62. as with PostScript.
  63. %track
  64. prog ghostscript = {
  65. version = %{version}
  66. url = http://sourceforge.net/projects/ghostscript/files/
  67. regex = ghostscript-(__VER__)\.tar\.gz
  68. }
  69. prog ghostscript:jpegsrc = {
  70. version = v%{V_jpeg}
  71. url = http://www.ijg.org/files/
  72. regex = jpegsrc.(__VER__)\.tar\.gz
  73. }
  74. prog ghostscript:png = {
  75. version = %{V_png}
  76. url = http://sourceforge.net/projects/libpng/files/
  77. regex = libpng-(\d+\.\d+\.\d+)\.tar\.gz
  78. }
  79. prog ghostscript:zlib = {
  80. version = %{V_zlib}
  81. url = http://www.zlib.net/
  82. regex = zlib-(__VER__)\.tar\.gz
  83. }
  84. %prep
  85. %setup -q -c
  86. %setup -q -T -D -a 1
  87. %setup -q -T -D -a 2
  88. %setup -q -T -D -a 3
  89. %setup -q -T -D -a 4
  90. %setup -q -T -D -a 5
  91. mv jpeg-%{V_jpeg} ghostscript-%{version}/jpeg
  92. mv libpng-%{V_png} ghostscript-%{version}/libpng
  93. mv zlib-%{V_zlib} ghostscript-%{version}/zlib
  94. %patch -p0 -d ghostscript-%{version}
  95. %build
  96. mtcflags=""
  97. mtldflags=""
  98. case "%{l_platform -t}" in
  99. *-freebsd* ) mtcflags=""; mtldflags="-lpthread" ;;
  100. *-linux* ) mtcflags=""; mtldflags="-lpthread" ;;
  101. *-sunos* ) mtcflags=""; mtldflags="-lpthread" ;;
  102. esac
  103. cd ghostscript-%{version}
  104. %if "%{with_a4}" == "yes"
  105. mtcflags="$mtcflags -DA4"
  106. %endif
  107. %{l_shtool} subst \
  108. -e "s;^STDLIBS=-lpthread -lm;STDLIBS=$mtldflags -lm;" \
  109. -e "s;^EXTRALIBS=.*$;EXTRALIBS=;" \
  110. -e "s;^prefix = /usr/local;prefix = %{l_prefix};" \
  111. -e "s;CC=gcc;CC=%{l_cc};" \
  112. -e "s;GCFLAGS=.*\\(-fno.*\\)\$;GCFLAGS=\$1;" \
  113. -e "s;XCFLAGS=.*\$;XCFLAGS=$mtcflags;" \
  114. base/unix-gcc.mak
  115. %{l_shtool} subst \
  116. -e 's;DEVICE_DEVS=.*$;DEVICE_DEVS=;' \
  117. base/unix-gcc.mak
  118. %{l_make} %{l_mflags} -f base/unix-gcc.mak
  119. %install
  120. ( cd ghostscript-%{version}
  121. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}
  122. %{l_make} %{l_mflags} -f base/unix-gcc.mak install DEVICE_DEVS="" \
  123. prefix=$RPM_BUILD_ROOT%{l_prefix}
  124. ) || exit $?
  125. %{l_shtool} mkdir -f -p -m 755 \
  126. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts
  127. %{l_shtool} install -c fonts/* \
  128. $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/fonts/
  129. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/%{V_real}/doc
  130. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/ghostscript/%{V_real}/examples
  131. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/de
  132. for prg in eps2eps gsbj gsdj gslj gsdj500 ps2pdf12 ps2pdf13; do
  133. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  134. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$prg.1
  135. done
  136. mv $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf14 \
  137. $RPM_BUILD_ROOT%{l_prefix}/bin/ps2pdf
  138. for prg in fixmswrd.pl lprsetup.sh pj-gs.sh pv.sh sysvlp.sh unix-lpr.sh; do
  139. rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/$prg
  140. done
  141. for man in ansi2knr.1; do
  142. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/$man
  143. done
  144. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  145. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  146. %files -f files
  147. %clean