/[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 292200 - (hide annotations) (download)
Tue Sep 11 08:53:06 2012 UTC (11 years, 6 months ago) by blino
File size: 15240 byte(s)
use Fedora patches instead of broken rediffs; this fixes
broken runlibfileifexists which made gs abort because of missing
Fontmap.local

1 luigiwalser 289699 %define _disable_ld_no_undefined 1
2 blino 292200 %define rel 3
3 blino 19330
4 luigiwalser 289699 %define gsver 9.06
5 blino 19330 %define ijsver 0.35
6 luigiwalser 289744 %define ijsreloffset 86
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     %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 luigiwalser 289699 Version: %{gsver}
30 luigiwalser 289700 Release: %mkrel %{rel}
31 blino 19330 License: GPLv2+
32     Group: Publishing
33     URL: http://www.ghostscript.com/awki/Index
34 luigiwalser 289699 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 blino 19330
38 luigiwalser 289699 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 blino 292185 # Fixed missing error check when setting ICC profile.
52     Patch6: ghostscript-icc-missing-check.patch
53 luigiwalser 289699 # 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 blino 19330
65 luigiwalser 289699 %if !%{bootstrap}
66     BuildRequires: gtk+2-devel
67     BuildRequires: cups-devel
68     BuildRequires: fontconfig-devel
69     %endif
70 blino 19330 BuildRequires: bison
71     BuildRequires: flex
72 luigiwalser 289699 BuildRequires: libtool
73     BuildRequires: unzip
74 blino 19330 BuildRequires: gettext-devel
75     BuildRequires: glibc-devel
76     BuildRequires: jbig2dec-devel
77 luigiwalser 289699 BuildRequires: jpeg-devel
78 blino 19330 BuildRequires: libpaper-devel
79 luigiwalser 289699 BuildRequires: netpbm-devel
80     BuildRequires: tiff-devel
81     BuildRequires: pkgconfig(freetype2)
82     BuildRequires: pkgconfig(ice)
83     BuildRequires: pkgconfig(jasper)
84     BuildRequires: pkgconfig(lcms)
85     BuildRequires: pkgconfig(libidn)
86     BuildRequires: pkgconfig(libpng15)
87     BuildRequires: pkgconfig(libxml-2.0)
88     BuildRequires: pkgconfig(sm)
89     BuildRequires: pkgconfig(x11)
90     BuildRequires: pkgconfig(xext)
91     BuildRequires: pkgconfig(xt)
92     BuildRequires: pkgconfig(zlib)
93 blino 19330
94     Requires: ghostscript-common
95     Requires: update-alternatives
96 luigiwalser 289699 %if !%{GSx11SVGAmodule}
97     %rename ghostscript-module-X ghostscript-module-SVGALIB
98 blino 19330 %endif
99    
100     %description
101     Ghostscript is a set of software tools that provide a PostScript(TM)
102     interpreter, a set of C procedures (the Ghostscript library, which
103     implements the graphics capabilities in the PostScript language) and
104     an interpreter for Portable Document Format (PDF) files. Ghostscript
105     translates PostScript code into many common, bitmapped and vector
106     formats, like those understood by your printer or screen. Ghostscript
107     is normally used to display PostScript files and to print PostScript
108     files to non-PostScript printers.
109    
110     You should install ghostscript if you need to display PostScript or
111     PDF files, or if you have a non-PostScript printer.
112    
113 luigiwalser 289699 %package dvipdf
114     Summary: PostScript/PDF interpreter and renderer (DVI-to-PDF converter)
115     Group: Publishing
116     Requires: ghostscript
117     Requires: coreutils
118     Requires: dvips
119     Provides: dvipdf = %{version}-%{release}
120    
121 blino 19330 %description dvipdf
122     Tool to convert the DVI format of TeX into the PDF format. There are
123 boklm 64147 more such tools (for different quality levels) in the dvipdfm
124 blino 19330 package. All these tools use dvips of TeX to convert the DVI file to
125     PostScript, then they use GhostScript to generate the PDF file.
126    
127 luigiwalser 289699 %package common
128     Summary: PostScript/PDF interpreter and renderer (Common files)
129     Group: Publishing
130     Requires: urw-fonts >= 1.1
131     Requires: ghostscript-fonts
132    
133 blino 19330 %description common
134     Ghostscript is a PostScript/PDF interpreter. It can render both
135     PostScript and PDF files to devices which include X window, many
136     printer formats, and popular graphics file formats.
137    
138     This package contains the common data files needed by GhostScript.
139    
140 luigiwalser 289699 %package X
141     Summary: PostScript/PDF interpreter and renderer (with X11 screen display)
142     Group: Publishing
143     Requires: ghostscript-common
144     Requires: update-alternatives
145    
146 blino 19330 %description X
147     Ghostscript is a PostScript/PDF interpreter. It can render both
148     PostScript and PDF files to devices which include X window, many
149     printer formats, and popular graphics file formats.
150    
151     This package contains a GhostScript executable with GTK-based X
152     display support ("display" device, default, so it displays files by
153     simply entering "gs <file>" on the command line). It makes use of the
154     GhostScript shared library.
155    
156 luigiwalser 289699 %if %{GSx11SVGAmodule}
157     %package module-X
158     Summary: PostScript/PDF interpreter and renderer (Additional support for X)
159     Group: Publishing
160     Requires: ghostscript-common
161 blino 19330
162     %description module-X
163     Ghostscript is a PostScript/PDF interpreter. It can render both
164     PostScript and PDF files to devices which include X window, many
165     printer formats, and popular graphics file formats.
166    
167     This package enhances Ghostscript with X window support
168 luigiwalser 289699 %endif
169 blino 19330
170 luigiwalser 289699 %package -n %libgs
171     Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
172     Group: Publishing
173 blino 19330
174     %description -n %libgs
175     This is the API library for programs which use the PostScript and/or
176     PDF interpreters of GhostScript.
177    
178 luigiwalser 289699 %package -n %libgs_devel
179     Summary: Headers and links to compile against the "%{libgs}" library
180     Group: Development/C
181     Requires: %libgs >= %{gsver}
182     Provides: %{name}-devel = %{gsver}
183     Provides: libgs-devel = %{gsver}
184     Obsoletes: %{_lib}gs9-devel < %{gsver}
185     Obsoletes: %{_lib}gs8-devel < %{gsver}
186    
187     %description -n %libgs_devel
188 blino 19330 This package contains the static library and the header files needed
189     to compile applications using the GhostScript shared library.
190    
191 luigiwalser 289699 %package -n %{libijs}
192     Version: %{ijsver}
193     Release: %{ijsrel}
194     Summary: Dynamic library for the IJS printer driver plug-in interface
195     Group: Publishing
196     URL: http://www.linuxprinting.org/ijs/
197     Provides: libijs = %{ijsver}-%{ijsrel}
198    
199 blino 19330 %description -n %{libijs}
200     This is the API library for programs using the IJS printer driver
201     plug-in interface. Printer drivers using this interface can be added
202     to GhostScript (6.53 or newer) without needing to rebuild
203     GhostScript. Application programs providing an IJS interface can make
204     use of IJS printer drivers directly, without needing GhostScript.
205    
206 luigiwalser 289699 %package -n %{libijs_devel}
207     Version: %{ijsver}
208     Release: %{ijsrel}
209     Summary: Headers and links for compiling against the "%{libijs}" library
210     Group: Development/C
211     URL: http://www.linuxprinting.org/ijs/
212     Requires: %{libijs} >= %{ijsver}
213     Requires: multiarch-utils
214     Provides: libijs-devel = %{ijsver}-%{ijsrel}
215     Provides: ijs-devel = %{ijsver}-%{ijsrel}
216     Obsoletes: %{_lib}ijs1-devel < %{ijsver}-%{ijsrel}
217    
218 blino 19330 %description -n %{libijs_devel}
219     This package contains the static library and the header files needed
220     to compile applications using the IJS library.
221    
222 luigiwalser 289699 %package doc
223     Summary: Documentation for GhostScript
224     Group: Publishing
225    
226 blino 19330 %description doc
227     This package contains documentation for GhostScript.
228    
229     %prep
230     %setup -q
231 luigiwalser 289699 %apply_patches
232     # Don't ship backup files
233     find . -name "*.*~" |xargs rm -f
234 blino 19330
235     # prevent building and using bundled libs
236 luigiwalser 289699 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms freetype
237 blino 19330
238     # Convert manual pages to UTF-8
239     from8859_1() {
240 luigiwalser 289699 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
241     mv "${1}_" "$1"
242 blino 19330 }
243     for i in man/de/*.1; do from8859_1 "$i"; done
244    
245     # Stuff for shared library support to ghostscript.
246     %if %{GSx11SVGAmodule}
247     # build a small README describing the features available.
248 blino 19364 cat <<EOF >README.shared.%{_vendor}
249 blino 19330 This version of ghostscript support shared modules dynamically loaded
250     at run time.
251    
252 blino 19365 There are currently two modules compiled with the %{distribution} version of
253 blino 19330 ghostscript, one to support all X11 devices (typically used by gv) and
254     another to support the svgalib devices. Look at the
255     ghostscript-module-??? packages.
256    
257     There is no configuration needed, just can add (or remove) the package
258     to add (or remove) the devices concerned in ghostscript.
259     EOF
260     %endif
261    
262     # ps2pdfpress
263     bzcat %{SOURCE2} > ps2pdfpress
264    
265     # UPP file for SiPix Pocket Printer A6
266     bzcat %{SOURCE3} > sipixa6.upp
267    
268     %build
269    
270     # Change compiler flags for debugging when in debug mode
271     %if %debug
272     export DONT_STRIP=1
273     export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
274     export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
275     export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
276     %endif
277    
278 luigiwalser 289699 pushd ijs*
279 blino 19330 # Rebuild broken build infrastructure
280     # Needed by patch4.
281     ./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-omni \
307     --with-x \
308     --disable-compile-inits \
309     --with-system-libtiff \
310     --with-install-cups
311 blino 19330
312 luigiwalser 289699 # Drivers which do not compile:
313 blino 19330 # Needs newsiop/lbp.h: nwp533
314     # Needs sys/ioccom.h: sparc
315     # Needs unbdev/lpviio.h: sparc
316    
317     # Set documentation dir
318 luigiwalser 289699 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
319 blino 19330
320     # Fix references to X11 libraries
321     perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
322    
323     # Correct paths for CJK fonts
324     perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
325     perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
326    
327     # Do not use "-ansi" in gcc calls
328     perl -p -i -e "s:-ansi::g" Makefile
329    
330 luigiwalser 289699 # bork
331     perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
332    
333 blino 19330 # The RPM macro for make is not used here, as parallelization of the build
334     # process does not work.
335 luigiwalser 289699 %if %{GSx11SVGAmodule}
336     #make soobj/X11.so BUILDPREFIX=so
337 fwang 150967 make obj/X11.so
338 blino 19330 %endif
339     make so
340     #make pcl3opts
341 luigiwalser 289699 make cups
342 blino 19330
343     %install
344     rm -rf %{buildroot}
345    
346     # Change compiler flags for debugging when in debug mode
347     %if %debug
348     export DONT_STRIP=1
349     export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
350     export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
351     export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
352     %endif
353    
354     # Make directories
355     install -d %{buildroot}%{_bindir}
356     install -d %{buildroot}%{_libdir}
357     install -d %{buildroot}%{_includedir}
358     install -d %{buildroot}%{_sysconfdir}
359     install -d %{buildroot}%{_mandir}/man1
360     %if !%{bootstrap}
361     install -d %{buildroot}%{_prefix}/lib/cups
362     install -d %{buildroot}%{_datadir}/cups/model
363     install -d %{buildroot}%{_sysconfdir}/cups
364     %endif
365    
366 luigiwalser 289699 pushd ijs*
367     %configure2_5x \
368     --enable-shared \
369     --prefix=%{buildroot}%{_prefix} \
370     --libdir=%{buildroot}%{_libdir}
371    
372 blino 19330 # Work around bug in "configure" script
373     perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
374     perl -p -i -e 's/\@EXEEXT\@//g' Makefile
375     %makeinstall
376     # Fix prefixes in scripts
377 luigiwalser 289699 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
378     perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
379     popd
380 blino 19330
381     ##### GHOSTSCRIPT
382 luigiwalser 289699 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
383 blino 19330
384     %if !%{bootstrap}
385     make \
386     prefix=%{_prefix} \
387     DESTDIR=%{buildroot} \
388 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
389     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
390 blino 19330 bindir=%{_bindir} \
391     mandir=%{_mandir} \
392     install-cups
393     %endif
394    
395     make \
396     prefix=%{_prefix} \
397     DESTDIR=%{buildroot} \
398 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
399     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
400 blino 19330 bindir=%{_bindir} \
401 luigiwalser 289699 libdir=%{_libdir} \
402 blino 19330 mandir=%{_mandir} \
403 luigiwalser 289699 soinstall
404 blino 19330
405 luigiwalser 289699 %if %{GSx11SVGAmodule}
406 blino 19330 make \
407     prefix=%{_prefix} \
408     DESTDIR=%{buildroot} \
409 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
410     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
411 blino 19330 bindir=%{_bindir} \
412 luigiwalser 289699 libdir=%{_libdir} \
413 blino 19330 mandir=%{_mandir} \
414 luigiwalser 289699 install-shared
415 blino 19330 %endif
416    
417 luigiwalser 289699 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
418 blino 19330
419     # ps2pdfpress
420     install -m 755 ps2pdfpress %{buildroot}%{_bindir}
421    
422     # UPP file for SiPix Pocket Printer A6
423 luigiwalser 289699 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
424     install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
425 blino 19330
426 luigiwalser 289699 # why?
427     mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
428 blino 19330
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 luigiwalser 289699 # remove libtool archive
435     rm -f %{buildroot}%{_libdir}/libijs.la
436 blino 19330
437 luigiwalser 289699 %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 blino 19330 %files
464     %{_bindir}/gsc
465    
466     %files X
467     %{_bindir}/gsx
468    
469     %files common
470     %dir %{_datadir}/ghostscript
471 luigiwalser 289699 %{_datadir}/ghostscript/%{gsver}
472 blino 19330 %{_mandir}/man1/*
473     %lang(de) %{_mandir}/de/man1/*
474 fwang 143159 #%{_bindir}/[a-c]*
475 blino 19330 %{_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 lmenut 87327 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
487 blino 19330 %endif
488    
489     %files doc
490 luigiwalser 289699 %doc %{_docdir}/ghostscript-doc-%{gsver}
491 blino 19330
492     %files dvipdf
493     %{_bindir}/dvipdf
494    
495     %if %{GSx11SVGAmodule}
496     %files module-X
497 blino 19364 %doc README.shared.%{_vendor}
498 luigiwalser 289699 %dir %{_libdir}/ghostscript/%{gsver}
499     %{_libdir}/ghostscript/%{gsver}/X11.so
500 blino 19330 %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 fwang 150967 %{_libdir}/libijs-%{ijsver}.so
511 blino 19330
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
520    

  ViewVC Help
Powered by ViewVC 1.1.30