/[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 2053927 - (show annotations) (download)
Tue Apr 2 12:29:45 2024 UTC (2 weeks, 3 days ago) by ns80
File size: 13896 byte(s)
- fix build with GCC14

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

  ViewVC Help
Powered by ViewVC 1.1.30