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

  ViewVC Help
Powered by ViewVC 1.1.30