/[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 473746 - (show annotations) (download)
Sat Aug 31 16:28:20 2013 UTC (7 years, 10 months ago) by joequant
File size: 15254 byte(s)
upgrade to 9.09 and remove cups filters (now in cups-filter)

1 %define _disable_ld_no_undefined 1
2 %define rel 1
3
4 %define gsver 9.09
5 %define ijsver 0.35
6 %define ijsreloffset 98
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 # 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
61 #Patch100: 0001-Fix-hang-in-gstoraster-if-gs-fails-bug-693336.patch
62
63 #Patch300: ghostscript-9.05-x11_shared.diff
64 #Patch301: ghostscript-9.06-automake-1.13.patch
65
66 %if !%{bootstrap}
67 BuildRequires: gtk+3-devel
68 BuildRequires: cups-devel
69 BuildRequires: fontconfig-devel
70 %endif
71 BuildRequires: bison
72 BuildRequires: flex
73 BuildRequires: libtool
74 BuildRequires: unzip
75 BuildRequires: gettext-devel
76 BuildRequires: glibc-devel
77 BuildRequires: jbig2dec-devel
78 BuildRequires: jpeg-devel
79 BuildRequires: libpaper-devel
80 BuildRequires: netpbm-devel
81 BuildRequires: tiff-devel
82 BuildRequires: pkgconfig(freetype2)
83 BuildRequires: pkgconfig(ice)
84 BuildRequires: pkgconfig(jasper)
85 BuildRequires: pkgconfig(lcms2) >= 2.5
86 BuildRequires: pkgconfig(libidn)
87 BuildRequires: pkgconfig(libpng)
88 BuildRequires: pkgconfig(libxml-2.0)
89 BuildRequires: pkgconfig(sm)
90 BuildRequires: pkgconfig(x11)
91 BuildRequires: pkgconfig(xext)
92 BuildRequires: pkgconfig(xt)
93 BuildRequires: pkgconfig(zlib)
94
95 Requires: ghostscript-common
96 Requires: update-alternatives
97 %if !%{GSx11SVGAmodule}
98 %rename ghostscript-module-X ghostscript-module-SVGALIB
99 %endif
100
101 %description
102 Ghostscript is a set of software tools that provide a PostScript(TM)
103 interpreter, a set of C procedures (the Ghostscript library, which
104 implements the graphics capabilities in the PostScript language) and
105 an interpreter for Portable Document Format (PDF) files. Ghostscript
106 translates PostScript code into many common, bitmapped and vector
107 formats, like those understood by your printer or screen. Ghostscript
108 is normally used to display PostScript files and to print PostScript
109 files to non-PostScript printers.
110
111 You should install ghostscript if you need to display PostScript or
112 PDF files, or if you have a non-PostScript printer.
113
114 %package dvipdf
115 Summary: PostScript/PDF interpreter and renderer (DVI-to-PDF converter)
116 Group: Publishing
117 Requires: ghostscript
118 Requires: coreutils
119 Requires: dvips
120 Provides: dvipdf = %{version}-%{release}
121
122 %description dvipdf
123 Tool to convert the DVI format of TeX into the PDF format. There are
124 more such tools (for different quality levels) in the dvipdfm
125 package. All these tools use dvips of TeX to convert the DVI file to
126 PostScript, then they use GhostScript to generate the PDF file.
127
128 %package common
129 Summary: PostScript/PDF interpreter and renderer (Common files)
130 Group: Publishing
131 Requires: urw-fonts >= 1.1
132 Requires: ghostscript-fonts
133
134 %description common
135 Ghostscript is a PostScript/PDF interpreter. It can render both
136 PostScript and PDF files to devices which include X window, many
137 printer formats, and popular graphics file formats.
138
139 This package contains the common data files needed by GhostScript.
140
141 %package X
142 Summary: PostScript/PDF interpreter and renderer (with X11 screen display)
143 Group: Publishing
144 Requires: ghostscript-common
145 Requires: update-alternatives
146
147 %description X
148 Ghostscript is a PostScript/PDF interpreter. It can render both
149 PostScript and PDF files to devices which include X window, many
150 printer formats, and popular graphics file formats.
151
152 This package contains a GhostScript executable with GTK-based X
153 display support ("display" device, default, so it displays files by
154 simply entering "gs <file>" on the command line). It makes use of the
155 GhostScript shared library.
156
157 %if %{GSx11SVGAmodule}
158 %package module-X
159 Summary: PostScript/PDF interpreter and renderer (Additional support for X)
160 Group: Publishing
161 Requires: ghostscript-common
162
163 %description module-X
164 Ghostscript is a PostScript/PDF interpreter. It can render both
165 PostScript and PDF files to devices which include X window, many
166 printer formats, and popular graphics file formats.
167
168 This package enhances Ghostscript with X window support
169 %endif
170
171 %package -n %libgs
172 Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
173 Group: Publishing
174
175 %description -n %libgs
176 This is the API library for programs which use the PostScript and/or
177 PDF interpreters of GhostScript.
178
179 %package -n %libgs_devel
180 Summary: Headers and links to compile against the "%{libgs}" library
181 Group: Development/C
182 Requires: %libgs >= %{gsver}
183 Provides: %{name}-devel = %{gsver}
184 Provides: libgs-devel = %{gsver}
185 Obsoletes: %{_lib}gs9-devel < %{gsver}
186 Obsoletes: %{_lib}gs8-devel < %{gsver}
187
188 %description -n %libgs_devel
189 This package contains the static library and the header files needed
190 to compile applications using the GhostScript shared library.
191
192 %package -n %{libijs}
193 Version: %{ijsver}
194 Release: %{ijsrel}
195 Summary: Dynamic library for the IJS printer driver plug-in interface
196 Group: Publishing
197 URL: http://www.linuxprinting.org/ijs/
198 Provides: libijs = %{ijsver}-%{ijsrel}
199
200 %description -n %{libijs}
201 This is the API library for programs using the IJS printer driver
202 plug-in interface. Printer drivers using this interface can be added
203 to GhostScript (6.53 or newer) without needing to rebuild
204 GhostScript. Application programs providing an IJS interface can make
205 use of IJS printer drivers directly, without needing GhostScript.
206
207 %package -n %{libijs_devel}
208 Version: %{ijsver}
209 Release: %{ijsrel}
210 Summary: Headers and links for compiling against the "%{libijs}" library
211 Group: Development/C
212 URL: http://www.linuxprinting.org/ijs/
213 Requires: %{libijs} >= %{ijsver}
214 Requires: multiarch-utils
215 Provides: libijs-devel = %{ijsver}-%{ijsrel}
216 Provides: ijs-devel = %{ijsver}-%{ijsrel}
217 Obsoletes: %{_lib}ijs1-devel < %{ijsver}-%{ijsrel}
218
219 %description -n %{libijs_devel}
220 This package contains the static library and the header files needed
221 to compile applications using the IJS library.
222
223 %package doc
224 Summary: Documentation for GhostScript
225 Group: Publishing
226 BuildArch: noarch
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 ./autogen.sh
282 %configure2_5x \
283 %ifarch %{ix86}
284 --disable-sse2 \
285 %endif
286 --enable-shared \
287 --disable-static
288
289 %make
290 popd
291
292 # We have a Subversion version, so we must re-generate "configure"
293 ./autogen.sh
294
295 %configure2_5x \
296 --enable-dynamic \
297 %if !%{bootstrap}
298 --enable-fontconfig \
299 %endif
300 %ifarch %{ix86}
301 --disable-sse2 \
302 %endif
303 --with-drivers=ALL,opvp \
304 --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" \
305 --with-ijs \
306 --with-x \
307 --disable-compile-inits \
308 --with-system-libtiff \
309 %if %{withcupsfilters}
310 --with-install-cups
311 %endif
312
313 # Drivers which do not compile:
314 # Needs newsiop/lbp.h: nwp533
315 # Needs sys/ioccom.h: sparc
316 # Needs unbdev/lpviio.h: sparc
317
318 # Set documentation dir
319 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
320
321 # Fix references to X11 libraries
322 perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
323
324 # Correct paths for CJK fonts
325 perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
326 perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
327
328 # Do not use "-ansi" in gcc calls
329 perl -p -i -e "s:-ansi::g" Makefile
330
331 # bork
332 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
333
334 # The RPM macro for make is not used here, as parallelization of the build
335 # process does not work.
336 %if %{GSx11SVGAmodule}
337 #make soobj/X11.so BUILDPREFIX=so
338 make obj/X11.so
339 %endif
340 make so
341 #make pcl3opts
342 %if %{withcupsfilters}
343 make cups
344 %endif
345
346 %install
347 # Change compiler flags for debugging when in debug mode
348 %if %debug
349 export DONT_STRIP=1
350 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
351 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
352 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
353 %endif
354
355 # Make directories
356 install -d %{buildroot}%{_bindir}
357 install -d %{buildroot}%{_libdir}
358 install -d %{buildroot}%{_includedir}
359 install -d %{buildroot}%{_sysconfdir}
360 install -d %{buildroot}%{_mandir}/man1
361 %if !%{bootstrap}
362 install -d %{buildroot}%{_prefix}/lib/cups
363 install -d %{buildroot}%{_datadir}/cups/model
364 install -d %{buildroot}%{_sysconfdir}/cups
365 %endif
366
367 pushd ijs*
368 %configure2_5x \
369 --enable-shared \
370 --prefix=%{buildroot}%{_prefix} \
371 --libdir=%{buildroot}%{_libdir}
372
373 # Work around bug in "configure" script
374 perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
375 perl -p -i -e 's/\@EXEEXT\@//g' Makefile
376 %makeinstall
377 # Fix prefixes in scripts
378 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
379 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
380 popd
381
382 ##### GHOSTSCRIPT
383 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
384
385 %if !%{bootstrap}
386 make \
387 prefix=%{_prefix} \
388 DESTDIR=%{buildroot} \
389 gssharedir=%{_libdir}/ghostscript/%{gsver} \
390 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
391 bindir=%{_bindir} \
392 mandir=%{_mandir} \
393 %if %{withcupsfilters}
394 install-cups
395 %endif
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 %if %{withcupsfilters}
431 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
432 %endif
433
434 # Correct permissions for all documentation files
435 chmod -R a+rX %{buildroot}%{_docdir}
436 chmod -R go-w %{buildroot}%{_docdir}
437 chmod -R u+w %{buildroot}%{_docdir}
438
439 # remove libtool archive
440 rm -f %{buildroot}%{_libdir}/libijs.la
441
442 %post
443 # Set up update-alternatives entries
444 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
445
446 %post X
447 # Set up update-alternatives entries
448 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
449
450 %post common
451 # Initialize japanese fonts
452 if test -f /usr/share/fonts/ttf/japanese/cidinst; then
453 sh /usr/share/fonts/ttf/japanese/cidinst
454 fi
455
456 %preun
457 if [ "$1" = 0 ]; then
458 # Remove update-alternatives entry
459 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
460 fi
461
462 %preun X
463 if [ "$1" = 0 ]; then
464 # Remove update-alternatives entry
465 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
466 fi
467
468 %files
469 %{_bindir}/gsc
470
471 %files X
472 %{_bindir}/gsx
473
474 %files common
475 %dir %{_datadir}/ghostscript
476 %{_datadir}/ghostscript/%{gsver}
477 %{_mandir}/man1/*
478 %lang(de) %{_mandir}/de/man1/*
479 #%{_bindir}/[a-c]*
480 %{_bindir}/[e-f]*
481 #{_bindir}/gs-common
482 %{_bindir}/gs[a-b]*
483 %{_bindir}/gs[d-n]*
484 %{_bindir}/[j-l]*
485 %{_bindir}/[n-z]*
486 %if %{withcupsfilters}
487 # "pstoraster" wrapper script to make GhostScript being used as the
488 # cups-internal RIP
489 %attr(0755,root,root) %{_prefix}/lib*/cups/filter/*
490 %{_datadir}/cups/model/*
491 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
492 %endif
493
494 %files doc
495 %doc %{_docdir}/ghostscript-doc-%{gsver}
496
497 %files dvipdf
498 %{_bindir}/dvipdf
499
500 %if %{GSx11SVGAmodule}
501 %files module-X
502 %doc README.shared.%{_vendor}
503 %dir %{_libdir}/ghostscript/%{gsver}
504 %{_libdir}/ghostscript/%{gsver}/X11.so
505 %endif
506
507 %files -n %{libgs}
508 %{_libdir}/libgs.so.*%{gsmajor}*
509
510 %files -n %{libgs_devel}
511 %{_libdir}/libgs.so
512 %{_includedir}/ghostscript
513
514 %files -n %{libijs}
515 %{_libdir}/libijs-%{ijsver}.so
516
517 %files -n %{libijs_devel}
518 %doc ijs/README
519 %{_libdir}/libijs.so
520 %{_libdir}/pkgconfig/ijs.pc
521 %{_includedir}/ijs
522 %{_bindir}/ijs_client_example
523 %{_bindir}/ijs_server_example
524 %{_bindir}/ijs-config

  ViewVC Help
Powered by ViewVC 1.1.28