1 |
blino |
19330 |
##### VERSION NUMBERS |
2 |
|
|
|
3 |
|
|
%define gsversion 9.00 |
4 |
|
|
%define gsextraversion %{nil} |
5 |
|
|
%define gsreleaseno 1 |
6 |
|
|
%define gsrelease %mkrel %gsreleaseno |
7 |
|
|
%define gssvnrevision -rev183 |
8 |
|
|
%define ijsver 0.35 |
9 |
|
|
%define ijsreloffset 73 |
10 |
|
|
%define ijsrelno %(echo $((%{gsreleaseno} + %{ijsreloffset}))) |
11 |
|
|
%define ijsrel %mkrel %ijsrelno |
12 |
|
|
%define ijsmajor 1 |
13 |
|
|
%define libijs %mklibname ijs %{ijsmajor} |
14 |
|
|
%define libijs_devel %mklibname -d ijs %{ijsmajor} |
15 |
|
|
%define gsmajor 9 |
16 |
|
|
%define libgs %mklibname gs %{gsmajor} |
17 |
|
|
%define libgs_devel %mklibname -d gs %{gsmajor} |
18 |
|
|
|
19 |
|
|
%define _disable_ld_no_undefined 1 |
20 |
|
|
|
21 |
|
|
##### BUILD OPTIONS |
22 |
|
|
|
23 |
|
|
%define GSx11SVGAmodule 1 |
24 |
|
|
%define withsvgalib 0 |
25 |
|
|
%define withcupsfilters 1 |
26 |
|
|
%define withstaticgs 0 |
27 |
|
|
%define debug 0 |
28 |
|
|
|
29 |
|
|
%define bootstrap 0 |
30 |
|
|
%{?_without_bootstrap: %global bootstrap 0} |
31 |
|
|
%{?_with_bootstrap: %global bootstrap 1} |
32 |
|
|
|
33 |
|
|
%if %{bootstrap} |
34 |
|
|
%global withcupsfilters 0 |
35 |
|
|
%endif |
36 |
|
|
|
37 |
|
|
##### GENERAL DEFINITIONS |
38 |
|
|
|
39 |
|
|
Summary: PostScript/PDF interpreter and renderer (Main executable) |
40 |
|
|
Name: ghostscript |
41 |
|
|
Version: %{gsversion}%{gsextraversion} |
42 |
|
|
Release: %{gsrelease} |
43 |
|
|
License: GPLv2+ |
44 |
|
|
Group: Publishing |
45 |
|
|
Requires: ghostscript-common |
46 |
|
|
Requires: update-alternatives |
47 |
|
|
Obsoletes: ghostscript-PrintOnly |
48 |
|
|
Provides: ghostscript-PrintOnly |
49 |
|
|
%if !%{GSx11SVGAmodule} |
50 |
|
|
Obsoletes: ghostscript-module-X ghostscript-module-SVGALIB |
51 |
|
|
Provides: ghostscript-module-X ghostscript-module-SVGALIB |
52 |
|
|
%endif |
53 |
|
|
%if !%{withstaticgs} |
54 |
|
|
Obsoletes: ghostscript-static |
55 |
|
|
Provides: ghostscript-static |
56 |
|
|
%endif |
57 |
|
|
Conflicts: omni < 0.4 cups <= 1.1.14 |
58 |
|
|
Conflicts: printer-filters <= 10.1 |
59 |
|
|
URL: http://www.ghostscript.com/awki/Index |
60 |
|
|
|
61 |
|
|
##### BUILDREQUIRES |
62 |
|
|
|
63 |
|
|
BuildRequires: autoconf2.5 |
64 |
|
|
BuildRequires: bison |
65 |
|
|
BuildRequires: flex |
66 |
|
|
BuildRequires: freetype2-devel |
67 |
|
|
BuildRequires: gettext-devel |
68 |
|
|
BuildRequires: glibc-devel |
69 |
|
|
%if !%{bootstrap} |
70 |
|
|
BuildRequires: gtk+2-devel |
71 |
blino |
19361 |
BuildRequires: libcups-devel |
72 |
blino |
19330 |
BuildRequires: libfontconfig-devel |
73 |
|
|
%endif |
74 |
|
|
BuildRequires: fontconfig-devel |
75 |
|
|
BuildRequires: jbig2dec-devel |
76 |
|
|
BuildRequires: libice-devel |
77 |
|
|
BuildRequires: libidn-devel |
78 |
|
|
BuildRequires: libjasper-devel |
79 |
|
|
BuildRequires: libjpeg-devel |
80 |
|
|
BuildRequires: libnetpbm-devel |
81 |
|
|
BuildRequires: libpaper-devel |
82 |
|
|
BuildRequires: libpng-devel |
83 |
|
|
BuildRequires: libsm-devel |
84 |
|
|
BuildRequires: libtiff-devel |
85 |
|
|
BuildRequires: libx11-devel |
86 |
|
|
BuildRequires: libxext-devel |
87 |
|
|
BuildRequires: libxml-devel |
88 |
|
|
BuildRequires: libxt-devel |
89 |
|
|
BuildRequires: pkgconfig |
90 |
|
|
BuildRequires: unzip |
91 |
|
|
BuildRequires: zlib-devel |
92 |
|
|
|
93 |
|
|
%ifarch %ix86 |
94 |
|
|
%if %{withsvgalib} |
95 |
|
|
BuildRequires: svgalib-devel |
96 |
|
|
%endif |
97 |
|
|
%endif |
98 |
|
|
|
99 |
|
|
##### GHOSTSCRIPT SOURCES |
100 |
|
|
|
101 |
|
|
Source0: http://ghostscript.com/releases/ghostscript-%{gsversion}%{gsextraversion}.tar.xz |
102 |
|
|
Source2: ps2pdfpress.bz2 |
103 |
|
|
Source3: http://www.linuxprinting.org/download/printing/sipixa6.upp.bz2 |
104 |
|
|
|
105 |
|
|
##### GHOSTSCRIPT PATCHES |
106 |
|
|
Patch3: ghostscript-8.64-x11_shared.patch |
107 |
|
|
Patch4: ghostscript-linkage.patch |
108 |
|
|
|
109 |
|
|
# Fedora patches |
110 |
|
|
Patch102: ghostscript-scripts.patch |
111 |
|
|
Patch105: ghostscript-runlibfileifexists.patch |
112 |
|
|
Patch106: ghostscript-system-jasper.patch |
113 |
|
|
Patch107: ghostscript-pksmraw.patch |
114 |
|
|
|
115 |
|
|
##### LIBIJS PATCHES |
116 |
|
|
|
117 |
|
|
# Fortunately none currently |
118 |
|
|
|
119 |
|
|
##### BUILD ROOT |
120 |
|
|
|
121 |
|
|
BuildRoot: %_tmppath/%name-%gsversion-%gsrelease-root |
122 |
|
|
|
123 |
|
|
##### PACKAGE DESCRIPTIONS |
124 |
|
|
|
125 |
|
|
##### GHOSTSCRIPT |
126 |
|
|
|
127 |
|
|
%package dvipdf |
128 |
|
|
Summary: PostScript/PDF interpreter and renderer (DVI-to-PDF converter) |
129 |
|
|
Group: Publishing |
130 |
|
|
Requires: ghostscript, coreutils |
131 |
|
|
Requires: tetex-dvips |
132 |
|
|
|
133 |
|
|
%package common |
134 |
|
|
Summary: PostScript/PDF interpreter and renderer (Common files) |
135 |
|
|
Group: Publishing |
136 |
|
|
Requires: urw-fonts >= 1.1, ghostscript-fonts, perl |
137 |
|
|
|
138 |
|
|
%package X |
139 |
|
|
Summary: PostScript/PDF interpreter and renderer (Executable with GTK-based screen display) |
140 |
|
|
Group: Publishing |
141 |
|
|
Requires: ghostscript-common |
142 |
|
|
Requires: update-alternatives |
143 |
|
|
# This one is buggy, so do not let it get automatically installed by |
144 |
|
|
# the "Provides: ghostscript" |
145 |
|
|
#Provides: ghostscript = %{version}-%{release} |
146 |
|
|
|
147 |
|
|
%if %withstaticgs |
148 |
|
|
%package static |
149 |
|
|
Summary: PostScript/PDF interpreter and renderer (Static executable) |
150 |
|
|
Group: Publishing |
151 |
|
|
Requires: ghostscript-common |
152 |
|
|
Requires: update-alternatives |
153 |
|
|
Provides: ghostscript = %{version}-%{release} |
154 |
|
|
%endif |
155 |
|
|
|
156 |
|
|
%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 |
|
|
Conflicts: ghostscript-X < 8.15 |
162 |
|
|
Obsoletes: ghostscript-Both |
163 |
|
|
Provides: ghostscript-Both |
164 |
|
|
|
165 |
|
|
%ifarch %ix86 |
166 |
|
|
%if %{withsvgalib} |
167 |
|
|
%package module-SVGALIB |
168 |
|
|
Summary: PostScript/PDF interpreter and renderer (Additional support for SVGALIB) |
169 |
|
|
Group: Publishing |
170 |
|
|
Requires: ghostscript, coreutils |
171 |
|
|
Obsoletes: ghostscript-SVGALIB, ghostscript-Both |
172 |
|
|
Provides: ghostscript-SVGALIB, ghostscript-Both |
173 |
|
|
%endif |
174 |
|
|
%endif |
175 |
|
|
%endif |
176 |
|
|
|
177 |
|
|
%package -n %libgs |
178 |
|
|
Summary: PostScript/PDF interpreter and renderer (GhostScript shared library) |
179 |
|
|
Group: Publishing |
180 |
|
|
|
181 |
|
|
%package -n %libgs_devel |
182 |
|
|
Summary: Headers and links to compile against the "%{libgs}" library |
183 |
|
|
Group: Development/C |
184 |
|
|
Requires: %libgs = %version |
185 |
|
|
Provides: libgs-devel |
186 |
|
|
|
187 |
|
|
##### IJS |
188 |
|
|
|
189 |
|
|
%package -n %{libijs} |
190 |
|
|
Version: %{ijsver} |
191 |
|
|
Release: %{ijsrel} |
192 |
|
|
Summary: Dynamic library for the IJS printer driver plug-in interface |
193 |
|
|
Group: Publishing |
194 |
|
|
URL: http://www.linuxprinting.org/ijs/ |
195 |
|
|
Provides: libijs = %{ijsver}-%{ijsrel} |
196 |
|
|
|
197 |
|
|
%package -n %{libijs_devel} |
198 |
|
|
Version: %{ijsver} |
199 |
|
|
Release: %{ijsrel} |
200 |
|
|
Summary: Headers and links for compiling against the "%{libijs}" library |
201 |
|
|
Group: Development/C |
202 |
|
|
URL: http://www.linuxprinting.org/ijs/ |
203 |
|
|
Requires: %{libijs} = %{ijsver} multiarch-utils |
204 |
|
|
Provides: libijs-devel = %{ijsver}-%{ijsrel} |
205 |
|
|
Provides: ijs-devel = %{ijsver}-%{ijsrel} |
206 |
|
|
|
207 |
|
|
%package doc |
208 |
|
|
Summary: Documentation for GhostScript |
209 |
|
|
Group: Publishing |
210 |
|
|
|
211 |
|
|
##### DESCRIPTION TEXTS |
212 |
|
|
|
213 |
|
|
%description |
214 |
|
|
Ghostscript is a set of software tools that provide a PostScript(TM) |
215 |
|
|
interpreter, a set of C procedures (the Ghostscript library, which |
216 |
|
|
implements the graphics capabilities in the PostScript language) and |
217 |
|
|
an interpreter for Portable Document Format (PDF) files. Ghostscript |
218 |
|
|
translates PostScript code into many common, bitmapped and vector |
219 |
|
|
formats, like those understood by your printer or screen. Ghostscript |
220 |
|
|
is normally used to display PostScript files and to print PostScript |
221 |
|
|
files to non-PostScript printers. |
222 |
|
|
|
223 |
|
|
You should install ghostscript if you need to display PostScript or |
224 |
|
|
PDF files, or if you have a non-PostScript printer. |
225 |
|
|
|
226 |
|
|
%description dvipdf |
227 |
|
|
Tool to convert the DVI format of TeX into the PDF format. There are |
228 |
|
|
more such tools (for different quality levels) in the tetex-dvipdfm |
229 |
|
|
package. All these tools use dvips of TeX to convert the DVI file to |
230 |
|
|
PostScript, then they use GhostScript to generate the PDF file. |
231 |
|
|
|
232 |
|
|
%description common |
233 |
|
|
Ghostscript is a PostScript/PDF interpreter. It can render both |
234 |
|
|
PostScript and PDF files to devices which include X window, many |
235 |
|
|
printer formats, and popular graphics file formats. |
236 |
|
|
|
237 |
|
|
This package contains the common data files needed by GhostScript. |
238 |
|
|
|
239 |
|
|
%description X |
240 |
|
|
Ghostscript is a PostScript/PDF interpreter. It can render both |
241 |
|
|
PostScript and PDF files to devices which include X window, many |
242 |
|
|
printer formats, and popular graphics file formats. |
243 |
|
|
|
244 |
|
|
This package contains a GhostScript executable with GTK-based X |
245 |
|
|
display support ("display" device, default, so it displays files by |
246 |
|
|
simply entering "gs <file>" on the command line). It makes use of the |
247 |
|
|
GhostScript shared library. |
248 |
|
|
|
249 |
|
|
%if %withstaticgs |
250 |
|
|
%description static |
251 |
|
|
Ghostscript is a PostScript/PDF interpreter. It can render both |
252 |
|
|
PostScript and PDF files to devices which include X window, many |
253 |
|
|
printer formats, and popular graphics file formats. |
254 |
|
|
|
255 |
|
|
This package contains a GhostScript executable which does not need the |
256 |
|
|
GhostScript shared library. To get simple X display support, the |
257 |
|
|
ghostscript-module-X package must be installed in addition. |
258 |
|
|
%endif |
259 |
|
|
|
260 |
|
|
%if %{GSx11SVGAmodule} |
261 |
|
|
%description module-X |
262 |
|
|
Ghostscript is a PostScript/PDF interpreter. It can render both |
263 |
|
|
PostScript and PDF files to devices which include X window, many |
264 |
|
|
printer formats, and popular graphics file formats. |
265 |
|
|
|
266 |
|
|
This package enhances Ghostscript with X window support |
267 |
|
|
|
268 |
|
|
%ifarch %ix86 |
269 |
|
|
%if %{withsvgalib} |
270 |
|
|
%description module-SVGALIB |
271 |
|
|
Ghostscript is a PostScript/PDF interpreter. It can render both |
272 |
|
|
PostScript and PDF files to devices which include X window, many |
273 |
|
|
printer formats, and popular graphics file formats. |
274 |
|
|
|
275 |
|
|
This package enhances Ghostscript with console output using SVGALIB. |
276 |
|
|
%endif |
277 |
|
|
%endif |
278 |
|
|
%endif |
279 |
|
|
|
280 |
|
|
%description -n %libgs |
281 |
|
|
This is the API library for programs which use the PostScript and/or |
282 |
|
|
PDF interpreters of GhostScript. |
283 |
|
|
|
284 |
|
|
%description -n %libgs-devel |
285 |
|
|
This package contains the static library and the header files needed |
286 |
|
|
to compile applications using the GhostScript shared library. |
287 |
|
|
|
288 |
|
|
%description -n %{libijs} |
289 |
|
|
This is the API library for programs using the IJS printer driver |
290 |
|
|
plug-in interface. Printer drivers using this interface can be added |
291 |
|
|
to GhostScript (6.53 or newer) without needing to rebuild |
292 |
|
|
GhostScript. Application programs providing an IJS interface can make |
293 |
|
|
use of IJS printer drivers directly, without needing GhostScript. |
294 |
|
|
|
295 |
|
|
%description -n %{libijs_devel} |
296 |
|
|
This package contains the static library and the header files needed |
297 |
|
|
to compile applications using the IJS library. |
298 |
|
|
|
299 |
|
|
%description doc |
300 |
|
|
This package contains documentation for GhostScript. |
301 |
|
|
|
302 |
|
|
%prep |
303 |
|
|
##### GHOSTSCRIPT |
304 |
|
|
%setup -q |
305 |
|
|
|
306 |
|
|
# prevent building and using bundled libs |
307 |
|
|
rm -rf jasper jbig2dec libpng jpeg tiff |
308 |
|
|
# rm -rf lcms <- don't work due to internal changes in the bundled lcms code |
309 |
|
|
# rm -rf freetype <- don't work for unknown reasons |
310 |
|
|
# rm -rf zlib <- don't work for unknown reasons |
311 |
|
|
|
312 |
|
|
%patch3 -p0 -b .shared |
313 |
|
|
%patch4 -p0 -b .linkage |
314 |
|
|
|
315 |
|
|
# Fedora patches |
316 |
|
|
# Fix some shell scripts |
317 |
|
|
%patch102 -p1 -b .scripts |
318 |
|
|
|
319 |
|
|
# Define .runlibfileifexists. |
320 |
|
|
%patch105 -p1 |
321 |
|
|
%patch106 -p0 -b .system-jasper |
322 |
|
|
|
323 |
|
|
# Fix pksmraw output (RH bug #308211). Still needed in 8.63. |
324 |
|
|
%patch107 -p1 -b .pksmraw |
325 |
|
|
|
326 |
|
|
# Convert manual pages to UTF-8 |
327 |
|
|
from8859_1() { |
328 |
|
|
iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_" |
329 |
|
|
mv "${1}_" "$1" |
330 |
|
|
} |
331 |
|
|
for i in man/de/*.1; do from8859_1 "$i"; done |
332 |
|
|
|
333 |
|
|
|
334 |
|
|
# Stuff for shared library support to ghostscript. |
335 |
|
|
%if %{GSx11SVGAmodule} |
336 |
|
|
|
337 |
|
|
# build a small README describing the features available. |
338 |
blino |
19364 |
cat <<EOF >README.shared.%{_vendor} |
339 |
blino |
19330 |
This version of ghostscript support shared modules dynamically loaded |
340 |
|
|
at run time. |
341 |
|
|
|
342 |
|
|
There are currently two modules compiled with the Mandriva Linux version of |
343 |
|
|
ghostscript, one to support all X11 devices (typically used by gv) and |
344 |
|
|
another to support the svgalib devices. Look at the |
345 |
|
|
ghostscript-module-??? packages. |
346 |
|
|
|
347 |
|
|
There is no configuration needed, just can add (or remove) the package |
348 |
|
|
to add (or remove) the devices concerned in ghostscript. |
349 |
|
|
EOF |
350 |
|
|
|
351 |
|
|
%endif |
352 |
|
|
|
353 |
|
|
# ps2pdfpress |
354 |
|
|
bzcat %{SOURCE2} > ps2pdfpress |
355 |
|
|
|
356 |
|
|
# UPP file for SiPix Pocket Printer A6 |
357 |
|
|
bzcat %{SOURCE3} > sipixa6.upp |
358 |
|
|
|
359 |
|
|
%build |
360 |
|
|
|
361 |
|
|
# Change compiler flags for debugging when in debug mode |
362 |
|
|
%if %debug |
363 |
|
|
export DONT_STRIP=1 |
364 |
|
|
export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" |
365 |
|
|
export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" |
366 |
|
|
export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" |
367 |
|
|
%endif |
368 |
|
|
|
369 |
|
|
##### IJS |
370 |
|
|
|
371 |
|
|
cd ijs* |
372 |
|
|
# Rebuild broken build infrastructure |
373 |
|
|
# Needed by patch4. |
374 |
|
|
./autogen.sh |
375 |
|
|
%configure2_5x --enable-shared |
376 |
|
|
%make |
377 |
|
|
cd .. |
378 |
|
|
|
379 |
|
|
##### GHOSTSCRIPT |
380 |
|
|
|
381 |
|
|
# We have a Subversion version, so we must re-generate "configure" |
382 |
|
|
./autogen.sh |
383 |
|
|
|
384 |
|
|
%configure2_5x \ |
385 |
|
|
--enable-dynamic \ |
386 |
|
|
%if !%{bootstrap} |
387 |
|
|
--enable-fontconfig \ |
388 |
|
|
%endif |
389 |
|
|
--with-drivers=ALL,opvp \ |
390 |
|
|
--with-fontpath="/usr/share/fonts/default/ghostscript:/usr/share/fonts/default/type1:/usr/share/ghostscript/fonts:/usr/share/ghostscript/%{gsversion}/Resource:/usr/share/ghostscript/Resource:/usr/share/ghostscript/CIDFont:/usr/share/fonts/ttf:/usr/share/fonts/type1:/usr/share/fonts/default/Type1" \ |
391 |
|
|
--with-ijs \ |
392 |
|
|
--with-omni \ |
393 |
|
|
--with-x |
394 |
|
|
|
395 |
|
|
# Drivers which do not compile: |
396 |
|
|
# Needs newsiop/lbp.h: nwp533 |
397 |
|
|
# Needs sys/ioccom.h: sparc |
398 |
|
|
# Needs unbdev/lpviio.h: sparc |
399 |
|
|
|
400 |
|
|
# Set documentation dir |
401 |
|
|
perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsversion}|' Makefile |
402 |
|
|
|
403 |
|
|
# Fix references to X11 libraries |
404 |
|
|
perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak |
405 |
|
|
|
406 |
|
|
# Correct paths for CJK fonts |
407 |
|
|
perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps |
408 |
|
|
perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps |
409 |
|
|
|
410 |
|
|
# Do not use "-ansi" in gcc calls |
411 |
|
|
perl -p -i -e "s:-ansi::g" Makefile |
412 |
|
|
|
413 |
|
|
# The RPM macro for make is not used here, as parallelization of the build |
414 |
|
|
# process does not work. |
415 |
|
|
%if %withstaticgs |
416 |
|
|
make |
417 |
|
|
%else |
418 |
|
|
%if %GSx11SVGAmodule |
419 |
|
|
make STDDIRS |
420 |
|
|
make obj/X11.so |
421 |
|
|
%endif |
422 |
|
|
%endif |
423 |
|
|
make so |
424 |
|
|
#make pcl3opts |
425 |
|
|
|
426 |
|
|
%install |
427 |
|
|
rm -rf %{buildroot} |
428 |
|
|
|
429 |
|
|
# Change compiler flags for debugging when in debug mode |
430 |
|
|
%if %debug |
431 |
|
|
export DONT_STRIP=1 |
432 |
|
|
export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" |
433 |
|
|
export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" |
434 |
|
|
export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" |
435 |
|
|
%endif |
436 |
|
|
|
437 |
|
|
# Make directories |
438 |
|
|
install -d %{buildroot}%{_bindir} |
439 |
|
|
install -d %{buildroot}%{_libdir} |
440 |
|
|
install -d %{buildroot}%{_includedir} |
441 |
|
|
install -d %{buildroot}%{_sysconfdir} |
442 |
|
|
install -d %{buildroot}%{_mandir}/man1 |
443 |
|
|
%if !%{bootstrap} |
444 |
|
|
install -d %{buildroot}%{_prefix}/lib/cups |
445 |
|
|
install -d %{buildroot}%{_datadir}/cups/model |
446 |
|
|
install -d %{buildroot}%{_sysconfdir}/cups |
447 |
|
|
%endif |
448 |
|
|
|
449 |
|
|
##### IJS |
450 |
|
|
cd ijs* |
451 |
|
|
%configure2_5x --enable-shared --prefix=%buildroot%{_prefix} --libdir=%buildroot%{_libdir} |
452 |
|
|
# Work around bug in "configure" script |
453 |
|
|
perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile |
454 |
|
|
perl -p -i -e 's/\@EXEEXT\@//g' Makefile |
455 |
|
|
%makeinstall |
456 |
|
|
# Fix prefixes in scripts |
457 |
|
|
perl -p -i -e "s:%buildroot::g" %buildroot%{_bindir}/ijs-config |
458 |
|
|
perl -p -i -e "s:%buildroot::g" %buildroot%{_libdir}/pkgconfig/ijs.pc |
459 |
|
|
cd .. |
460 |
|
|
|
461 |
|
|
##### GHOSTSCRIPT |
462 |
|
|
mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsversion} |
463 |
|
|
|
464 |
|
|
%if %withstaticgs |
465 |
|
|
make \ |
466 |
|
|
prefix=%{buildroot}/usr \ |
467 |
|
|
DESTDIR=%{buildroot} \ |
468 |
|
|
gssharedir=%{buildroot}%{_libdir}/ghostscript/%{gsversion} \ |
469 |
|
|
docdir=%{_docdir}/ghostscript-doc-%{gsversion} \ |
470 |
|
|
bindir=%{buildroot}%{_bindir} \ |
471 |
|
|
mandir=%{buildroot}%{_mandir} \ |
472 |
|
|
install |
473 |
|
|
%else |
474 |
|
|
%if !%{bootstrap} |
475 |
|
|
make \ |
476 |
|
|
prefix=%{_prefix} \ |
477 |
|
|
DESTDIR=%{buildroot} \ |
478 |
|
|
gssharedir=%{_libdir}/ghostscript/%{gsversion} \ |
479 |
|
|
docdir=%{_docdir}/ghostscript-doc-%{gsversion} \ |
480 |
|
|
bindir=%{_bindir} \ |
481 |
|
|
mandir=%{_mandir} \ |
482 |
|
|
install-cups |
483 |
|
|
%endif |
484 |
|
|
|
485 |
|
|
%if %GSx11SVGAmodule |
486 |
|
|
make \ |
487 |
|
|
prefix=%{_prefix} \ |
488 |
|
|
DESTDIR=%{buildroot} \ |
489 |
|
|
gssharedir=%{_libdir}/ghostscript/%{gsversion} \ |
490 |
|
|
docdir=%{_docdir}/ghostscript-doc-%{gsversion} \ |
491 |
|
|
bindir=%{_bindir} \ |
492 |
|
|
mandir=%{_mandir} \ |
493 |
|
|
install-shared |
494 |
|
|
%endif |
495 |
|
|
%endif |
496 |
|
|
|
497 |
|
|
%if 0 |
498 |
|
|
make \ |
499 |
|
|
prefix=%{_prefix} \ |
500 |
|
|
DESTDIR=%{buildroot} \ |
501 |
|
|
gssharedir=%{_libdir}/ghostscript/%{gsversion} \ |
502 |
|
|
docdir=%{_docdir}/ghostscript-doc-%{gsversion} \ |
503 |
|
|
bindir=%{_bindir} \ |
504 |
|
|
mandir=%{_mandir} \ |
505 |
|
|
man1dir=%{_mandir}/man1 \ |
506 |
|
|
pcl3-install |
507 |
|
|
%endif |
508 |
|
|
|
509 |
|
|
make \ |
510 |
|
|
prefix=%{_prefix} \ |
511 |
|
|
DESTDIR=%{buildroot} \ |
512 |
|
|
gssharedir=%{_libdir}/ghostscript/%{gsversion} \ |
513 |
|
|
docdir=%{_docdir}/ghostscript-doc-%{gsversion} \ |
514 |
|
|
bindir=%{_bindir} \ |
515 |
|
|
libdir=%{_libdir} \ |
516 |
|
|
mandir=%{_mandir} \ |
517 |
|
|
soinstall |
518 |
|
|
|
519 |
|
|
ln -sf gs.1.bz2 %{buildroot}%{_mandir}/man1/ghostscript.1.bz2 |
520 |
|
|
|
521 |
|
|
%if %withstaticgs |
522 |
|
|
mv %{buildroot}%{_bindir}/gs %{buildroot}%{_bindir}/gs-static |
523 |
|
|
%endif |
524 |
|
|
|
525 |
|
|
# ps2pdfpress |
526 |
|
|
install -m 755 ps2pdfpress %{buildroot}%{_bindir} |
527 |
|
|
|
528 |
|
|
# UPP file for SiPix Pocket Printer A6 |
529 |
|
|
install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsversion}/lib/ |
530 |
|
|
|
531 |
|
|
%if %{withcupsfilters} |
532 |
|
|
%if 0 |
533 |
|
|
# "pstoraster" wrapper script to make GhostScript being used as the |
534 |
|
|
# cups-internal RIP |
535 |
|
|
install -d %{buildroot}%{_libdir}/cups/filter |
536 |
|
|
install -m 755 pstoraster/pstoraster %{buildroot}%{_libdir}/cups/filter |
537 |
|
|
install -m 755 pstoraster/pstopxl %{buildroot}%{_libdir}/cups/filter |
538 |
|
|
install -d %{buildroot}%{_datadir}/cups/model |
539 |
|
|
install -m 755 pstoraster/*.ppd %{buildroot}%{_datadir}/cups/model |
540 |
|
|
install -d %{buildroot}%{_sysconfdir}/cups |
541 |
|
|
install -m 644 pstoraster/pstoraster.convs %{buildroot}%{_sysconfdir}/cups |
542 |
|
|
%endif |
543 |
|
|
%endif |
544 |
|
|
|
545 |
|
|
# Add backward compatibility link to not break printerdrake in Mandriva |
546 |
|
|
# 2006 and older |
547 |
|
|
ln -s %{_bindir}/gsc %{buildroot}%{_bindir}/gs-common |
548 |
|
|
ln -s %{_bindir}/gsc %{buildroot}%{_bindir}/ghostscript |
549 |
|
|
|
550 |
|
|
##### GENERAL STUFF |
551 |
|
|
|
552 |
|
|
# Correct permissions for all documentation files |
553 |
|
|
chmod -R a+rX %{buildroot}%{_docdir} |
554 |
|
|
chmod -R go-w %{buildroot}%{_docdir} |
555 |
|
|
chmod -R u+w %{buildroot}%{_docdir} |
556 |
|
|
|
557 |
|
|
##### FILES |
558 |
|
|
|
559 |
|
|
%files |
560 |
|
|
%defattr(-,root,root) |
561 |
|
|
%{_bindir}/gsc |
562 |
|
|
%{_bindir}/gs-common |
563 |
|
|
%{_bindir}/ghostscript |
564 |
|
|
|
565 |
|
|
%files X |
566 |
|
|
%defattr(-,root,root) |
567 |
|
|
%{_bindir}/gsx |
568 |
|
|
|
569 |
|
|
%if %withstaticgs |
570 |
|
|
%files static |
571 |
|
|
%defattr(-,root,root) |
572 |
|
|
%{_bindir}/gs-static |
573 |
|
|
%endif |
574 |
|
|
|
575 |
|
|
%files common |
576 |
|
|
%defattr(-,root,root) |
577 |
|
|
%dir %{_datadir}/ghostscript |
578 |
|
|
%{_datadir}/ghostscript/%{gsversion} |
579 |
|
|
#%{_datadir}/ghostscript/Resource |
580 |
|
|
#%{_datadir}/ghostscript/CIDFont |
581 |
|
|
%{_mandir}/man1/* |
582 |
|
|
%lang(de) %{_mandir}/de/man1/* |
583 |
|
|
%{_bindir}/[a-c]* |
584 |
|
|
%{_bindir}/dumphint |
585 |
|
|
%{_bindir}/[e-f]* |
586 |
|
|
#{_bindir}/gs-common |
587 |
|
|
%{_bindir}/gs[a-b]* |
588 |
|
|
%{_bindir}/gs[d-n]* |
589 |
|
|
%{_bindir}/[j-l]* |
590 |
|
|
%{_bindir}/[n-z]* |
591 |
|
|
%if %{withcupsfilters} |
592 |
|
|
# "pstoraster" wrapper script to make GhostScript being used as the |
593 |
|
|
# cups-internal RIP |
594 |
|
|
%attr(0755,root,root) %{_prefix}/lib*/cups/filter/* |
595 |
|
|
%{_datadir}/cups/model/* |
596 |
|
|
%config(noreplace) %{_sysconfdir}/cups/pstoraster.convs |
597 |
|
|
%config(noreplace) %{_sysconfdir}/cups/pdftoraster.convs |
598 |
|
|
%endif |
599 |
|
|
|
600 |
|
|
%files doc |
601 |
|
|
%defattr(-,root,root) |
602 |
|
|
%doc %{_docdir}/ghostscript-doc-%{gsversion} |
603 |
|
|
|
604 |
|
|
%files dvipdf |
605 |
|
|
%defattr(-,root,root) |
606 |
|
|
%{_bindir}/dvipdf |
607 |
|
|
|
608 |
|
|
%if %{GSx11SVGAmodule} |
609 |
|
|
%files module-X |
610 |
|
|
%defattr(-,root,root) |
611 |
blino |
19364 |
%doc README.shared.%{_vendor} |
612 |
blino |
19330 |
%dir %{_libdir}/ghostscript/%{gsversion} |
613 |
|
|
%{_libdir}/ghostscript/%{gsversion}/X11.so |
614 |
|
|
|
615 |
|
|
%ifarch %ix86 |
616 |
|
|
%if %{withsvgalib} |
617 |
|
|
%files module-SVGALIB |
618 |
|
|
%defattr(-,root,root) |
619 |
blino |
19364 |
%doc README.shared.%{_vendor} |
620 |
blino |
19330 |
%dir %{_libdir}/ghostscript/%{gsversion} |
621 |
|
|
%{_libdir}/ghostscript/%{gsversion}/lvga256.so |
622 |
|
|
%{_libdir}/ghostscript/%{gsversion}/vgalib.so |
623 |
|
|
%endif |
624 |
|
|
%endif |
625 |
|
|
%endif |
626 |
|
|
|
627 |
|
|
%files -n %{libgs} |
628 |
|
|
%defattr(-,root,root) |
629 |
|
|
%{_libdir}/libgs.so.*%{gsmajor}* |
630 |
|
|
|
631 |
|
|
%files -n %{libgs_devel} |
632 |
|
|
%defattr(-,root,root) |
633 |
|
|
%{_libdir}/libgs.so |
634 |
|
|
%{_includedir}/ghostscript |
635 |
|
|
|
636 |
|
|
%files -n %{libijs} |
637 |
|
|
%defattr(-,root,root) |
638 |
|
|
%{_libdir}/libijs*.so |
639 |
|
|
|
640 |
|
|
%files -n %{libijs_devel} |
641 |
|
|
%defattr(-,root,root) |
642 |
|
|
%doc ijs/README |
643 |
|
|
%{_libdir}/libijs.a |
644 |
|
|
%{_libdir}/libijs.la |
645 |
|
|
%{_libdir}/libijs.so |
646 |
|
|
%{_libdir}/pkgconfig/ijs.pc |
647 |
|
|
%{_includedir}/ijs |
648 |
|
|
%{_bindir}/ijs_client_example |
649 |
|
|
%{_bindir}/ijs_server_example |
650 |
|
|
%{_bindir}/ijs-config |
651 |
|
|
|
652 |
|
|
|
653 |
|
|
##### PRE/POSTINSTALL SCRIPTS |
654 |
|
|
|
655 |
|
|
%post |
656 |
|
|
# Set up update-alternatives entries |
657 |
|
|
%{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200 |
658 |
|
|
|
659 |
|
|
%post X |
660 |
|
|
# Set up update-alternatives entries |
661 |
|
|
%{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100 |
662 |
|
|
|
663 |
|
|
%if %withstaticgs |
664 |
|
|
%post static |
665 |
|
|
# Set up update-alternatives entries |
666 |
|
|
%{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gs-static 10 |
667 |
|
|
%endif |
668 |
|
|
|
669 |
|
|
%post common |
670 |
|
|
# Initialize japanese fonts |
671 |
|
|
if test -f /usr/share/fonts/ttf/japanese/cidinst; then |
672 |
|
|
sh /usr/share/fonts/ttf/japanese/cidinst |
673 |
|
|
fi |
674 |
|
|
|
675 |
|
|
%preun |
676 |
|
|
if [ "$1" = 0 ]; then |
677 |
|
|
# Remove update-alternatives entry |
678 |
|
|
%{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc |
679 |
|
|
fi |
680 |
|
|
|
681 |
|
|
%preun X |
682 |
|
|
if [ "$1" = 0 ]; then |
683 |
|
|
# Remove update-alternatives entry |
684 |
|
|
%{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx |
685 |
|
|
fi |
686 |
|
|
|
687 |
|
|
%if %withstaticgs |
688 |
|
|
%preun static |
689 |
|
|
if [ "$1" = 0 ]; then |
690 |
|
|
# Remove update-alternatives entry |
691 |
|
|
%{_sbindir}/update-alternatives --remove gs %{_bindir}/gs-static |
692 |
|
|
fi |
693 |
|
|
%endif |
694 |
|
|
|
695 |
|
|
%clean |
696 |
|
|
rm -rf %{buildroot} |
697 |
|
|
|
698 |
|
|
|