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

  ViewVC Help
Powered by ViewVC 1.1.30