/[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 289700 - (show annotations) (download)
Fri Sep 7 23:52:53 2012 UTC (11 years, 7 months ago) by luigiwalser
File size: 15106 byte(s)
SILENT: fix release tag
1 %define _disable_ld_no_undefined 1
2 %define rel 1
3
4 %define gsver 9.06
5 %define ijsver 0.35
6 %define ijsreloffset 84
7 %define ijsrel %(echo $((%{rel} + %{ijsreloffset})))
8
9 %define ijsmajor 1
10 %define libijs %mklibname ijs %{ijsmajor}
11 %define libijs_devel %mklibname -d ijs
12
13 %define gsmajor 9
14 %define libgs %mklibname gs %{gsmajor}
15 %define libgs_devel %mklibname -d gs
16
17 %define bootstrap 0
18
19 %define GSx11SVGAmodule 1
20 %define withcupsfilters 1
21 %define debug 0
22 %if %{bootstrap}
23 %global withcupsfilters 0
24 %endif
25
26 Summary: PostScript/PDF interpreter and renderer (Main executable)
27 Name: ghostscript
28 Version: %{gsver}
29 Release: %mkrel %{rel}
30 License: GPLv2+
31 Group: Publishing
32 URL: http://www.ghostscript.com/awki/Index
33 Source0: http://downloads.ghostscript.com/public/ghostscript-%{gsver}.tar.bz2
34 Source2: ps2pdfpress.bz2
35 Source3: http://www.linuxprinting.org/download/printing/sipixa6.upp.bz2
36
37 Patch300: ghostscript-9.05-x11_shared.diff
38 # Fedora patches
39 # Fix ijs-config not to have multilib conflicts (bug #192672)
40 Patch1: ghostscript-multilib.patch
41 # Fix some shell scripts
42 Patch2: ghostscript-scripts.patch
43 # Build igcref.c with -O0 to work around bug #150771.
44 Patch3: ghostscript-noopt.patch
45 # Fix ./autgen.sh in ijs sub-project
46 # See http://bugs.ghostscript.com/show_bug.cgi?id=692040 for details.
47 Patch4: ghostscript-ijs-automake-ver.patch
48 # Define .runlibfileifexists.
49 Patch5: ghostscript-runlibfileifexists.patch
50 # Install CUPS filter convs files in the correct place.
51 Patch10: ghostscript-cups-filters.patch
52 # Restored Fontmap.local patch, incorrectly dropped after
53 # ghostscript-8.15.4-3 (bug #610301).
54 # Note: don't use -b here to avoid the backup file ending up in the
55 # package manifest.
56 Patch27: ghostscript-Fontmap.local.patch
57 # Don't assume %%rom%% device is available for initial ICC profile dir.
58 Patch28: ghostscript-iccprofiles-initdir.patch
59 # gdevcups: don't use uninitialized variables in debugging output.
60 Patch29: ghostscript-gdevcups-debug-uninit.patch
61
62 %if !%{bootstrap}
63 BuildRequires: gtk+2-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(lcms)
82 BuildRequires: pkgconfig(libidn)
83 BuildRequires: pkgconfig(libpng15)
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
223 %description doc
224 This package contains documentation for GhostScript.
225
226 %prep
227 %setup -q
228 %apply_patches
229 # Don't ship backup files
230 find . -name "*.*~" |xargs rm -f
231
232 # prevent building and using bundled libs
233 rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms freetype
234
235 # Convert manual pages to UTF-8
236 from8859_1() {
237 iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
238 mv "${1}_" "$1"
239 }
240 for i in man/de/*.1; do from8859_1 "$i"; done
241
242 # Stuff for shared library support to ghostscript.
243 %if %{GSx11SVGAmodule}
244 # build a small README describing the features available.
245 cat <<EOF >README.shared.%{_vendor}
246 This version of ghostscript support shared modules dynamically loaded
247 at run time.
248
249 There are currently two modules compiled with the %{distribution} version of
250 ghostscript, one to support all X11 devices (typically used by gv) and
251 another to support the svgalib devices. Look at the
252 ghostscript-module-??? packages.
253
254 There is no configuration needed, just can add (or remove) the package
255 to add (or remove) the devices concerned in ghostscript.
256 EOF
257 %endif
258
259 # ps2pdfpress
260 bzcat %{SOURCE2} > ps2pdfpress
261
262 # UPP file for SiPix Pocket Printer A6
263 bzcat %{SOURCE3} > sipixa6.upp
264
265 %build
266
267 # Change compiler flags for debugging when in debug mode
268 %if %debug
269 export DONT_STRIP=1
270 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
271 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
272 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
273 %endif
274
275 pushd ijs*
276 # Rebuild broken build infrastructure
277 # Needed by patch4.
278 ./autogen.sh
279 %configure2_5x \
280 %ifarch %{ix86}
281 --disable-sse2 \
282 %endif
283 --enable-shared \
284 --disable-static
285
286 %make
287 popd
288
289 # We have a Subversion version, so we must re-generate "configure"
290 ./autogen.sh
291
292 %configure2_5x \
293 --enable-dynamic \
294 %if !%{bootstrap}
295 --enable-fontconfig \
296 %endif
297 %ifarch %{ix86}
298 --disable-sse2 \
299 %endif
300 --with-drivers=ALL,opvp \
301 --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" \
302 --with-ijs \
303 --with-omni \
304 --with-x \
305 --disable-compile-inits \
306 --with-system-libtiff \
307 --with-install-cups
308
309 # Drivers which do not compile:
310 # Needs newsiop/lbp.h: nwp533
311 # Needs sys/ioccom.h: sparc
312 # Needs unbdev/lpviio.h: sparc
313
314 # Set documentation dir
315 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
316
317 # Fix references to X11 libraries
318 perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
319
320 # Correct paths for CJK fonts
321 perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
322 perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
323
324 # Do not use "-ansi" in gcc calls
325 perl -p -i -e "s:-ansi::g" Makefile
326
327 # bork
328 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
329
330 # The RPM macro for make is not used here, as parallelization of the build
331 # process does not work.
332 %if %{GSx11SVGAmodule}
333 #make soobj/X11.so BUILDPREFIX=so
334 make obj/X11.so
335 %endif
336 make so
337 #make pcl3opts
338 make cups
339
340 %install
341 rm -rf %{buildroot}
342
343 # Change compiler flags for debugging when in debug mode
344 %if %debug
345 export DONT_STRIP=1
346 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
347 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
348 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
349 %endif
350
351 # Make directories
352 install -d %{buildroot}%{_bindir}
353 install -d %{buildroot}%{_libdir}
354 install -d %{buildroot}%{_includedir}
355 install -d %{buildroot}%{_sysconfdir}
356 install -d %{buildroot}%{_mandir}/man1
357 %if !%{bootstrap}
358 install -d %{buildroot}%{_prefix}/lib/cups
359 install -d %{buildroot}%{_datadir}/cups/model
360 install -d %{buildroot}%{_sysconfdir}/cups
361 %endif
362
363 pushd ijs*
364 %configure2_5x \
365 --enable-shared \
366 --prefix=%{buildroot}%{_prefix} \
367 --libdir=%{buildroot}%{_libdir}
368
369 # Work around bug in "configure" script
370 perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
371 perl -p -i -e 's/\@EXEEXT\@//g' Makefile
372 %makeinstall
373 # Fix prefixes in scripts
374 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
375 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
376 popd
377
378 ##### GHOSTSCRIPT
379 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
380
381 %if !%{bootstrap}
382 make \
383 prefix=%{_prefix} \
384 DESTDIR=%{buildroot} \
385 gssharedir=%{_libdir}/ghostscript/%{gsver} \
386 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
387 bindir=%{_bindir} \
388 mandir=%{_mandir} \
389 install-cups
390 %endif
391
392 make \
393 prefix=%{_prefix} \
394 DESTDIR=%{buildroot} \
395 gssharedir=%{_libdir}/ghostscript/%{gsver} \
396 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
397 bindir=%{_bindir} \
398 libdir=%{_libdir} \
399 mandir=%{_mandir} \
400 soinstall
401
402 %if %{GSx11SVGAmodule}
403 make \
404 prefix=%{_prefix} \
405 DESTDIR=%{buildroot} \
406 gssharedir=%{_libdir}/ghostscript/%{gsver} \
407 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
408 bindir=%{_bindir} \
409 libdir=%{_libdir} \
410 mandir=%{_mandir} \
411 install-shared
412 %endif
413
414 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
415
416 # ps2pdfpress
417 install -m 755 ps2pdfpress %{buildroot}%{_bindir}
418
419 # UPP file for SiPix Pocket Printer A6
420 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
421 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
422
423 # why?
424 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
425
426 # Correct permissions for all documentation files
427 chmod -R a+rX %{buildroot}%{_docdir}
428 chmod -R go-w %{buildroot}%{_docdir}
429 chmod -R u+w %{buildroot}%{_docdir}
430
431 # remove libtool archive
432 rm -f %{buildroot}%{_libdir}/libijs.la
433
434 %post
435 # Set up update-alternatives entries
436 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
437
438 %post X
439 # Set up update-alternatives entries
440 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
441
442 %post common
443 # Initialize japanese fonts
444 if test -f /usr/share/fonts/ttf/japanese/cidinst; then
445 sh /usr/share/fonts/ttf/japanese/cidinst
446 fi
447
448 %preun
449 if [ "$1" = 0 ]; then
450 # Remove update-alternatives entry
451 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
452 fi
453
454 %preun X
455 if [ "$1" = 0 ]; then
456 # Remove update-alternatives entry
457 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
458 fi
459
460 %files
461 %{_bindir}/gsc
462
463 %files X
464 %{_bindir}/gsx
465
466 %files common
467 %dir %{_datadir}/ghostscript
468 %{_datadir}/ghostscript/%{gsver}
469 %{_mandir}/man1/*
470 %lang(de) %{_mandir}/de/man1/*
471 #%{_bindir}/[a-c]*
472 %{_bindir}/[e-f]*
473 #{_bindir}/gs-common
474 %{_bindir}/gs[a-b]*
475 %{_bindir}/gs[d-n]*
476 %{_bindir}/[j-l]*
477 %{_bindir}/[n-z]*
478 %if %{withcupsfilters}
479 # "pstoraster" wrapper script to make GhostScript being used as the
480 # cups-internal RIP
481 %attr(0755,root,root) %{_prefix}/lib*/cups/filter/*
482 %{_datadir}/cups/model/*
483 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
484 %endif
485
486 %files doc
487 %doc %{_docdir}/ghostscript-doc-%{gsver}
488
489 %files dvipdf
490 %{_bindir}/dvipdf
491
492 %if %{GSx11SVGAmodule}
493 %files module-X
494 %doc README.shared.%{_vendor}
495 %dir %{_libdir}/ghostscript/%{gsver}
496 %{_libdir}/ghostscript/%{gsver}/X11.so
497 %endif
498
499 %files -n %{libgs}
500 %{_libdir}/libgs.so.*%{gsmajor}*
501
502 %files -n %{libgs_devel}
503 %{_libdir}/libgs.so
504 %{_includedir}/ghostscript
505
506 %files -n %{libijs}
507 %{_libdir}/libijs-%{ijsver}.so
508
509 %files -n %{libijs_devel}
510 %doc ijs/README
511 %{_libdir}/libijs.so
512 %{_libdir}/pkgconfig/ijs.pc
513 %{_includedir}/ijs
514 %{_bindir}/ijs_client_example
515 %{_bindir}/ijs_server_example
516 %{_bindir}/ijs-config
517

  ViewVC Help
Powered by ViewVC 1.1.30