/[packages]/cauldron/ghostscript/current/SPECS/ghostscript.spec
ViewVC logotype

Annotation of /cauldron/ghostscript/current/SPECS/ghostscript.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 405372 - (hide annotations) (download)
Tue Mar 26 19:48:20 2013 UTC (11 years ago) by tv
File size: 15423 byte(s)
make doc subpackage noarch
1 luigiwalser 289699 %define _disable_ld_no_undefined 1
2 tv 405372 %define rel 10
3 blino 19330
4 luigiwalser 289699 %define gsver 9.06
5 blino 19330 %define ijsver 0.35
6 luigiwalser 289744 %define ijsreloffset 86
7 luigiwalser 289742 %define ijsrelno %(echo $((%{rel} + %{ijsreloffset})))
8     %define ijsrel %mkrel %{ijsrelno}
9 luigiwalser 289699
10 blino 19330 %define ijsmajor 1
11     %define libijs %mklibname ijs %{ijsmajor}
12 luigiwalser 289699 %define libijs_devel %mklibname -d ijs
13    
14 blino 19330 %define gsmajor 9
15     %define libgs %mklibname gs %{gsmajor}
16 luigiwalser 289699 %define libgs_devel %mklibname -d gs
17 blino 19330
18 luigiwalser 289699 %define bootstrap 0
19 blino 19330
20     %define GSx11SVGAmodule 1
21     %define withcupsfilters 1
22     %define debug 0
23     %if %{bootstrap}
24     %global withcupsfilters 0
25     %endif
26    
27     Summary: PostScript/PDF interpreter and renderer (Main executable)
28     Name: ghostscript
29 luigiwalser 289699 Version: %{gsver}
30 luigiwalser 289700 Release: %mkrel %{rel}
31 blino 19330 License: GPLv2+
32     Group: Publishing
33     URL: http://www.ghostscript.com/awki/Index
34 luigiwalser 289699 Source0: http://downloads.ghostscript.com/public/ghostscript-%{gsver}.tar.bz2
35     Source2: ps2pdfpress.bz2
36     Source3: http://www.linuxprinting.org/download/printing/sipixa6.upp.bz2
37 blino 19330
38 luigiwalser 289699 # Fedora patches
39     # Fix ijs-config not to have multilib conflicts (bug #192672)
40     Patch1: ghostscript-multilib.patch
41     # Fix some shell scripts
42     Patch2: ghostscript-scripts.patch
43     # Build igcref.c with -O0 to work around bug #150771.
44     Patch3: ghostscript-noopt.patch
45     # Fix ./autgen.sh in ijs sub-project
46     # See http://bugs.ghostscript.com/show_bug.cgi?id=692040 for details.
47     Patch4: ghostscript-ijs-automake-ver.patch
48     # Define .runlibfileifexists.
49     Patch5: ghostscript-runlibfileifexists.patch
50 blino 292185 # Fixed missing error check when setting ICC profile.
51     Patch6: ghostscript-icc-missing-check.patch
52 luigiwalser 289699 # Install CUPS filter convs files in the correct place.
53     Patch10: ghostscript-cups-filters.patch
54     # Restored Fontmap.local patch, incorrectly dropped after
55     # ghostscript-8.15.4-3 (bug #610301).
56     # Note: don't use -b here to avoid the backup file ending up in the
57     # package manifest.
58     Patch27: ghostscript-Fontmap.local.patch
59     # Don't assume %%rom%% device is available for initial ICC profile dir.
60     Patch28: ghostscript-iccprofiles-initdir.patch
61     # gdevcups: don't use uninitialized variables in debugging output.
62     Patch29: ghostscript-gdevcups-debug-uninit.patch
63 blino 19330
64 blino 294138 Patch100: 0001-Fix-hang-in-gstoraster-if-gs-fails-bug-693336.patch
65    
66 luigiwalser 304018 Patch200: ghostscript-9.06-CVE-2012-4405.diff
67    
68     Patch300: ghostscript-9.05-x11_shared.diff
69 cjw 339808 Patch301: ghostscript-9.06-automake-1.13.patch
70 luigiwalser 304018
71 luigiwalser 289699 %if !%{bootstrap}
72     BuildRequires: gtk+2-devel
73     BuildRequires: cups-devel
74     BuildRequires: fontconfig-devel
75     %endif
76 blino 19330 BuildRequires: bison
77     BuildRequires: flex
78 luigiwalser 289699 BuildRequires: libtool
79     BuildRequires: unzip
80 blino 19330 BuildRequires: gettext-devel
81     BuildRequires: glibc-devel
82     BuildRequires: jbig2dec-devel
83 luigiwalser 289699 BuildRequires: jpeg-devel
84 blino 19330 BuildRequires: libpaper-devel
85 luigiwalser 289699 BuildRequires: netpbm-devel
86     BuildRequires: tiff-devel
87     BuildRequires: pkgconfig(freetype2)
88     BuildRequires: pkgconfig(ice)
89     BuildRequires: pkgconfig(jasper)
90 fwang 398519 BuildRequires: pkgconfig(lcms2)
91 luigiwalser 289699 BuildRequires: pkgconfig(libidn)
92     BuildRequires: pkgconfig(libpng15)
93     BuildRequires: pkgconfig(libxml-2.0)
94     BuildRequires: pkgconfig(sm)
95     BuildRequires: pkgconfig(x11)
96     BuildRequires: pkgconfig(xext)
97     BuildRequires: pkgconfig(xt)
98     BuildRequires: pkgconfig(zlib)
99 blino 19330
100     Requires: ghostscript-common
101     Requires: update-alternatives
102 luigiwalser 289699 %if !%{GSx11SVGAmodule}
103     %rename ghostscript-module-X ghostscript-module-SVGALIB
104 blino 19330 %endif
105    
106     %description
107     Ghostscript is a set of software tools that provide a PostScript(TM)
108     interpreter, a set of C procedures (the Ghostscript library, which
109     implements the graphics capabilities in the PostScript language) and
110     an interpreter for Portable Document Format (PDF) files. Ghostscript
111     translates PostScript code into many common, bitmapped and vector
112     formats, like those understood by your printer or screen. Ghostscript
113     is normally used to display PostScript files and to print PostScript
114     files to non-PostScript printers.
115    
116     You should install ghostscript if you need to display PostScript or
117     PDF files, or if you have a non-PostScript printer.
118    
119 luigiwalser 289699 %package dvipdf
120     Summary: PostScript/PDF interpreter and renderer (DVI-to-PDF converter)
121     Group: Publishing
122     Requires: ghostscript
123     Requires: coreutils
124     Requires: dvips
125     Provides: dvipdf = %{version}-%{release}
126    
127 blino 19330 %description dvipdf
128     Tool to convert the DVI format of TeX into the PDF format. There are
129 boklm 64147 more such tools (for different quality levels) in the dvipdfm
130 blino 19330 package. All these tools use dvips of TeX to convert the DVI file to
131     PostScript, then they use GhostScript to generate the PDF file.
132    
133 luigiwalser 289699 %package common
134     Summary: PostScript/PDF interpreter and renderer (Common files)
135     Group: Publishing
136     Requires: urw-fonts >= 1.1
137     Requires: ghostscript-fonts
138    
139 blino 19330 %description common
140     Ghostscript is a PostScript/PDF interpreter. It can render both
141     PostScript and PDF files to devices which include X window, many
142     printer formats, and popular graphics file formats.
143    
144     This package contains the common data files needed by GhostScript.
145    
146 luigiwalser 289699 %package X
147     Summary: PostScript/PDF interpreter and renderer (with X11 screen display)
148     Group: Publishing
149     Requires: ghostscript-common
150     Requires: update-alternatives
151    
152 blino 19330 %description X
153     Ghostscript is a PostScript/PDF interpreter. It can render both
154     PostScript and PDF files to devices which include X window, many
155     printer formats, and popular graphics file formats.
156    
157     This package contains a GhostScript executable with GTK-based X
158     display support ("display" device, default, so it displays files by
159     simply entering "gs <file>" on the command line). It makes use of the
160     GhostScript shared library.
161    
162 luigiwalser 289699 %if %{GSx11SVGAmodule}
163     %package module-X
164     Summary: PostScript/PDF interpreter and renderer (Additional support for X)
165     Group: Publishing
166     Requires: ghostscript-common
167 blino 19330
168     %description module-X
169     Ghostscript is a PostScript/PDF interpreter. It can render both
170     PostScript and PDF files to devices which include X window, many
171     printer formats, and popular graphics file formats.
172    
173     This package enhances Ghostscript with X window support
174 luigiwalser 289699 %endif
175 blino 19330
176 luigiwalser 289699 %package -n %libgs
177     Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
178     Group: Publishing
179 blino 19330
180     %description -n %libgs
181     This is the API library for programs which use the PostScript and/or
182     PDF interpreters of GhostScript.
183    
184 luigiwalser 289699 %package -n %libgs_devel
185     Summary: Headers and links to compile against the "%{libgs}" library
186     Group: Development/C
187     Requires: %libgs >= %{gsver}
188     Provides: %{name}-devel = %{gsver}
189     Provides: libgs-devel = %{gsver}
190     Obsoletes: %{_lib}gs9-devel < %{gsver}
191     Obsoletes: %{_lib}gs8-devel < %{gsver}
192    
193     %description -n %libgs_devel
194 blino 19330 This package contains the static library and the header files needed
195     to compile applications using the GhostScript shared library.
196    
197 luigiwalser 289699 %package -n %{libijs}
198     Version: %{ijsver}
199     Release: %{ijsrel}
200     Summary: Dynamic library for the IJS printer driver plug-in interface
201     Group: Publishing
202     URL: http://www.linuxprinting.org/ijs/
203     Provides: libijs = %{ijsver}-%{ijsrel}
204    
205 blino 19330 %description -n %{libijs}
206     This is the API library for programs using the IJS printer driver
207     plug-in interface. Printer drivers using this interface can be added
208     to GhostScript (6.53 or newer) without needing to rebuild
209     GhostScript. Application programs providing an IJS interface can make
210     use of IJS printer drivers directly, without needing GhostScript.
211    
212 luigiwalser 289699 %package -n %{libijs_devel}
213     Version: %{ijsver}
214     Release: %{ijsrel}
215     Summary: Headers and links for compiling against the "%{libijs}" library
216     Group: Development/C
217     URL: http://www.linuxprinting.org/ijs/
218     Requires: %{libijs} >= %{ijsver}
219     Requires: multiarch-utils
220     Provides: libijs-devel = %{ijsver}-%{ijsrel}
221     Provides: ijs-devel = %{ijsver}-%{ijsrel}
222     Obsoletes: %{_lib}ijs1-devel < %{ijsver}-%{ijsrel}
223    
224 blino 19330 %description -n %{libijs_devel}
225     This package contains the static library and the header files needed
226     to compile applications using the IJS library.
227    
228 luigiwalser 289699 %package doc
229     Summary: Documentation for GhostScript
230     Group: Publishing
231 tv 405372 BuildArch: noarch
232 luigiwalser 289699
233 blino 19330 %description doc
234     This package contains documentation for GhostScript.
235    
236     %prep
237     %setup -q
238 luigiwalser 289699 %apply_patches
239     # Don't ship backup files
240     find . -name "*.*~" |xargs rm -f
241 blino 19330
242     # prevent building and using bundled libs
243 fwang 398527 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms* freetype
244 blino 19330
245     # Convert manual pages to UTF-8
246     from8859_1() {
247 luigiwalser 289699 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
248     mv "${1}_" "$1"
249 blino 19330 }
250     for i in man/de/*.1; do from8859_1 "$i"; done
251    
252     # Stuff for shared library support to ghostscript.
253     %if %{GSx11SVGAmodule}
254     # build a small README describing the features available.
255 blino 19364 cat <<EOF >README.shared.%{_vendor}
256 blino 19330 This version of ghostscript support shared modules dynamically loaded
257     at run time.
258    
259 blino 19365 There are currently two modules compiled with the %{distribution} version of
260 blino 19330 ghostscript, one to support all X11 devices (typically used by gv) and
261     another to support the svgalib devices. Look at the
262     ghostscript-module-??? packages.
263    
264     There is no configuration needed, just can add (or remove) the package
265     to add (or remove) the devices concerned in ghostscript.
266     EOF
267     %endif
268    
269     # ps2pdfpress
270     bzcat %{SOURCE2} > ps2pdfpress
271    
272     # UPP file for SiPix Pocket Printer A6
273     bzcat %{SOURCE3} > sipixa6.upp
274    
275     %build
276    
277     # Change compiler flags for debugging when in debug mode
278     %if %debug
279     export DONT_STRIP=1
280     export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
281     export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
282     export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
283     %endif
284    
285 luigiwalser 289699 pushd ijs*
286 blino 19330 # Rebuild broken build infrastructure
287     # Needed by patch4.
288     ./autogen.sh
289 lmenut 87327 %configure2_5x \
290     %ifarch %{ix86}
291     --disable-sse2 \
292     %endif
293 luigiwalser 289699 --enable-shared \
294     --disable-static
295    
296 blino 19330 %make
297 luigiwalser 289699 popd
298 blino 19330
299     # We have a Subversion version, so we must re-generate "configure"
300     ./autogen.sh
301    
302     %configure2_5x \
303     --enable-dynamic \
304     %if !%{bootstrap}
305 luigiwalser 289699 --enable-fontconfig \
306 blino 19330 %endif
307 lmenut 87327 %ifarch %{ix86}
308 luigiwalser 289699 --disable-sse2 \
309 lmenut 87327 %endif
310 luigiwalser 289699 --with-drivers=ALL,opvp \
311     --with-fontpath="/usr/share/fonts/default/ghostscript:/usr/share/fonts/default/type1:/usr/share/ghostscript/fonts:/usr/share/ghostscript/%{gsver}/Resource:/usr/share/ghostscript/Resource:/usr/share/ghostscript/CIDFont:/usr/share/fonts/ttf:/usr/share/fonts/type1:/usr/share/fonts/default/Type1" \
312     --with-ijs \
313     --with-omni \
314     --with-x \
315     --disable-compile-inits \
316     --with-system-libtiff \
317     --with-install-cups
318 blino 19330
319 luigiwalser 289699 # Drivers which do not compile:
320 blino 19330 # Needs newsiop/lbp.h: nwp533
321     # Needs sys/ioccom.h: sparc
322     # Needs unbdev/lpviio.h: sparc
323    
324     # Set documentation dir
325 luigiwalser 289699 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
326 blino 19330
327     # Fix references to X11 libraries
328     perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
329    
330     # Correct paths for CJK fonts
331     perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
332     perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
333    
334     # Do not use "-ansi" in gcc calls
335     perl -p -i -e "s:-ansi::g" Makefile
336    
337 luigiwalser 289699 # bork
338     perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
339    
340 blino 19330 # The RPM macro for make is not used here, as parallelization of the build
341     # process does not work.
342 luigiwalser 289699 %if %{GSx11SVGAmodule}
343     #make soobj/X11.so BUILDPREFIX=so
344 fwang 150967 make obj/X11.so
345 blino 19330 %endif
346     make so
347     #make pcl3opts
348 luigiwalser 289699 make cups
349 blino 19330
350     %install
351     rm -rf %{buildroot}
352    
353     # Change compiler flags for debugging when in debug mode
354     %if %debug
355     export DONT_STRIP=1
356     export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
357     export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
358     export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
359     %endif
360    
361     # Make directories
362     install -d %{buildroot}%{_bindir}
363     install -d %{buildroot}%{_libdir}
364     install -d %{buildroot}%{_includedir}
365     install -d %{buildroot}%{_sysconfdir}
366     install -d %{buildroot}%{_mandir}/man1
367     %if !%{bootstrap}
368     install -d %{buildroot}%{_prefix}/lib/cups
369     install -d %{buildroot}%{_datadir}/cups/model
370     install -d %{buildroot}%{_sysconfdir}/cups
371     %endif
372    
373 luigiwalser 289699 pushd ijs*
374     %configure2_5x \
375     --enable-shared \
376     --prefix=%{buildroot}%{_prefix} \
377     --libdir=%{buildroot}%{_libdir}
378    
379 blino 19330 # Work around bug in "configure" script
380     perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
381     perl -p -i -e 's/\@EXEEXT\@//g' Makefile
382     %makeinstall
383     # Fix prefixes in scripts
384 luigiwalser 289699 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
385     perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
386     popd
387 blino 19330
388     ##### GHOSTSCRIPT
389 luigiwalser 289699 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
390 blino 19330
391     %if !%{bootstrap}
392     make \
393     prefix=%{_prefix} \
394     DESTDIR=%{buildroot} \
395 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
396     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
397 blino 19330 bindir=%{_bindir} \
398     mandir=%{_mandir} \
399     install-cups
400     %endif
401    
402     make \
403     prefix=%{_prefix} \
404     DESTDIR=%{buildroot} \
405 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
406     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
407 blino 19330 bindir=%{_bindir} \
408 luigiwalser 289699 libdir=%{_libdir} \
409 blino 19330 mandir=%{_mandir} \
410 luigiwalser 289699 soinstall
411 blino 19330
412 luigiwalser 289699 %if %{GSx11SVGAmodule}
413 blino 19330 make \
414     prefix=%{_prefix} \
415     DESTDIR=%{buildroot} \
416 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
417     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
418 blino 19330 bindir=%{_bindir} \
419 luigiwalser 289699 libdir=%{_libdir} \
420 blino 19330 mandir=%{_mandir} \
421 luigiwalser 289699 install-shared
422 blino 19330 %endif
423    
424 luigiwalser 289699 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
425 blino 19330
426     # ps2pdfpress
427     install -m 755 ps2pdfpress %{buildroot}%{_bindir}
428    
429     # UPP file for SiPix Pocket Printer A6
430 luigiwalser 289699 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
431     install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
432 blino 19330
433 luigiwalser 289699 # why?
434     mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
435 blino 19330
436     # Correct permissions for all documentation files
437     chmod -R a+rX %{buildroot}%{_docdir}
438     chmod -R go-w %{buildroot}%{_docdir}
439     chmod -R u+w %{buildroot}%{_docdir}
440    
441 luigiwalser 289699 # remove libtool archive
442     rm -f %{buildroot}%{_libdir}/libijs.la
443 blino 19330
444 luigiwalser 289699 %post
445     # Set up update-alternatives entries
446     %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
447    
448     %post X
449     # Set up update-alternatives entries
450     %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
451    
452     %post common
453     # Initialize japanese fonts
454     if test -f /usr/share/fonts/ttf/japanese/cidinst; then
455     sh /usr/share/fonts/ttf/japanese/cidinst
456     fi
457    
458     %preun
459     if [ "$1" = 0 ]; then
460     # Remove update-alternatives entry
461     %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
462     fi
463    
464     %preun X
465     if [ "$1" = 0 ]; then
466     # Remove update-alternatives entry
467     %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
468     fi
469    
470 blino 19330 %files
471     %{_bindir}/gsc
472    
473     %files X
474     %{_bindir}/gsx
475    
476     %files common
477     %dir %{_datadir}/ghostscript
478 luigiwalser 289699 %{_datadir}/ghostscript/%{gsver}
479 blino 19330 %{_mandir}/man1/*
480     %lang(de) %{_mandir}/de/man1/*
481 fwang 143159 #%{_bindir}/[a-c]*
482 blino 19330 %{_bindir}/[e-f]*
483     #{_bindir}/gs-common
484     %{_bindir}/gs[a-b]*
485     %{_bindir}/gs[d-n]*
486     %{_bindir}/[j-l]*
487     %{_bindir}/[n-z]*
488     %if %{withcupsfilters}
489     # "pstoraster" wrapper script to make GhostScript being used as the
490     # cups-internal RIP
491     %attr(0755,root,root) %{_prefix}/lib*/cups/filter/*
492     %{_datadir}/cups/model/*
493 lmenut 87327 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
494 blino 19330 %endif
495    
496     %files doc
497 luigiwalser 289699 %doc %{_docdir}/ghostscript-doc-%{gsver}
498 blino 19330
499     %files dvipdf
500     %{_bindir}/dvipdf
501    
502     %if %{GSx11SVGAmodule}
503     %files module-X
504 blino 19364 %doc README.shared.%{_vendor}
505 luigiwalser 289699 %dir %{_libdir}/ghostscript/%{gsver}
506     %{_libdir}/ghostscript/%{gsver}/X11.so
507 blino 19330 %endif
508    
509     %files -n %{libgs}
510     %{_libdir}/libgs.so.*%{gsmajor}*
511    
512     %files -n %{libgs_devel}
513     %{_libdir}/libgs.so
514     %{_includedir}/ghostscript
515    
516     %files -n %{libijs}
517 fwang 150967 %{_libdir}/libijs-%{ijsver}.so
518 blino 19330
519     %files -n %{libijs_devel}
520     %doc ijs/README
521     %{_libdir}/libijs.so
522     %{_libdir}/pkgconfig/ijs.pc
523     %{_includedir}/ijs
524     %{_bindir}/ijs_client_example
525     %{_bindir}/ijs_server_example
526     %{_bindir}/ijs-config

  ViewVC Help
Powered by ViewVC 1.1.30