/[packages]/cauldron/ghostscript/current/SPECS/ghostscript.spec
ViewVC logotype

Annotation of /cauldron/ghostscript/current/SPECS/ghostscript.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 473746 - (hide annotations) (download)
Sat Aug 31 16:28:20 2013 UTC (8 years ago) by joequant
File size: 15254 byte(s)
upgrade to 9.09 and remove cups filters (now in cups-filter)

1 luigiwalser 289699 %define _disable_ld_no_undefined 1
2 blino 444131 %define rel 1
3 blino 19330
4 joequant 473746 %define gsver 9.09
5 blino 19330 %define ijsver 0.35
6 joequant 473746 %define ijsreloffset 98
7 luigiwalser 289742 %define ijsrelno %(echo $((%{rel} + %{ijsreloffset})))
8     %define ijsrel %mkrel %{ijsrelno}
9 luigiwalser 289699
10 blino 19330 %define ijsmajor 1
11     %define libijs %mklibname ijs %{ijsmajor}
12 luigiwalser 289699 %define libijs_devel %mklibname -d ijs
13    
14 blino 19330 %define gsmajor 9
15     %define libgs %mklibname gs %{gsmajor}
16 luigiwalser 289699 %define libgs_devel %mklibname -d gs
17 blino 19330
18 luigiwalser 289699 %define bootstrap 0
19 blino 19330
20     %define GSx11SVGAmodule 1
21 joequant 473746 %define withcupsfilters 0
22 blino 19330 %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 luigiwalser 289699 Version: %{gsver}
30 luigiwalser 289700 Release: %mkrel %{rel}
31 blino 443665 License: AGPLv3+
32 blino 19330 Group: Publishing
33     URL: http://www.ghostscript.com/awki/Index
34 blino 443664 Source0: http://downloads.ghostscript.com/public/ghostscript-%{gsver}.tar.gz
35 luigiwalser 289699 Source2: ps2pdfpress.bz2
36     Source3: http://www.linuxprinting.org/download/printing/sipixa6.upp.bz2
37 blino 19330
38 luigiwalser 289699 # 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 blino 443741 Patch4: ghostscript-runlibfileifexists.patch
47 blino 292185 # Fixed missing error check when setting ICC profile.
48 joequant 473746 #Patch5: ghostscript-icc-missing-check.patch
49 luigiwalser 289699 # Install CUPS filter convs files in the correct place.
50 joequant 473746 #Patch6: ghostscript-cups-filters.patch
51 luigiwalser 289699 # 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 blino 443741 Patch7: ghostscript-Fontmap.local.patch
56 luigiwalser 289699 # Don't assume %%rom%% device is available for initial ICC profile dir.
57 blino 443741 Patch8: ghostscript-iccprofiles-initdir.patch
58 luigiwalser 289699 # gdevcups: don't use uninitialized variables in debugging output.
59 blino 443741 Patch9: ghostscript-gdevcups-debug-uninit.patch
60 blino 19330
61 joequant 473746 #Patch100: 0001-Fix-hang-in-gstoraster-if-gs-fails-bug-693336.patch
62 blino 294138
63 joequant 473746 #Patch300: ghostscript-9.05-x11_shared.diff
64     #Patch301: ghostscript-9.06-automake-1.13.patch
65 luigiwalser 304018
66 luigiwalser 289699 %if !%{bootstrap}
67 blino 443733 BuildRequires: gtk+3-devel
68 luigiwalser 289699 BuildRequires: cups-devel
69     BuildRequires: fontconfig-devel
70     %endif
71 blino 19330 BuildRequires: bison
72     BuildRequires: flex
73 luigiwalser 289699 BuildRequires: libtool
74     BuildRequires: unzip
75 blino 19330 BuildRequires: gettext-devel
76     BuildRequires: glibc-devel
77     BuildRequires: jbig2dec-devel
78 luigiwalser 289699 BuildRequires: jpeg-devel
79 blino 19330 BuildRequires: libpaper-devel
80 luigiwalser 289699 BuildRequires: netpbm-devel
81     BuildRequires: tiff-devel
82     BuildRequires: pkgconfig(freetype2)
83     BuildRequires: pkgconfig(ice)
84     BuildRequires: pkgconfig(jasper)
85 blino 444063 BuildRequires: pkgconfig(lcms2) >= 2.5
86 luigiwalser 289699 BuildRequires: pkgconfig(libidn)
87 fwang 434650 BuildRequires: pkgconfig(libpng)
88 luigiwalser 289699 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 blino 19330
95     Requires: ghostscript-common
96     Requires: update-alternatives
97 luigiwalser 289699 %if !%{GSx11SVGAmodule}
98     %rename ghostscript-module-X ghostscript-module-SVGALIB
99 blino 19330 %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 luigiwalser 289699 %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 blino 19330 %description dvipdf
123     Tool to convert the DVI format of TeX into the PDF format. There are
124 boklm 64147 more such tools (for different quality levels) in the dvipdfm
125 blino 19330 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 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %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 blino 19330
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 luigiwalser 289699 %endif
170 blino 19330
171 luigiwalser 289699 %package -n %libgs
172     Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
173     Group: Publishing
174 blino 19330
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 luigiwalser 289699 %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 blino 19330 This package contains the static library and the header files needed
190     to compile applications using the GhostScript shared library.
191    
192 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %package doc
224     Summary: Documentation for GhostScript
225     Group: Publishing
226 tv 405372 BuildArch: noarch
227 luigiwalser 289699
228 blino 19330 %description doc
229     This package contains documentation for GhostScript.
230    
231     %prep
232     %setup -q
233 luigiwalser 289699 %apply_patches
234     # Don't ship backup files
235     find . -name "*.*~" |xargs rm -f
236 blino 19330
237     # prevent building and using bundled libs
238 fwang 398527 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms* freetype
239 blino 19330
240     # Convert manual pages to UTF-8
241     from8859_1() {
242 luigiwalser 289699 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
243     mv "${1}_" "$1"
244 blino 19330 }
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 blino 19364 cat <<EOF >README.shared.%{_vendor}
251 blino 19330 This version of ghostscript support shared modules dynamically loaded
252     at run time.
253    
254 blino 19365 There are currently two modules compiled with the %{distribution} version of
255 blino 19330 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 luigiwalser 289699 pushd ijs*
281 blino 443795 ./autogen.sh
282 lmenut 87327 %configure2_5x \
283     %ifarch %{ix86}
284     --disable-sse2 \
285     %endif
286 luigiwalser 289699 --enable-shared \
287     --disable-static
288    
289 blino 19330 %make
290 luigiwalser 289699 popd
291 blino 19330
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 luigiwalser 289699 --enable-fontconfig \
299 blino 19330 %endif
300 lmenut 87327 %ifarch %{ix86}
301 luigiwalser 289699 --disable-sse2 \
302 lmenut 87327 %endif
303 luigiwalser 289699 --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 joequant 473746 %if %{withcupsfilters}
310 luigiwalser 289699 --with-install-cups
311 joequant 473746 %endif
312 blino 19330
313 luigiwalser 289699 # Drivers which do not compile:
314 blino 19330 # Needs newsiop/lbp.h: nwp533
315     # Needs sys/ioccom.h: sparc
316     # Needs unbdev/lpviio.h: sparc
317    
318     # Set documentation dir
319 luigiwalser 289699 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
320 blino 19330
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 luigiwalser 289699 # bork
332     perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
333    
334 blino 19330 # The RPM macro for make is not used here, as parallelization of the build
335     # process does not work.
336 luigiwalser 289699 %if %{GSx11SVGAmodule}
337     #make soobj/X11.so BUILDPREFIX=so
338 fwang 150967 make obj/X11.so
339 blino 19330 %endif
340     make so
341     #make pcl3opts
342 joequant 473746 %if %{withcupsfilters}
343 luigiwalser 289699 make cups
344 joequant 473746 %endif
345 blino 19330
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 luigiwalser 289699 pushd ijs*
368     %configure2_5x \
369     --enable-shared \
370     --prefix=%{buildroot}%{_prefix} \
371     --libdir=%{buildroot}%{_libdir}
372    
373 blino 19330 # 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 luigiwalser 289699 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 blino 19330
382     ##### GHOSTSCRIPT
383 luigiwalser 289699 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
384 blino 19330
385     %if !%{bootstrap}
386     make \
387     prefix=%{_prefix} \
388     DESTDIR=%{buildroot} \
389 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
390     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
391 blino 19330 bindir=%{_bindir} \
392     mandir=%{_mandir} \
393 joequant 473746 %if %{withcupsfilters}
394 blino 19330 install-cups
395     %endif
396 joequant 473746 %endif
397 blino 19330
398     make \
399     prefix=%{_prefix} \
400     DESTDIR=%{buildroot} \
401 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
402     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
403 blino 19330 bindir=%{_bindir} \
404 luigiwalser 289699 libdir=%{_libdir} \
405 blino 19330 mandir=%{_mandir} \
406 luigiwalser 289699 soinstall
407 blino 19330
408 luigiwalser 289699 %if %{GSx11SVGAmodule}
409 blino 19330 make \
410     prefix=%{_prefix} \
411     DESTDIR=%{buildroot} \
412 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
413     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
414 blino 19330 bindir=%{_bindir} \
415 luigiwalser 289699 libdir=%{_libdir} \
416 blino 19330 mandir=%{_mandir} \
417 luigiwalser 289699 install-shared
418 blino 19330 %endif
419    
420 luigiwalser 289699 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
421 blino 19330
422     # ps2pdfpress
423     install -m 755 ps2pdfpress %{buildroot}%{_bindir}
424    
425     # UPP file for SiPix Pocket Printer A6
426 luigiwalser 289699 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
427     install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
428 blino 19330
429 luigiwalser 289699 # why?
430 joequant 473746 %if %{withcupsfilters}
431 luigiwalser 289699 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
432 joequant 473746 %endif
433 blino 19330
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 luigiwalser 289699 # remove libtool archive
440     rm -f %{buildroot}%{_libdir}/libijs.la
441 blino 19330
442 luigiwalser 289699 %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 blino 19330 %files
469     %{_bindir}/gsc
470    
471     %files X
472     %{_bindir}/gsx
473    
474     %files common
475     %dir %{_datadir}/ghostscript
476 luigiwalser 289699 %{_datadir}/ghostscript/%{gsver}
477 blino 19330 %{_mandir}/man1/*
478     %lang(de) %{_mandir}/de/man1/*
479 fwang 143159 #%{_bindir}/[a-c]*
480 blino 19330 %{_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 lmenut 87327 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
492 blino 19330 %endif
493    
494     %files doc
495 luigiwalser 289699 %doc %{_docdir}/ghostscript-doc-%{gsver}
496 blino 19330
497     %files dvipdf
498     %{_bindir}/dvipdf
499    
500     %if %{GSx11SVGAmodule}
501     %files module-X
502 blino 19364 %doc README.shared.%{_vendor}
503 luigiwalser 289699 %dir %{_libdir}/ghostscript/%{gsver}
504     %{_libdir}/ghostscript/%{gsver}/X11.so
505 blino 19330 %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 fwang 150967 %{_libdir}/libijs-%{ijsver}.so
516 blino 19330
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