/[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 595439 - (show annotations) (download)
Sat Feb 22 02:03:50 2014 UTC (10 years, 2 months ago) by tv
File size: 14450 byte(s)
drop unused withcupsfilters (which cannot work anymore anyway...)

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

  ViewVC Help
Powered by ViewVC 1.1.30