/[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 444132 - (hide annotations) (download)
Mon Jun 17 17:01:20 2013 UTC (10 years, 10 months ago) by blino
File size: 15330 byte(s)
fix ijs release offset (SILENT)

1 luigiwalser 289699 %define _disable_ld_no_undefined 1
2 blino 444131 %define rel 1
3 blino 19330
4 blino 443664 %define gsver 9.07
5 blino 19330 %define ijsver 0.35
6 blino 444132 %define ijsreloffset 97
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 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 blino 443741 Patch5: ghostscript-icc-missing-check.patch
49 luigiwalser 289699 # Install CUPS filter convs files in the correct place.
50 blino 443741 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 444126 # 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 blino 19330
65 blino 294138 Patch100: 0001-Fix-hang-in-gstoraster-if-gs-fails-bug-693336.patch
66    
67 luigiwalser 304018 Patch300: ghostscript-9.05-x11_shared.diff
68 cjw 339808 Patch301: ghostscript-9.06-automake-1.13.patch
69 luigiwalser 304018
70 luigiwalser 289699 %if !%{bootstrap}
71 blino 443733 BuildRequires: gtk+3-devel
72 luigiwalser 289699 BuildRequires: cups-devel
73     BuildRequires: fontconfig-devel
74     %endif
75 blino 19330 BuildRequires: bison
76     BuildRequires: flex
77 luigiwalser 289699 BuildRequires: libtool
78     BuildRequires: unzip
79 blino 19330 BuildRequires: gettext-devel
80     BuildRequires: glibc-devel
81     BuildRequires: jbig2dec-devel
82 luigiwalser 289699 BuildRequires: jpeg-devel
83 blino 19330 BuildRequires: libpaper-devel
84 luigiwalser 289699 BuildRequires: netpbm-devel
85     BuildRequires: tiff-devel
86     BuildRequires: pkgconfig(freetype2)
87     BuildRequires: pkgconfig(ice)
88     BuildRequires: pkgconfig(jasper)
89 blino 444063 BuildRequires: pkgconfig(lcms2) >= 2.5
90 luigiwalser 289699 BuildRequires: pkgconfig(libidn)
91 fwang 434650 BuildRequires: pkgconfig(libpng)
92 luigiwalser 289699 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 blino 19330
99     Requires: ghostscript-common
100     Requires: update-alternatives
101 luigiwalser 289699 %if !%{GSx11SVGAmodule}
102     %rename ghostscript-module-X ghostscript-module-SVGALIB
103 blino 19330 %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 luigiwalser 289699 %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 blino 19330 %description dvipdf
127     Tool to convert the DVI format of TeX into the PDF format. There are
128 boklm 64147 more such tools (for different quality levels) in the dvipdfm
129 blino 19330 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 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %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 blino 19330
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 luigiwalser 289699 %endif
174 blino 19330
175 luigiwalser 289699 %package -n %libgs
176     Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
177     Group: Publishing
178 blino 19330
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 luigiwalser 289699 %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 blino 19330 This package contains the static library and the header files needed
194     to compile applications using the GhostScript shared library.
195    
196 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %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 blino 19330 %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 luigiwalser 289699 %package doc
228     Summary: Documentation for GhostScript
229     Group: Publishing
230 tv 405372 BuildArch: noarch
231 luigiwalser 289699
232 blino 19330 %description doc
233     This package contains documentation for GhostScript.
234    
235     %prep
236     %setup -q
237 luigiwalser 289699 %apply_patches
238     # Don't ship backup files
239     find . -name "*.*~" |xargs rm -f
240 blino 19330
241     # prevent building and using bundled libs
242 fwang 398527 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms* freetype
243 blino 19330
244     # Convert manual pages to UTF-8
245     from8859_1() {
246 luigiwalser 289699 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
247     mv "${1}_" "$1"
248 blino 19330 }
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 blino 19364 cat <<EOF >README.shared.%{_vendor}
255 blino 19330 This version of ghostscript support shared modules dynamically loaded
256     at run time.
257    
258 blino 19365 There are currently two modules compiled with the %{distribution} version of
259 blino 19330 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 luigiwalser 289699 pushd ijs*
285 blino 443795 ./autogen.sh
286 lmenut 87327 %configure2_5x \
287     %ifarch %{ix86}
288     --disable-sse2 \
289     %endif
290 luigiwalser 289699 --enable-shared \
291     --disable-static
292    
293 blino 19330 %make
294 luigiwalser 289699 popd
295 blino 19330
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 luigiwalser 289699 --enable-fontconfig \
303 blino 19330 %endif
304 lmenut 87327 %ifarch %{ix86}
305 luigiwalser 289699 --disable-sse2 \
306 lmenut 87327 %endif
307 luigiwalser 289699 --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 blino 19330
315 luigiwalser 289699 # Drivers which do not compile:
316 blino 19330 # Needs newsiop/lbp.h: nwp533
317     # Needs sys/ioccom.h: sparc
318     # Needs unbdev/lpviio.h: sparc
319    
320     # Set documentation dir
321 luigiwalser 289699 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
322 blino 19330
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 luigiwalser 289699 # bork
334     perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
335    
336 blino 19330 # The RPM macro for make is not used here, as parallelization of the build
337     # process does not work.
338 luigiwalser 289699 %if %{GSx11SVGAmodule}
339     #make soobj/X11.so BUILDPREFIX=so
340 fwang 150967 make obj/X11.so
341 blino 19330 %endif
342     make so
343     #make pcl3opts
344 luigiwalser 289699 make cups
345 blino 19330
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 luigiwalser 289699 pushd ijs*
370     %configure2_5x \
371     --enable-shared \
372     --prefix=%{buildroot}%{_prefix} \
373     --libdir=%{buildroot}%{_libdir}
374    
375 blino 19330 # 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 luigiwalser 289699 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 blino 19330
384     ##### GHOSTSCRIPT
385 luigiwalser 289699 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
386 blino 19330
387     %if !%{bootstrap}
388     make \
389     prefix=%{_prefix} \
390     DESTDIR=%{buildroot} \
391 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
392     docdir=%{_docdir}/ghostscript-doc-%{gsver} \
393 blino 19330 bindir=%{_bindir} \
394     mandir=%{_mandir} \
395     install-cups
396     %endif
397    
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     mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
431 blino 19330
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 luigiwalser 289699 # remove libtool archive
438     rm -f %{buildroot}%{_libdir}/libijs.la
439 blino 19330
440 luigiwalser 289699 %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 blino 19330 %files
467     %{_bindir}/gsc
468    
469     %files X
470     %{_bindir}/gsx
471    
472     %files common
473     %dir %{_datadir}/ghostscript
474 luigiwalser 289699 %{_datadir}/ghostscript/%{gsver}
475 blino 19330 %{_mandir}/man1/*
476     %lang(de) %{_mandir}/de/man1/*
477 fwang 143159 #%{_bindir}/[a-c]*
478 blino 19330 %{_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 lmenut 87327 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
490 blino 19330 %endif
491    
492     %files doc
493 luigiwalser 289699 %doc %{_docdir}/ghostscript-doc-%{gsver}
494 blino 19330
495     %files dvipdf
496     %{_bindir}/dvipdf
497    
498     %if %{GSx11SVGAmodule}
499     %files module-X
500 blino 19364 %doc README.shared.%{_vendor}
501 luigiwalser 289699 %dir %{_libdir}/ghostscript/%{gsver}
502     %{_libdir}/ghostscript/%{gsver}/X11.so
503 blino 19330 %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 fwang 150967 %{_libdir}/libijs-%{ijsver}.so
514 blino 19330
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