/[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 405372 - (show annotations) (download)
Tue Mar 26 19:48:20 2013 UTC (7 years ago) by tv
File size: 15423 byte(s)
make doc subpackage noarch
1 %define _disable_ld_no_undefined 1
2 %define rel 10
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 Patch301: ghostscript-9.06-automake-1.13.patch
70
71 %if !%{bootstrap}
72 BuildRequires: gtk+2-devel
73 BuildRequires: cups-devel
74 BuildRequires: fontconfig-devel
75 %endif
76 BuildRequires: bison
77 BuildRequires: flex
78 BuildRequires: libtool
79 BuildRequires: unzip
80 BuildRequires: gettext-devel
81 BuildRequires: glibc-devel
82 BuildRequires: jbig2dec-devel
83 BuildRequires: jpeg-devel
84 BuildRequires: libpaper-devel
85 BuildRequires: netpbm-devel
86 BuildRequires: tiff-devel
87 BuildRequires: pkgconfig(freetype2)
88 BuildRequires: pkgconfig(ice)
89 BuildRequires: pkgconfig(jasper)
90 BuildRequires: pkgconfig(lcms2)
91 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
100 Requires: ghostscript-common
101 Requires: update-alternatives
102 %if !%{GSx11SVGAmodule}
103 %rename ghostscript-module-X ghostscript-module-SVGALIB
104 %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 %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 %description dvipdf
128 Tool to convert the DVI format of TeX into the PDF format. There are
129 more such tools (for different quality levels) in the dvipdfm
130 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 %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 %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 %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 %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 %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
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 %endif
175
176 %package -n %libgs
177 Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
178 Group: Publishing
179
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 %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 This package contains the static library and the header files needed
195 to compile applications using the GhostScript shared library.
196
197 %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 %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 %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 %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 %package doc
229 Summary: Documentation for GhostScript
230 Group: Publishing
231 BuildArch: noarch
232
233 %description doc
234 This package contains documentation for GhostScript.
235
236 %prep
237 %setup -q
238 %apply_patches
239 # Don't ship backup files
240 find . -name "*.*~" |xargs rm -f
241
242 # prevent building and using bundled libs
243 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms* freetype
244
245 # Convert manual pages to UTF-8
246 from8859_1() {
247 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
248 mv "${1}_" "$1"
249 }
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 cat <<EOF >README.shared.%{_vendor}
256 This version of ghostscript support shared modules dynamically loaded
257 at run time.
258
259 There are currently two modules compiled with the %{distribution} version of
260 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 pushd ijs*
286 # Rebuild broken build infrastructure
287 # Needed by patch4.
288 ./autogen.sh
289 %configure2_5x \
290 %ifarch %{ix86}
291 --disable-sse2 \
292 %endif
293 --enable-shared \
294 --disable-static
295
296 %make
297 popd
298
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 --enable-fontconfig \
306 %endif
307 %ifarch %{ix86}
308 --disable-sse2 \
309 %endif
310 --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
319 # Drivers which do not compile:
320 # Needs newsiop/lbp.h: nwp533
321 # Needs sys/ioccom.h: sparc
322 # Needs unbdev/lpviio.h: sparc
323
324 # Set documentation dir
325 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
326
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 # bork
338 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
339
340 # The RPM macro for make is not used here, as parallelization of the build
341 # process does not work.
342 %if %{GSx11SVGAmodule}
343 #make soobj/X11.so BUILDPREFIX=so
344 make obj/X11.so
345 %endif
346 make so
347 #make pcl3opts
348 make cups
349
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 pushd ijs*
374 %configure2_5x \
375 --enable-shared \
376 --prefix=%{buildroot}%{_prefix} \
377 --libdir=%{buildroot}%{_libdir}
378
379 # 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 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
388 ##### GHOSTSCRIPT
389 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
390
391 %if !%{bootstrap}
392 make \
393 prefix=%{_prefix} \
394 DESTDIR=%{buildroot} \
395 gssharedir=%{_libdir}/ghostscript/%{gsver} \
396 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
397 bindir=%{_bindir} \
398 mandir=%{_mandir} \
399 install-cups
400 %endif
401
402 make \
403 prefix=%{_prefix} \
404 DESTDIR=%{buildroot} \
405 gssharedir=%{_libdir}/ghostscript/%{gsver} \
406 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
407 bindir=%{_bindir} \
408 libdir=%{_libdir} \
409 mandir=%{_mandir} \
410 soinstall
411
412 %if %{GSx11SVGAmodule}
413 make \
414 prefix=%{_prefix} \
415 DESTDIR=%{buildroot} \
416 gssharedir=%{_libdir}/ghostscript/%{gsver} \
417 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
418 bindir=%{_bindir} \
419 libdir=%{_libdir} \
420 mandir=%{_mandir} \
421 install-shared
422 %endif
423
424 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
425
426 # ps2pdfpress
427 install -m 755 ps2pdfpress %{buildroot}%{_bindir}
428
429 # UPP file for SiPix Pocket Printer A6
430 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
431 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
432
433 # why?
434 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
435
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 # remove libtool archive
442 rm -f %{buildroot}%{_libdir}/libijs.la
443
444 %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 %files
471 %{_bindir}/gsc
472
473 %files X
474 %{_bindir}/gsx
475
476 %files common
477 %dir %{_datadir}/ghostscript
478 %{_datadir}/ghostscript/%{gsver}
479 %{_mandir}/man1/*
480 %lang(de) %{_mandir}/de/man1/*
481 #%{_bindir}/[a-c]*
482 %{_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 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
494 %endif
495
496 %files doc
497 %doc %{_docdir}/ghostscript-doc-%{gsver}
498
499 %files dvipdf
500 %{_bindir}/dvipdf
501
502 %if %{GSx11SVGAmodule}
503 %files module-X
504 %doc README.shared.%{_vendor}
505 %dir %{_libdir}/ghostscript/%{gsver}
506 %{_libdir}/ghostscript/%{gsver}/X11.so
507 %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 %{_libdir}/libijs-%{ijsver}.so
518
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.26