/[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 595415 - (show annotations) (download)
Sat Feb 22 00:44:44 2014 UTC (6 years, 5 months ago) by tv
File size: 15033 byte(s)
sync patch odering with FC (SILENT)

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

  ViewVC Help
Powered by ViewVC 1.1.28