/[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 294138 - (show annotations) (download)
Sat Sep 15 14:43:28 2012 UTC (11 years, 6 months ago) by blino
File size: 15308 byte(s)
Fix hang in gstoraster if gs fails (reported as upstream bug #693336)
1 %define _disable_ld_no_undefined 1
2 %define rel 4
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 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 # Fixed missing error check when setting ICC profile.
52 Patch6: ghostscript-icc-missing-check.patch
53 # 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
65 Patch100: 0001-Fix-hang-in-gstoraster-if-gs-fails-bug-693336.patch
66
67 %if !%{bootstrap}
68 BuildRequires: gtk+2-devel
69 BuildRequires: cups-devel
70 BuildRequires: fontconfig-devel
71 %endif
72 BuildRequires: bison
73 BuildRequires: flex
74 BuildRequires: libtool
75 BuildRequires: unzip
76 BuildRequires: gettext-devel
77 BuildRequires: glibc-devel
78 BuildRequires: jbig2dec-devel
79 BuildRequires: jpeg-devel
80 BuildRequires: libpaper-devel
81 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
96 Requires: ghostscript-common
97 Requires: update-alternatives
98 %if !%{GSx11SVGAmodule}
99 %rename ghostscript-module-X ghostscript-module-SVGALIB
100 %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 %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 %description dvipdf
124 Tool to convert the DVI format of TeX into the PDF format. There are
125 more such tools (for different quality levels) in the dvipdfm
126 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 %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 %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 %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 %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 %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
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 %endif
171
172 %package -n %libgs
173 Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
174 Group: Publishing
175
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 %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 This package contains the static library and the header files needed
191 to compile applications using the GhostScript shared library.
192
193 %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 %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 %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 %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 %package doc
225 Summary: Documentation for GhostScript
226 Group: Publishing
227
228 %description doc
229 This package contains documentation for GhostScript.
230
231 %prep
232 %setup -q
233 %apply_patches
234 # Don't ship backup files
235 find . -name "*.*~" |xargs rm -f
236
237 # prevent building and using bundled libs
238 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms freetype
239
240 # Convert manual pages to UTF-8
241 from8859_1() {
242 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
243 mv "${1}_" "$1"
244 }
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 cat <<EOF >README.shared.%{_vendor}
251 This version of ghostscript support shared modules dynamically loaded
252 at run time.
253
254 There are currently two modules compiled with the %{distribution} version of
255 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 pushd ijs*
281 # Rebuild broken build infrastructure
282 # Needed by patch4.
283 ./autogen.sh
284 %configure2_5x \
285 %ifarch %{ix86}
286 --disable-sse2 \
287 %endif
288 --enable-shared \
289 --disable-static
290
291 %make
292 popd
293
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 --enable-fontconfig \
301 %endif
302 %ifarch %{ix86}
303 --disable-sse2 \
304 %endif
305 --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
314 # Drivers which do not compile:
315 # Needs newsiop/lbp.h: nwp533
316 # Needs sys/ioccom.h: sparc
317 # Needs unbdev/lpviio.h: sparc
318
319 # Set documentation dir
320 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
321
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 # bork
333 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
334
335 # The RPM macro for make is not used here, as parallelization of the build
336 # process does not work.
337 %if %{GSx11SVGAmodule}
338 #make soobj/X11.so BUILDPREFIX=so
339 make obj/X11.so
340 %endif
341 make so
342 #make pcl3opts
343 make cups
344
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 pushd ijs*
369 %configure2_5x \
370 --enable-shared \
371 --prefix=%{buildroot}%{_prefix} \
372 --libdir=%{buildroot}%{_libdir}
373
374 # 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 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
383 ##### GHOSTSCRIPT
384 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
385
386 %if !%{bootstrap}
387 make \
388 prefix=%{_prefix} \
389 DESTDIR=%{buildroot} \
390 gssharedir=%{_libdir}/ghostscript/%{gsver} \
391 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
392 bindir=%{_bindir} \
393 mandir=%{_mandir} \
394 install-cups
395 %endif
396
397 make \
398 prefix=%{_prefix} \
399 DESTDIR=%{buildroot} \
400 gssharedir=%{_libdir}/ghostscript/%{gsver} \
401 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
402 bindir=%{_bindir} \
403 libdir=%{_libdir} \
404 mandir=%{_mandir} \
405 soinstall
406
407 %if %{GSx11SVGAmodule}
408 make \
409 prefix=%{_prefix} \
410 DESTDIR=%{buildroot} \
411 gssharedir=%{_libdir}/ghostscript/%{gsver} \
412 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
413 bindir=%{_bindir} \
414 libdir=%{_libdir} \
415 mandir=%{_mandir} \
416 install-shared
417 %endif
418
419 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
420
421 # ps2pdfpress
422 install -m 755 ps2pdfpress %{buildroot}%{_bindir}
423
424 # UPP file for SiPix Pocket Printer A6
425 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
426 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
427
428 # why?
429 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
430
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 # remove libtool archive
437 rm -f %{buildroot}%{_libdir}/libijs.la
438
439 %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 %files
466 %{_bindir}/gsc
467
468 %files X
469 %{_bindir}/gsx
470
471 %files common
472 %dir %{_datadir}/ghostscript
473 %{_datadir}/ghostscript/%{gsver}
474 %{_mandir}/man1/*
475 %lang(de) %{_mandir}/de/man1/*
476 #%{_bindir}/[a-c]*
477 %{_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 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
489 %endif
490
491 %files doc
492 %doc %{_docdir}/ghostscript-doc-%{gsver}
493
494 %files dvipdf
495 %{_bindir}/dvipdf
496
497 %if %{GSx11SVGAmodule}
498 %files module-X
499 %doc README.shared.%{_vendor}
500 %dir %{_libdir}/ghostscript/%{gsver}
501 %{_libdir}/ghostscript/%{gsver}/X11.so
502 %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 %{_libdir}/libijs-%{ijsver}.so
513
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