/[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 444126 - (show annotations) (download)
Mon Jun 17 16:17:15 2013 UTC (10 years, 10 months ago) by blino
File size: 15331 byte(s)
sync patches with Fedora:
- locale fix (rh #961149)
- fix pdfwrite segfault (rh #962120)

1 %define _disable_ld_no_undefined 1
2 %define rel 11
3
4 %define gsver 9.07
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: AGPLv3+
32 Group: Publishing
33 URL: http://www.ghostscript.com/awki/Index
34 Source0: http://downloads.ghostscript.com/public/ghostscript-%{gsver}.tar.gz
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 # Define .runlibfileifexists.
46 Patch4: ghostscript-runlibfileifexists.patch
47 # Fixed missing error check when setting ICC profile.
48 Patch5: ghostscript-icc-missing-check.patch
49 # Install CUPS filter convs files in the correct place.
50 Patch6: 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 Patch7: ghostscript-Fontmap.local.patch
56 # Don't assume %%rom%% device is available for initial ICC profile dir.
57 Patch8: ghostscript-iccprofiles-initdir.patch
58 # gdevcups: don't use uninitialized variables in debugging output.
59 Patch9: ghostscript-gdevcups-debug-uninit.patch
60 # Back-ported locale fix (bug #961149).
61 Patch10: ghostscript-gs_sprintf.patch
62 # Upstream patch to fix pdfwrite segfault (bug #962120).
63 Patch11: ghostscript-pdfwrite-segfault.patch
64
65 Patch100: 0001-Fix-hang-in-gstoraster-if-gs-fails-bug-693336.patch
66
67 Patch300: ghostscript-9.05-x11_shared.diff
68 Patch301: ghostscript-9.06-automake-1.13.patch
69
70 %if !%{bootstrap}
71 BuildRequires: gtk+3-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(lcms2) >= 2.5
90 BuildRequires: pkgconfig(libidn)
91 BuildRequires: pkgconfig(libpng)
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 BuildArch: noarch
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 ./autogen.sh
286 %configure2_5x \
287 %ifarch %{ix86}
288 --disable-sse2 \
289 %endif
290 --enable-shared \
291 --disable-static
292
293 %make
294 popd
295
296 # We have a Subversion version, so we must re-generate "configure"
297 ./autogen.sh
298
299 %configure2_5x \
300 --enable-dynamic \
301 %if !%{bootstrap}
302 --enable-fontconfig \
303 %endif
304 %ifarch %{ix86}
305 --disable-sse2 \
306 %endif
307 --with-drivers=ALL,opvp \
308 --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" \
309 --with-ijs \
310 --with-x \
311 --disable-compile-inits \
312 --with-system-libtiff \
313 --with-install-cups
314
315 # Drivers which do not compile:
316 # Needs newsiop/lbp.h: nwp533
317 # Needs sys/ioccom.h: sparc
318 # Needs unbdev/lpviio.h: sparc
319
320 # Set documentation dir
321 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
322
323 # Fix references to X11 libraries
324 perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
325
326 # Correct paths for CJK fonts
327 perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
328 perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
329
330 # Do not use "-ansi" in gcc calls
331 perl -p -i -e "s:-ansi::g" Makefile
332
333 # bork
334 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
335
336 # The RPM macro for make is not used here, as parallelization of the build
337 # process does not work.
338 %if %{GSx11SVGAmodule}
339 #make soobj/X11.so BUILDPREFIX=so
340 make obj/X11.so
341 %endif
342 make so
343 #make pcl3opts
344 make cups
345
346 %install
347 rm -rf %{buildroot}
348
349 # Change compiler flags for debugging when in debug mode
350 %if %debug
351 export DONT_STRIP=1
352 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
353 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
354 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
355 %endif
356
357 # Make directories
358 install -d %{buildroot}%{_bindir}
359 install -d %{buildroot}%{_libdir}
360 install -d %{buildroot}%{_includedir}
361 install -d %{buildroot}%{_sysconfdir}
362 install -d %{buildroot}%{_mandir}/man1
363 %if !%{bootstrap}
364 install -d %{buildroot}%{_prefix}/lib/cups
365 install -d %{buildroot}%{_datadir}/cups/model
366 install -d %{buildroot}%{_sysconfdir}/cups
367 %endif
368
369 pushd ijs*
370 %configure2_5x \
371 --enable-shared \
372 --prefix=%{buildroot}%{_prefix} \
373 --libdir=%{buildroot}%{_libdir}
374
375 # Work around bug in "configure" script
376 perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
377 perl -p -i -e 's/\@EXEEXT\@//g' Makefile
378 %makeinstall
379 # Fix prefixes in scripts
380 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
381 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
382 popd
383
384 ##### GHOSTSCRIPT
385 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
386
387 %if !%{bootstrap}
388 make \
389 prefix=%{_prefix} \
390 DESTDIR=%{buildroot} \
391 gssharedir=%{_libdir}/ghostscript/%{gsver} \
392 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
393 bindir=%{_bindir} \
394 mandir=%{_mandir} \
395 install-cups
396 %endif
397
398 make \
399 prefix=%{_prefix} \
400 DESTDIR=%{buildroot} \
401 gssharedir=%{_libdir}/ghostscript/%{gsver} \
402 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
403 bindir=%{_bindir} \
404 libdir=%{_libdir} \
405 mandir=%{_mandir} \
406 soinstall
407
408 %if %{GSx11SVGAmodule}
409 make \
410 prefix=%{_prefix} \
411 DESTDIR=%{buildroot} \
412 gssharedir=%{_libdir}/ghostscript/%{gsver} \
413 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
414 bindir=%{_bindir} \
415 libdir=%{_libdir} \
416 mandir=%{_mandir} \
417 install-shared
418 %endif
419
420 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
421
422 # ps2pdfpress
423 install -m 755 ps2pdfpress %{buildroot}%{_bindir}
424
425 # UPP file for SiPix Pocket Printer A6
426 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
427 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
428
429 # why?
430 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
431
432 # Correct permissions for all documentation files
433 chmod -R a+rX %{buildroot}%{_docdir}
434 chmod -R go-w %{buildroot}%{_docdir}
435 chmod -R u+w %{buildroot}%{_docdir}
436
437 # remove libtool archive
438 rm -f %{buildroot}%{_libdir}/libijs.la
439
440 %post
441 # Set up update-alternatives entries
442 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
443
444 %post X
445 # Set up update-alternatives entries
446 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
447
448 %post common
449 # Initialize japanese fonts
450 if test -f /usr/share/fonts/ttf/japanese/cidinst; then
451 sh /usr/share/fonts/ttf/japanese/cidinst
452 fi
453
454 %preun
455 if [ "$1" = 0 ]; then
456 # Remove update-alternatives entry
457 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
458 fi
459
460 %preun X
461 if [ "$1" = 0 ]; then
462 # Remove update-alternatives entry
463 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
464 fi
465
466 %files
467 %{_bindir}/gsc
468
469 %files X
470 %{_bindir}/gsx
471
472 %files common
473 %dir %{_datadir}/ghostscript
474 %{_datadir}/ghostscript/%{gsver}
475 %{_mandir}/man1/*
476 %lang(de) %{_mandir}/de/man1/*
477 #%{_bindir}/[a-c]*
478 %{_bindir}/[e-f]*
479 #{_bindir}/gs-common
480 %{_bindir}/gs[a-b]*
481 %{_bindir}/gs[d-n]*
482 %{_bindir}/[j-l]*
483 %{_bindir}/[n-z]*
484 %if %{withcupsfilters}
485 # "pstoraster" wrapper script to make GhostScript being used as the
486 # cups-internal RIP
487 %attr(0755,root,root) %{_prefix}/lib*/cups/filter/*
488 %{_datadir}/cups/model/*
489 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
490 %endif
491
492 %files doc
493 %doc %{_docdir}/ghostscript-doc-%{gsver}
494
495 %files dvipdf
496 %{_bindir}/dvipdf
497
498 %if %{GSx11SVGAmodule}
499 %files module-X
500 %doc README.shared.%{_vendor}
501 %dir %{_libdir}/ghostscript/%{gsver}
502 %{_libdir}/ghostscript/%{gsver}/X11.so
503 %endif
504
505 %files -n %{libgs}
506 %{_libdir}/libgs.so.*%{gsmajor}*
507
508 %files -n %{libgs_devel}
509 %{_libdir}/libgs.so
510 %{_includedir}/ghostscript
511
512 %files -n %{libijs}
513 %{_libdir}/libijs-%{ijsver}.so
514
515 %files -n %{libijs_devel}
516 %doc ijs/README
517 %{_libdir}/libijs.so
518 %{_libdir}/pkgconfig/ijs.pc
519 %{_includedir}/ijs
520 %{_bindir}/ijs_client_example
521 %{_bindir}/ijs_server_example
522 %{_bindir}/ijs-config

  ViewVC Help
Powered by ViewVC 1.1.30