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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30