/[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 1745507 - (hide annotations) (download)
Wed Sep 15 14:31:47 2021 UTC (12 days, 19 hours ago) by ns80
File size: 13488 byte(s)
- add patch from Ubuntu for CVE-2021-3781 (mga#29453)

1 luigiwalser 289699 %define _disable_ld_no_undefined 1
2 blino 19330
3 ns80 1745507 %define rel 2
4 wally 1251180
5 kekepower 1712211 %define gsverdir 9540
6     %define gsver 9.54.0
7 blino 19330 %define ijsver 0.35
8 kekepower 1556145 # This is the offset of the previous version. Seems like the BS
9     # increases this automatically
10 kekepower 1712211 %define ijsreloffset 162
11 luigiwalser 289742 %define ijsrelno %(echo $((%{rel} + %{ijsreloffset})))
12     %define ijsrel %mkrel %{ijsrelno}
13 luigiwalser 289699
14 blino 19330 %define ijsmajor 1
15     %define libijs %mklibname ijs %{ijsmajor}
16 luigiwalser 289699 %define libijs_devel %mklibname -d ijs
17    
18 blino 19330 %define gsmajor 9
19     %define libgs %mklibname gs %{gsmajor}
20 luigiwalser 289699 %define libgs_devel %mklibname -d gs
21 blino 19330
22 luigiwalser 289699 %define bootstrap 0
23 blino 19330
24     %define GSx11SVGAmodule 1
25    
26     Summary: PostScript/PDF interpreter and renderer (Main executable)
27     Name: ghostscript
28 luigiwalser 289699 Version: %{gsver}
29 luigiwalser 289700 Release: %mkrel %{rel}
30 blino 443665 License: AGPLv3+
31 blino 19330 Group: Publishing
32 luigiwalser 1020958 URL: http://www.ghostscript.com/
33 ns80 1180067 Source0: https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs%gsverdir/ghostscript-%gsver.tar.xz
34 luigiwalser 289699 Source2: ps2pdfpress.bz2
35     Source3: http://www.linuxprinting.org/download/printing/sipixa6.upp.bz2
36 blino 19330
37 akien 1043163 # Don't define static openjpeg2, breaks linking
38 ns80 1556191 Patch0: ghostscript-9.51-openjpeg2-non-static.patch
39 luigiwalser 289699 # Fix some shell scripts
40 luigiwalser 1386226 Patch1: ghostscript-scripts.patch
41 luigiwalser 289699 # Build igcref.c with -O0 to work around bug #150771.
42 luigiwalser 1386226 Patch2: ghostscript-noopt.patch
43 luigiwalser 289699 # Define .runlibfileifexists.
44 luigiwalser 1386226 Patch3: ghostscript-runlibfileifexists.patch
45 luigiwalser 289699 # Restored Fontmap.local patch, incorrectly dropped after
46     # ghostscript-8.15.4-3 (bug #610301).
47     # Note: don't use -b here to avoid the backup file ending up in the
48     # package manifest.
49 luigiwalser 1386226 Patch4: ghostscript-Fontmap.local.patch
50 ns80 1745507 Patch5: CVE-2021-3781.patch
51 blino 19330
52 luigiwalser 289699 %if !%{bootstrap}
53 daviddavid 1430046 BuildRequires: pkgconfig(gtk+-3.0)
54 luigiwalser 289699 BuildRequires: cups-devel
55 ovitters 1144441 BuildRequires: pkgconfig(fontconfig)
56 luigiwalser 289699 %endif
57 blino 19330 BuildRequires: bison
58     BuildRequires: flex
59 luigiwalser 289699 BuildRequires: libtool
60     BuildRequires: unzip
61 blino 19330 BuildRequires: gettext-devel
62     BuildRequires: glibc-devel
63 ns80 1457922 BuildRequires: jbig2dec-devel >= 0.17
64 ovitters 1144441 BuildRequires: pkgconfig(libjpeg)
65 blino 19330 BuildRequires: libpaper-devel
66 luigiwalser 289699 BuildRequires: netpbm-devel
67 ovitters 1144441 BuildRequires: pkgconfig(libtiff-4)
68 luigiwalser 289699 BuildRequires: pkgconfig(freetype2)
69     BuildRequires: pkgconfig(ice)
70     BuildRequires: pkgconfig(jasper)
71 blino 444063 BuildRequires: pkgconfig(lcms2) >= 2.5
72 luigiwalser 289699 BuildRequires: pkgconfig(libidn)
73 luigiwalser 907481 BuildRequires: pkgconfig(libopenjp2)
74 fwang 434650 BuildRequires: pkgconfig(libpng)
75 luigiwalser 289699 BuildRequires: pkgconfig(libxml-2.0)
76     BuildRequires: pkgconfig(sm)
77     BuildRequires: pkgconfig(x11)
78     BuildRequires: pkgconfig(xext)
79     BuildRequires: pkgconfig(xt)
80     BuildRequires: pkgconfig(zlib)
81 blino 19330
82     Requires: ghostscript-common
83     Requires: update-alternatives
84 luigiwalser 289699 %if !%{GSx11SVGAmodule}
85     %rename ghostscript-module-X ghostscript-module-SVGALIB
86 blino 19330 %endif
87    
88     %description
89     Ghostscript is a set of software tools that provide a PostScript(TM)
90     interpreter, a set of C procedures (the Ghostscript library, which
91     implements the graphics capabilities in the PostScript language) and
92     an interpreter for Portable Document Format (PDF) files. Ghostscript
93     translates PostScript code into many common, bitmapped and vector
94     formats, like those understood by your printer or screen. Ghostscript
95     is normally used to display PostScript files and to print PostScript
96     files to non-PostScript printers.
97    
98     You should install ghostscript if you need to display PostScript or
99     PDF files, or if you have a non-PostScript printer.
100    
101 luigiwalser 289699 %package dvipdf
102     Summary: PostScript/PDF interpreter and renderer (DVI-to-PDF converter)
103     Group: Publishing
104     Requires: ghostscript
105     Requires: coreutils
106     Requires: dvips
107     Provides: dvipdf = %{version}-%{release}
108    
109 blino 19330 %description dvipdf
110     Tool to convert the DVI format of TeX into the PDF format. There are
111 boklm 64147 more such tools (for different quality levels) in the dvipdfm
112 blino 19330 package. All these tools use dvips of TeX to convert the DVI file to
113     PostScript, then they use GhostScript to generate the PDF file.
114    
115 luigiwalser 289699 %package common
116     Summary: PostScript/PDF interpreter and renderer (Common files)
117     Group: Publishing
118     Requires: urw-fonts >= 1.1
119     Requires: ghostscript-fonts
120    
121 blino 19330 %description common
122     Ghostscript is a PostScript/PDF interpreter. It can render both
123     PostScript and PDF files to devices which include X window, many
124     printer formats, and popular graphics file formats.
125    
126     This package contains the common data files needed by GhostScript.
127    
128 luigiwalser 289699 %package X
129     Summary: PostScript/PDF interpreter and renderer (with X11 screen display)
130     Group: Publishing
131     Requires: ghostscript-common
132     Requires: update-alternatives
133    
134 blino 19330 %description X
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 a GhostScript executable with GTK-based X
140     display support ("display" device, default, so it displays files by
141     simply entering "gs <file>" on the command line). It makes use of the
142     GhostScript shared library.
143    
144 luigiwalser 289699 %if %{GSx11SVGAmodule}
145     %package module-X
146     Summary: PostScript/PDF interpreter and renderer (Additional support for X)
147     Group: Publishing
148     Requires: ghostscript-common
149 blino 19330
150     %description module-X
151     Ghostscript is a PostScript/PDF interpreter. It can render both
152     PostScript and PDF files to devices which include X window, many
153     printer formats, and popular graphics file formats.
154    
155     This package enhances Ghostscript with X window support
156 luigiwalser 289699 %endif
157 blino 19330
158 luigiwalser 289699 %package -n %libgs
159     Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
160     Group: Publishing
161 blino 19330
162     %description -n %libgs
163     This is the API library for programs which use the PostScript and/or
164     PDF interpreters of GhostScript.
165    
166 luigiwalser 289699 %package -n %libgs_devel
167     Summary: Headers and links to compile against the "%{libgs}" library
168     Group: Development/C
169     Requires: %libgs >= %{gsver}
170     Provides: %{name}-devel = %{gsver}
171     Provides: libgs-devel = %{gsver}
172     Obsoletes: %{_lib}gs9-devel < %{gsver}
173     Obsoletes: %{_lib}gs8-devel < %{gsver}
174    
175     %description -n %libgs_devel
176 blino 19330 This package contains the static library and the header files needed
177     to compile applications using the GhostScript shared library.
178    
179 luigiwalser 289699 %package -n %{libijs}
180     Version: %{ijsver}
181     Release: %{ijsrel}
182     Summary: Dynamic library for the IJS printer driver plug-in interface
183     Group: Publishing
184     URL: http://www.linuxprinting.org/ijs/
185     Provides: libijs = %{ijsver}-%{ijsrel}
186    
187 blino 19330 %description -n %{libijs}
188     This is the API library for programs using the IJS printer driver
189     plug-in interface. Printer drivers using this interface can be added
190     to GhostScript (6.53 or newer) without needing to rebuild
191     GhostScript. Application programs providing an IJS interface can make
192     use of IJS printer drivers directly, without needing GhostScript.
193    
194 luigiwalser 289699 %package -n %{libijs_devel}
195     Version: %{ijsver}
196     Release: %{ijsrel}
197     Summary: Headers and links for compiling against the "%{libijs}" library
198     Group: Development/C
199     URL: http://www.linuxprinting.org/ijs/
200     Requires: %{libijs} >= %{ijsver}
201     Requires: multiarch-utils
202     Provides: libijs-devel = %{ijsver}-%{ijsrel}
203     Provides: ijs-devel = %{ijsver}-%{ijsrel}
204     Obsoletes: %{_lib}ijs1-devel < %{ijsver}-%{ijsrel}
205    
206 blino 19330 %description -n %{libijs_devel}
207     This package contains the static library and the header files needed
208     to compile applications using the IJS library.
209    
210 luigiwalser 289699 %package doc
211     Summary: Documentation for GhostScript
212     Group: Publishing
213 tv 405372 BuildArch: noarch
214 luigiwalser 289699
215 blino 19330 %description doc
216     This package contains documentation for GhostScript.
217    
218     %prep
219     %setup -q
220 tv 595472 rm -rf expat freetype icclib jasper jpeg jpegxr lcms2 libpng openjpeg zlib cups/libs
221 ns80 1457824 %autopatch -p1
222 daviddavid 1430046
223 luigiwalser 289699 # Don't ship backup files
224     find . -name "*.*~" |xargs rm -f
225 blino 19330
226     # prevent building and using bundled libs
227 fwang 398527 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms* freetype
228 blino 19330
229     # Convert manual pages to UTF-8
230     from8859_1() {
231 luigiwalser 289699 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
232     mv "${1}_" "$1"
233 blino 19330 }
234     for i in man/de/*.1; do from8859_1 "$i"; done
235    
236     # Stuff for shared library support to ghostscript.
237     %if %{GSx11SVGAmodule}
238     # build a small README describing the features available.
239 blino 19364 cat <<EOF >README.shared.%{_vendor}
240 blino 19330 This version of ghostscript support shared modules dynamically loaded
241     at run time.
242    
243 blino 19365 There are currently two modules compiled with the %{distribution} version of
244 blino 19330 ghostscript, one to support all X11 devices (typically used by gv) and
245     another to support the svgalib devices. Look at the
246     ghostscript-module-??? packages.
247    
248     There is no configuration needed, just can add (or remove) the package
249     to add (or remove) the devices concerned in ghostscript.
250     EOF
251     %endif
252    
253     # ps2pdfpress
254     bzcat %{SOURCE2} > ps2pdfpress
255    
256     # UPP file for SiPix Pocket Printer A6
257     bzcat %{SOURCE3} > sipixa6.upp
258    
259     %build
260     # We have a Subversion version, so we must re-generate "configure"
261     ./autogen.sh
262    
263 wally 1478915 %configure \
264 blino 19330 --enable-dynamic \
265     %if !%{bootstrap}
266 luigiwalser 289699 --enable-fontconfig \
267 blino 19330 %endif
268 lmenut 87327 %ifarch %{ix86}
269 luigiwalser 289699 --disable-sse2 \
270 lmenut 87327 %endif
271 luigiwalser 289699 --with-drivers=ALL,opvp \
272     --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" \
273     --with-ijs \
274     --with-x \
275     --disable-compile-inits \
276     --with-system-libtiff \
277 blino 19330
278 tv 595424 # Build IJS
279     pushd ijs
280     ./autogen.sh
281 wally 1478915 %configure \
282 tv 595424 %ifarch %{ix86}
283     --disable-sse2 \
284     %endif
285     --enable-shared \
286     --disable-static
287    
288 ovitters 1579003 %make_build
289 tv 595424 popd
290    
291 blino 19330 # Set documentation dir
292 luigiwalser 289699 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
293 blino 19330
294     # Fix references to X11 libraries
295     perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
296    
297     # Correct paths for CJK fonts
298     perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
299     perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
300    
301 luigiwalser 289699 # bork
302     perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
303    
304 blino 19330 # The RPM macro for make is not used here, as parallelization of the build
305     # process does not work.
306 luigiwalser 289699 %if %{GSx11SVGAmodule}
307 fwang 150967 make obj/X11.so
308 blino 19330 %endif
309     make so
310    
311     %install
312     # Make directories
313     install -d %{buildroot}%{_bindir}
314     install -d %{buildroot}%{_libdir}
315     install -d %{buildroot}%{_includedir}
316     install -d %{buildroot}%{_sysconfdir}
317     install -d %{buildroot}%{_mandir}/man1
318     %if !%{bootstrap}
319     install -d %{buildroot}%{_prefix}/lib/cups
320     install -d %{buildroot}%{_datadir}/cups/model
321     install -d %{buildroot}%{_sysconfdir}/cups
322     %endif
323    
324 luigiwalser 289699 pushd ijs*
325 wally 1478915 %configure \
326 luigiwalser 289699 --enable-shared \
327     --prefix=%{buildroot}%{_prefix} \
328     --libdir=%{buildroot}%{_libdir}
329    
330 blino 19330 # Work around bug in "configure" script
331     perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
332     perl -p -i -e 's/\@EXEEXT\@//g' Makefile
333     %makeinstall
334     # Fix prefixes in scripts
335 luigiwalser 289699 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
336     popd
337 blino 19330
338     ##### GHOSTSCRIPT
339 kekepower 1220923 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
340 blino 19330
341     %if !%{bootstrap}
342     make \
343     prefix=%{_prefix} \
344     DESTDIR=%{buildroot} \
345 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
346 kekepower 1220923 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
347 blino 19330 bindir=%{_bindir} \
348     mandir=%{_mandir} \
349     %endif
350    
351     make \
352     prefix=%{_prefix} \
353     DESTDIR=%{buildroot} \
354 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
355 kekepower 1220923 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
356 blino 19330 bindir=%{_bindir} \
357 luigiwalser 289699 libdir=%{_libdir} \
358 blino 19330 mandir=%{_mandir} \
359 luigiwalser 289699 soinstall
360 blino 19330
361 luigiwalser 289699 %if %{GSx11SVGAmodule}
362 blino 19330 make \
363     prefix=%{_prefix} \
364     DESTDIR=%{buildroot} \
365 luigiwalser 289699 gssharedir=%{_libdir}/ghostscript/%{gsver} \
366 kekepower 1220923 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
367 blino 19330 bindir=%{_bindir} \
368 luigiwalser 289699 libdir=%{_libdir} \
369 blino 19330 mandir=%{_mandir} \
370 luigiwalser 289699 install-shared
371 blino 19330 %endif
372    
373 luigiwalser 289699 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
374 blino 19330
375     # ps2pdfpress
376     install -m 755 ps2pdfpress %{buildroot}%{_bindir}
377    
378     # UPP file for SiPix Pocket Printer A6
379 daviddavid 1430046 #mkdir -p %%{buildroot}%%{_datadir}/ghostscript/%%{gsver}/lib
380 luigiwalser 289699 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
381 blino 19330
382     # Correct permissions for all documentation files
383 kekepower 1220923 chmod -R a+rX %{buildroot}%{_docdir}
384     chmod -R go-w %{buildroot}%{_docdir}
385     chmod -R u+w %{buildroot}%{_docdir}
386 blino 19330
387 luigiwalser 289699 # remove libtool archive
388     rm -f %{buildroot}%{_libdir}/libijs.la
389 blino 19330
390 kekepower 1220756 # Remove dangling link (mga#22919)
391     rm -f %{buildroot}%{_datadir}/%{name}/%{gsver}/doc
392    
393 luigiwalser 289699 %post
394     # Set up update-alternatives entries
395     %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
396    
397     %post X
398     # Set up update-alternatives entries
399     %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
400    
401     %post common
402     # Initialize japanese fonts
403     if test -f /usr/share/fonts/ttf/japanese/cidinst; then
404     sh /usr/share/fonts/ttf/japanese/cidinst
405     fi
406    
407     %preun
408     if [ "$1" = 0 ]; then
409     # Remove update-alternatives entry
410     %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
411     fi
412    
413     %preun X
414     if [ "$1" = 0 ]; then
415     # Remove update-alternatives entry
416     %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
417     fi
418    
419 blino 19330 %files
420     %{_bindir}/gsc
421    
422     %files X
423     %{_bindir}/gsx
424    
425     %files common
426     %dir %{_datadir}/ghostscript
427 luigiwalser 289699 %{_datadir}/ghostscript/%{gsver}
428 blino 19330 %{_mandir}/man1/*
429     %lang(de) %{_mandir}/de/man1/*
430 daviddavid 1430458 #{_bindir}/[a-c]*
431 blino 19330 %{_bindir}/[e-f]*
432     #{_bindir}/gs-common
433     %{_bindir}/gs[a-b]*
434     %{_bindir}/gs[d-n]*
435     %{_bindir}/[j-l]*
436     %{_bindir}/[n-z]*
437    
438     %files doc
439 kekepower 1220923 %doc %{_docdir}/ghostscript-doc-%{gsver}
440 blino 19330
441     %files dvipdf
442     %{_bindir}/dvipdf
443    
444     %if %{GSx11SVGAmodule}
445     %files module-X
446 blino 19364 %doc README.shared.%{_vendor}
447 luigiwalser 289699 %dir %{_libdir}/ghostscript/%{gsver}
448     %{_libdir}/ghostscript/%{gsver}/X11.so
449 blino 19330 %endif
450    
451     %files -n %{libgs}
452 ovitters 876311 %{_libdir}/libgs.so.*%{gsmajor}{,.*}
453 blino 19330
454     %files -n %{libgs_devel}
455     %{_libdir}/libgs.so
456     %{_includedir}/ghostscript
457    
458     %files -n %{libijs}
459 fwang 150967 %{_libdir}/libijs-%{ijsver}.so
460 blino 19330
461     %files -n %{libijs_devel}
462     %doc ijs/README
463     %{_libdir}/libijs.so
464     %{_libdir}/pkgconfig/ijs.pc
465     %{_includedir}/ijs
466     %{_bindir}/ijs_client_example
467     %{_bindir}/ijs_server_example

  ViewVC Help
Powered by ViewVC 1.1.28