/[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 595472 - (show annotations) (download)
Sat Feb 22 03:01:16 2014 UTC (10 years, 1 month ago) by tv
File size: 14535 byte(s)
kill bundled system libraries

1 %define _disable_ld_no_undefined 1
2 %define rel 5
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 rm -rf expat freetype icclib jasper jpeg jpegxr lcms2 libpng openjpeg zlib cups/libs
230 %apply_patches
231 # Don't ship backup files
232 find . -name "*.*~" |xargs rm -f
233
234 # prevent building and using bundled libs
235 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms* freetype
236
237 # Convert manual pages to UTF-8
238 from8859_1() {
239 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
240 mv "${1}_" "$1"
241 }
242 for i in man/de/*.1; do from8859_1 "$i"; done
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
269 # Change compiler flags for debugging when in debug mode
270 %if %debug
271 export DONT_STRIP=1
272 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
273 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
274 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
275 %endif
276
277 # We have a Subversion version, so we must re-generate "configure"
278 ./autogen.sh
279
280 %configure2_5x \
281 --enable-dynamic \
282 %if !%{bootstrap}
283 --enable-fontconfig \
284 %endif
285 %ifarch %{ix86}
286 --disable-sse2 \
287 %endif
288 --with-drivers=ALL,opvp \
289 --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" \
290 --with-ijs \
291 --with-x \
292 --disable-compile-inits \
293 --with-system-libtiff \
294
295 # Build IJS
296 pushd ijs
297 ./autogen.sh
298 %configure2_5x \
299 %ifarch %{ix86}
300 --disable-sse2 \
301 %endif
302 --enable-shared \
303 --disable-static
304
305 %make
306 popd
307
308 # Set documentation dir
309 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
310
311 # Fix references to X11 libraries
312 perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
313
314 # Correct paths for CJK fonts
315 perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
316 perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
317
318 # bork
319 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
320
321 # The RPM macro for make is not used here, as parallelization of the build
322 # process does not work.
323 %if %{GSx11SVGAmodule}
324 make obj/X11.so
325 %endif
326 make so
327
328 %install
329 # Change compiler flags for debugging when in debug mode
330 %if %debug
331 export DONT_STRIP=1
332 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
333 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
334 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
335 %endif
336
337 # Make directories
338 install -d %{buildroot}%{_bindir}
339 install -d %{buildroot}%{_libdir}
340 install -d %{buildroot}%{_includedir}
341 install -d %{buildroot}%{_sysconfdir}
342 install -d %{buildroot}%{_mandir}/man1
343 %if !%{bootstrap}
344 install -d %{buildroot}%{_prefix}/lib/cups
345 install -d %{buildroot}%{_datadir}/cups/model
346 install -d %{buildroot}%{_sysconfdir}/cups
347 %endif
348
349 pushd ijs*
350 %configure2_5x \
351 --enable-shared \
352 --prefix=%{buildroot}%{_prefix} \
353 --libdir=%{buildroot}%{_libdir}
354
355 # Work around bug in "configure" script
356 perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
357 perl -p -i -e 's/\@EXEEXT\@//g' Makefile
358 %makeinstall
359 # Fix prefixes in scripts
360 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
361 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
362 popd
363
364 ##### GHOSTSCRIPT
365 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
366
367 %if !%{bootstrap}
368 make \
369 prefix=%{_prefix} \
370 DESTDIR=%{buildroot} \
371 gssharedir=%{_libdir}/ghostscript/%{gsver} \
372 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
373 bindir=%{_bindir} \
374 mandir=%{_mandir} \
375 %endif
376
377 make \
378 prefix=%{_prefix} \
379 DESTDIR=%{buildroot} \
380 gssharedir=%{_libdir}/ghostscript/%{gsver} \
381 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
382 bindir=%{_bindir} \
383 libdir=%{_libdir} \
384 mandir=%{_mandir} \
385 soinstall
386
387 %if %{GSx11SVGAmodule}
388 make \
389 prefix=%{_prefix} \
390 DESTDIR=%{buildroot} \
391 gssharedir=%{_libdir}/ghostscript/%{gsver} \
392 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
393 bindir=%{_bindir} \
394 libdir=%{_libdir} \
395 mandir=%{_mandir} \
396 install-shared
397 %endif
398
399 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
400
401 # ps2pdfpress
402 install -m 755 ps2pdfpress %{buildroot}%{_bindir}
403
404 # UPP file for SiPix Pocket Printer A6
405 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
406 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
407
408 # Correct permissions for all documentation files
409 chmod -R a+rX %{buildroot}%{_docdir}
410 chmod -R go-w %{buildroot}%{_docdir}
411 chmod -R u+w %{buildroot}%{_docdir}
412
413 # remove libtool archive
414 rm -f %{buildroot}%{_libdir}/libijs.la
415
416 %post
417 # Set up update-alternatives entries
418 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
419
420 %post X
421 # Set up update-alternatives entries
422 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
423
424 %post common
425 # Initialize japanese fonts
426 if test -f /usr/share/fonts/ttf/japanese/cidinst; then
427 sh /usr/share/fonts/ttf/japanese/cidinst
428 fi
429
430 %preun
431 if [ "$1" = 0 ]; then
432 # Remove update-alternatives entry
433 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
434 fi
435
436 %preun X
437 if [ "$1" = 0 ]; then
438 # Remove update-alternatives entry
439 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
440 fi
441
442 %files
443 %{_bindir}/gsc
444
445 %files X
446 %{_bindir}/gsx
447
448 %files common
449 %dir %{_datadir}/ghostscript
450 %{_datadir}/ghostscript/%{gsver}
451 %{_mandir}/man1/*
452 %lang(de) %{_mandir}/de/man1/*
453 #%{_bindir}/[a-c]*
454 %{_bindir}/[e-f]*
455 #{_bindir}/gs-common
456 %{_bindir}/gs[a-b]*
457 %{_bindir}/gs[d-n]*
458 %{_bindir}/[j-l]*
459 %{_bindir}/[n-z]*
460
461 %files doc
462 %doc %{_docdir}/ghostscript-doc-%{gsver}
463
464 %files dvipdf
465 %{_bindir}/dvipdf
466
467 %if %{GSx11SVGAmodule}
468 %files module-X
469 %doc README.shared.%{_vendor}
470 %dir %{_libdir}/ghostscript/%{gsver}
471 %{_libdir}/ghostscript/%{gsver}/X11.so
472 %endif
473
474 %files -n %{libgs}
475 %{_libdir}/libgs.so.*%{gsmajor}*
476
477 %files -n %{libgs_devel}
478 %{_libdir}/libgs.so
479 %{_includedir}/ghostscript
480
481 %files -n %{libijs}
482 %{_libdir}/libijs-%{ijsver}.so
483
484 %files -n %{libijs_devel}
485 %doc ijs/README
486 %{_libdir}/libijs.so
487 %{_libdir}/pkgconfig/ijs.pc
488 %{_includedir}/ijs
489 %{_bindir}/ijs_client_example
490 %{_bindir}/ijs_server_example
491 %{_bindir}/ijs-config

  ViewVC Help
Powered by ViewVC 1.1.30