/[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 389214 - (show annotations) (download)
Thu Jan 17 21:30:27 2013 UTC (11 years, 2 months ago) by pterjan
File size: 15402 byte(s)
oops
1 %define _disable_ld_no_undefined 1
2 %define rel 7
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(lcms)
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
232 %description doc
233 This package contains documentation for GhostScript.
234
235 %prep
236 %setup -q
237 %apply_patches
238 # Don't ship backup files
239 find . -name "*.*~" |xargs rm -f
240
241 # prevent building and using bundled libs
242 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms freetype
243
244 # Convert manual pages to UTF-8
245 from8859_1() {
246 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
247 mv "${1}_" "$1"
248 }
249 for i in man/de/*.1; do from8859_1 "$i"; done
250
251 # Stuff for shared library support to ghostscript.
252 %if %{GSx11SVGAmodule}
253 # build a small README describing the features available.
254 cat <<EOF >README.shared.%{_vendor}
255 This version of ghostscript support shared modules dynamically loaded
256 at run time.
257
258 There are currently two modules compiled with the %{distribution} version of
259 ghostscript, one to support all X11 devices (typically used by gv) and
260 another to support the svgalib devices. Look at the
261 ghostscript-module-??? packages.
262
263 There is no configuration needed, just can add (or remove) the package
264 to add (or remove) the devices concerned in ghostscript.
265 EOF
266 %endif
267
268 # ps2pdfpress
269 bzcat %{SOURCE2} > ps2pdfpress
270
271 # UPP file for SiPix Pocket Printer A6
272 bzcat %{SOURCE3} > sipixa6.upp
273
274 %build
275
276 # Change compiler flags for debugging when in debug mode
277 %if %debug
278 export DONT_STRIP=1
279 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
280 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
281 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
282 %endif
283
284 pushd ijs*
285 # Rebuild broken build infrastructure
286 # Needed by patch4.
287 ./autogen.sh
288 %configure2_5x \
289 %ifarch %{ix86}
290 --disable-sse2 \
291 %endif
292 --enable-shared \
293 --disable-static
294
295 %make
296 popd
297
298 # We have a Subversion version, so we must re-generate "configure"
299 ./autogen.sh
300
301 %configure2_5x \
302 --enable-dynamic \
303 %if !%{bootstrap}
304 --enable-fontconfig \
305 %endif
306 %ifarch %{ix86}
307 --disable-sse2 \
308 %endif
309 --with-drivers=ALL,opvp \
310 --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" \
311 --with-ijs \
312 --with-omni \
313 --with-x \
314 --disable-compile-inits \
315 --with-system-libtiff \
316 --with-install-cups
317
318 # Drivers which do not compile:
319 # Needs newsiop/lbp.h: nwp533
320 # Needs sys/ioccom.h: sparc
321 # Needs unbdev/lpviio.h: sparc
322
323 # Set documentation dir
324 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
325
326 # Fix references to X11 libraries
327 perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
328
329 # Correct paths for CJK fonts
330 perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
331 perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
332
333 # Do not use "-ansi" in gcc calls
334 perl -p -i -e "s:-ansi::g" Makefile
335
336 # bork
337 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
338
339 # The RPM macro for make is not used here, as parallelization of the build
340 # process does not work.
341 %if %{GSx11SVGAmodule}
342 #make soobj/X11.so BUILDPREFIX=so
343 make obj/X11.so
344 %endif
345 make so
346 #make pcl3opts
347 make cups
348
349 %install
350 rm -rf %{buildroot}
351
352 # Change compiler flags for debugging when in debug mode
353 %if %debug
354 export DONT_STRIP=1
355 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
356 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
357 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
358 %endif
359
360 # Make directories
361 install -d %{buildroot}%{_bindir}
362 install -d %{buildroot}%{_libdir}
363 install -d %{buildroot}%{_includedir}
364 install -d %{buildroot}%{_sysconfdir}
365 install -d %{buildroot}%{_mandir}/man1
366 %if !%{bootstrap}
367 install -d %{buildroot}%{_prefix}/lib/cups
368 install -d %{buildroot}%{_datadir}/cups/model
369 install -d %{buildroot}%{_sysconfdir}/cups
370 %endif
371
372 pushd ijs*
373 %configure2_5x \
374 --enable-shared \
375 --prefix=%{buildroot}%{_prefix} \
376 --libdir=%{buildroot}%{_libdir}
377
378 # Work around bug in "configure" script
379 perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
380 perl -p -i -e 's/\@EXEEXT\@//g' Makefile
381 %makeinstall
382 # Fix prefixes in scripts
383 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
384 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
385 popd
386
387 ##### GHOSTSCRIPT
388 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
389
390 %if !%{bootstrap}
391 make \
392 prefix=%{_prefix} \
393 DESTDIR=%{buildroot} \
394 gssharedir=%{_libdir}/ghostscript/%{gsver} \
395 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
396 bindir=%{_bindir} \
397 mandir=%{_mandir} \
398 install-cups
399 %endif
400
401 make \
402 prefix=%{_prefix} \
403 DESTDIR=%{buildroot} \
404 gssharedir=%{_libdir}/ghostscript/%{gsver} \
405 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
406 bindir=%{_bindir} \
407 libdir=%{_libdir} \
408 mandir=%{_mandir} \
409 soinstall
410
411 %if %{GSx11SVGAmodule}
412 make \
413 prefix=%{_prefix} \
414 DESTDIR=%{buildroot} \
415 gssharedir=%{_libdir}/ghostscript/%{gsver} \
416 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
417 bindir=%{_bindir} \
418 libdir=%{_libdir} \
419 mandir=%{_mandir} \
420 install-shared
421 %endif
422
423 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
424
425 # ps2pdfpress
426 install -m 755 ps2pdfpress %{buildroot}%{_bindir}
427
428 # UPP file for SiPix Pocket Printer A6
429 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
430 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
431
432 # why?
433 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
434
435 # Correct permissions for all documentation files
436 chmod -R a+rX %{buildroot}%{_docdir}
437 chmod -R go-w %{buildroot}%{_docdir}
438 chmod -R u+w %{buildroot}%{_docdir}
439
440 # remove libtool archive
441 rm -f %{buildroot}%{_libdir}/libijs.la
442
443 %post
444 # Set up update-alternatives entries
445 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
446
447 %post X
448 # Set up update-alternatives entries
449 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
450
451 %post common
452 # Initialize japanese fonts
453 if test -f /usr/share/fonts/ttf/japanese/cidinst; then
454 sh /usr/share/fonts/ttf/japanese/cidinst
455 fi
456
457 %preun
458 if [ "$1" = 0 ]; then
459 # Remove update-alternatives entry
460 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
461 fi
462
463 %preun X
464 if [ "$1" = 0 ]; then
465 # Remove update-alternatives entry
466 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
467 fi
468
469 %files
470 %{_bindir}/gsc
471
472 %files X
473 %{_bindir}/gsx
474
475 %files common
476 %dir %{_datadir}/ghostscript
477 %{_datadir}/ghostscript/%{gsver}
478 %{_mandir}/man1/*
479 %lang(de) %{_mandir}/de/man1/*
480 #%{_bindir}/[a-c]*
481 %{_bindir}/[e-f]*
482 #{_bindir}/gs-common
483 %{_bindir}/gs[a-b]*
484 %{_bindir}/gs[d-n]*
485 %{_bindir}/[j-l]*
486 %{_bindir}/[n-z]*
487 %if %{withcupsfilters}
488 # "pstoraster" wrapper script to make GhostScript being used as the
489 # cups-internal RIP
490 %attr(0755,root,root) %{_prefix}/lib*/cups/filter/*
491 %{_datadir}/cups/model/*
492 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
493 %endif
494
495 %files doc
496 %doc %{_docdir}/ghostscript-doc-%{gsver}
497
498 %files dvipdf
499 %{_bindir}/dvipdf
500
501 %if %{GSx11SVGAmodule}
502 %files module-X
503 %doc README.shared.%{_vendor}
504 %dir %{_libdir}/ghostscript/%{gsver}
505 %{_libdir}/ghostscript/%{gsver}/X11.so
506 %endif
507
508 %files -n %{libgs}
509 %{_libdir}/libgs.so.*%{gsmajor}*
510
511 %files -n %{libgs_devel}
512 %{_libdir}/libgs.so
513 %{_includedir}/ghostscript
514
515 %files -n %{libijs}
516 %{_libdir}/libijs-%{ijsver}.so
517
518 %files -n %{libijs_devel}
519 %doc ijs/README
520 %{_libdir}/libijs.so
521 %{_libdir}/pkgconfig/ijs.pc
522 %{_includedir}/ijs
523 %{_bindir}/ijs_client_example
524 %{_bindir}/ijs_server_example
525 %{_bindir}/ijs-config

  ViewVC Help
Powered by ViewVC 1.1.30