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