/[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 289742 - (show annotations) (download)
Sat Sep 8 00:09:37 2012 UTC (11 years, 7 months ago) by luigiwalser
File size: 15142 byte(s)
SILENT: fix ijs 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 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 withcupsfilters 1
22 %define debug 0
23 %if %{bootstrap}
24 %global withcupsfilters 0
25 %endif
26
27 Summary: PostScript/PDF interpreter and renderer (Main executable)
28 Name: ghostscript
29 Version: %{gsver}
30 Release: %mkrel %{rel}
31 License: GPLv2+
32 Group: Publishing
33 URL: http://www.ghostscript.com/awki/Index
34 Source0: http://downloads.ghostscript.com/public/ghostscript-%{gsver}.tar.bz2
35 Source2: ps2pdfpress.bz2
36 Source3: http://www.linuxprinting.org/download/printing/sipixa6.upp.bz2
37
38 Patch300: ghostscript-9.05-x11_shared.diff
39 # Fedora patches
40 # Fix ijs-config not to have multilib conflicts (bug #192672)
41 Patch1: ghostscript-multilib.patch
42 # Fix some shell scripts
43 Patch2: ghostscript-scripts.patch
44 # Build igcref.c with -O0 to work around bug #150771.
45 Patch3: ghostscript-noopt.patch
46 # Fix ./autgen.sh in ijs sub-project
47 # See http://bugs.ghostscript.com/show_bug.cgi?id=692040 for details.
48 Patch4: ghostscript-ijs-automake-ver.patch
49 # Define .runlibfileifexists.
50 Patch5: ghostscript-runlibfileifexists.patch
51 # Install CUPS filter convs files in the correct place.
52 Patch10: ghostscript-cups-filters.patch
53 # Restored Fontmap.local patch, incorrectly dropped after
54 # ghostscript-8.15.4-3 (bug #610301).
55 # Note: don't use -b here to avoid the backup file ending up in the
56 # package manifest.
57 Patch27: ghostscript-Fontmap.local.patch
58 # Don't assume %%rom%% device is available for initial ICC profile dir.
59 Patch28: ghostscript-iccprofiles-initdir.patch
60 # gdevcups: don't use uninitialized variables in debugging output.
61 Patch29: ghostscript-gdevcups-debug-uninit.patch
62
63 %if !%{bootstrap}
64 BuildRequires: gtk+2-devel
65 BuildRequires: cups-devel
66 BuildRequires: fontconfig-devel
67 %endif
68 BuildRequires: bison
69 BuildRequires: flex
70 BuildRequires: libtool
71 BuildRequires: unzip
72 BuildRequires: gettext-devel
73 BuildRequires: glibc-devel
74 BuildRequires: jbig2dec-devel
75 BuildRequires: jpeg-devel
76 BuildRequires: libpaper-devel
77 BuildRequires: netpbm-devel
78 BuildRequires: tiff-devel
79 BuildRequires: pkgconfig(freetype2)
80 BuildRequires: pkgconfig(ice)
81 BuildRequires: pkgconfig(jasper)
82 BuildRequires: pkgconfig(lcms)
83 BuildRequires: pkgconfig(libidn)
84 BuildRequires: pkgconfig(libpng15)
85 BuildRequires: pkgconfig(libxml-2.0)
86 BuildRequires: pkgconfig(sm)
87 BuildRequires: pkgconfig(x11)
88 BuildRequires: pkgconfig(xext)
89 BuildRequires: pkgconfig(xt)
90 BuildRequires: pkgconfig(zlib)
91
92 Requires: ghostscript-common
93 Requires: update-alternatives
94 %if !%{GSx11SVGAmodule}
95 %rename ghostscript-module-X ghostscript-module-SVGALIB
96 %endif
97
98 %description
99 Ghostscript is a set of software tools that provide a PostScript(TM)
100 interpreter, a set of C procedures (the Ghostscript library, which
101 implements the graphics capabilities in the PostScript language) and
102 an interpreter for Portable Document Format (PDF) files. Ghostscript
103 translates PostScript code into many common, bitmapped and vector
104 formats, like those understood by your printer or screen. Ghostscript
105 is normally used to display PostScript files and to print PostScript
106 files to non-PostScript printers.
107
108 You should install ghostscript if you need to display PostScript or
109 PDF files, or if you have a non-PostScript printer.
110
111 %package dvipdf
112 Summary: PostScript/PDF interpreter and renderer (DVI-to-PDF converter)
113 Group: Publishing
114 Requires: ghostscript
115 Requires: coreutils
116 Requires: dvips
117 Provides: dvipdf = %{version}-%{release}
118
119 %description dvipdf
120 Tool to convert the DVI format of TeX into the PDF format. There are
121 more such tools (for different quality levels) in the dvipdfm
122 package. All these tools use dvips of TeX to convert the DVI file to
123 PostScript, then they use GhostScript to generate the PDF file.
124
125 %package common
126 Summary: PostScript/PDF interpreter and renderer (Common files)
127 Group: Publishing
128 Requires: urw-fonts >= 1.1
129 Requires: ghostscript-fonts
130
131 %description common
132 Ghostscript is a PostScript/PDF interpreter. It can render both
133 PostScript and PDF files to devices which include X window, many
134 printer formats, and popular graphics file formats.
135
136 This package contains the common data files needed by GhostScript.
137
138 %package X
139 Summary: PostScript/PDF interpreter and renderer (with X11 screen display)
140 Group: Publishing
141 Requires: ghostscript-common
142 Requires: update-alternatives
143
144 %description X
145 Ghostscript is a PostScript/PDF interpreter. It can render both
146 PostScript and PDF files to devices which include X window, many
147 printer formats, and popular graphics file formats.
148
149 This package contains a GhostScript executable with GTK-based X
150 display support ("display" device, default, so it displays files by
151 simply entering "gs <file>" on the command line). It makes use of the
152 GhostScript shared library.
153
154 %if %{GSx11SVGAmodule}
155 %package module-X
156 Summary: PostScript/PDF interpreter and renderer (Additional support for X)
157 Group: Publishing
158 Requires: ghostscript-common
159
160 %description module-X
161 Ghostscript is a PostScript/PDF interpreter. It can render both
162 PostScript and PDF files to devices which include X window, many
163 printer formats, and popular graphics file formats.
164
165 This package enhances Ghostscript with X window support
166 %endif
167
168 %package -n %libgs
169 Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
170 Group: Publishing
171
172 %description -n %libgs
173 This is the API library for programs which use the PostScript and/or
174 PDF interpreters of GhostScript.
175
176 %package -n %libgs_devel
177 Summary: Headers and links to compile against the "%{libgs}" library
178 Group: Development/C
179 Requires: %libgs >= %{gsver}
180 Provides: %{name}-devel = %{gsver}
181 Provides: libgs-devel = %{gsver}
182 Obsoletes: %{_lib}gs9-devel < %{gsver}
183 Obsoletes: %{_lib}gs8-devel < %{gsver}
184
185 %description -n %libgs_devel
186 This package contains the static library and the header files needed
187 to compile applications using the GhostScript shared library.
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 %description -n %{libijs}
198 This is the API library for programs using the IJS printer driver
199 plug-in interface. Printer drivers using this interface can be added
200 to GhostScript (6.53 or newer) without needing to rebuild
201 GhostScript. Application programs providing an IJS interface can make
202 use of IJS printer drivers directly, without needing GhostScript.
203
204 %package -n %{libijs_devel}
205 Version: %{ijsver}
206 Release: %{ijsrel}
207 Summary: Headers and links for compiling against the "%{libijs}" library
208 Group: Development/C
209 URL: http://www.linuxprinting.org/ijs/
210 Requires: %{libijs} >= %{ijsver}
211 Requires: multiarch-utils
212 Provides: libijs-devel = %{ijsver}-%{ijsrel}
213 Provides: ijs-devel = %{ijsver}-%{ijsrel}
214 Obsoletes: %{_lib}ijs1-devel < %{ijsver}-%{ijsrel}
215
216 %description -n %{libijs_devel}
217 This package contains the static library and the header files needed
218 to compile applications using the IJS library.
219
220 %package doc
221 Summary: Documentation for GhostScript
222 Group: Publishing
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 pushd ijs*
277 # Rebuild broken build infrastructure
278 # Needed by patch4.
279 ./autogen.sh
280 %configure2_5x \
281 %ifarch %{ix86}
282 --disable-sse2 \
283 %endif
284 --enable-shared \
285 --disable-static
286
287 %make
288 popd
289
290 # We have a Subversion version, so we must re-generate "configure"
291 ./autogen.sh
292
293 %configure2_5x \
294 --enable-dynamic \
295 %if !%{bootstrap}
296 --enable-fontconfig \
297 %endif
298 %ifarch %{ix86}
299 --disable-sse2 \
300 %endif
301 --with-drivers=ALL,opvp \
302 --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" \
303 --with-ijs \
304 --with-omni \
305 --with-x \
306 --disable-compile-inits \
307 --with-system-libtiff \
308 --with-install-cups
309
310 # Drivers which do not compile:
311 # Needs newsiop/lbp.h: nwp533
312 # Needs sys/ioccom.h: sparc
313 # Needs unbdev/lpviio.h: sparc
314
315 # Set documentation dir
316 perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile
317
318 # Fix references to X11 libraries
319 perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak
320
321 # Correct paths for CJK fonts
322 perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
323 perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps
324
325 # Do not use "-ansi" in gcc calls
326 perl -p -i -e "s:-ansi::g" Makefile
327
328 # bork
329 perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile
330
331 # The RPM macro for make is not used here, as parallelization of the build
332 # process does not work.
333 %if %{GSx11SVGAmodule}
334 #make soobj/X11.so BUILDPREFIX=so
335 make obj/X11.so
336 %endif
337 make so
338 #make pcl3opts
339 make cups
340
341 %install
342 rm -rf %{buildroot}
343
344 # Change compiler flags for debugging when in debug mode
345 %if %debug
346 export DONT_STRIP=1
347 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
348 export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
349 export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`"
350 %endif
351
352 # Make directories
353 install -d %{buildroot}%{_bindir}
354 install -d %{buildroot}%{_libdir}
355 install -d %{buildroot}%{_includedir}
356 install -d %{buildroot}%{_sysconfdir}
357 install -d %{buildroot}%{_mandir}/man1
358 %if !%{bootstrap}
359 install -d %{buildroot}%{_prefix}/lib/cups
360 install -d %{buildroot}%{_datadir}/cups/model
361 install -d %{buildroot}%{_sysconfdir}/cups
362 %endif
363
364 pushd ijs*
365 %configure2_5x \
366 --enable-shared \
367 --prefix=%{buildroot}%{_prefix} \
368 --libdir=%{buildroot}%{_libdir}
369
370 # Work around bug in "configure" script
371 perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile
372 perl -p -i -e 's/\@EXEEXT\@//g' Makefile
373 %makeinstall
374 # Fix prefixes in scripts
375 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_bindir}/ijs-config
376 perl -p -i -e "s:%{buildroot}::g" %{buildroot}%{_libdir}/pkgconfig/ijs.pc
377 popd
378
379 ##### GHOSTSCRIPT
380 mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}
381
382 %if !%{bootstrap}
383 make \
384 prefix=%{_prefix} \
385 DESTDIR=%{buildroot} \
386 gssharedir=%{_libdir}/ghostscript/%{gsver} \
387 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
388 bindir=%{_bindir} \
389 mandir=%{_mandir} \
390 install-cups
391 %endif
392
393 make \
394 prefix=%{_prefix} \
395 DESTDIR=%{buildroot} \
396 gssharedir=%{_libdir}/ghostscript/%{gsver} \
397 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
398 bindir=%{_bindir} \
399 libdir=%{_libdir} \
400 mandir=%{_mandir} \
401 soinstall
402
403 %if %{GSx11SVGAmodule}
404 make \
405 prefix=%{_prefix} \
406 DESTDIR=%{buildroot} \
407 gssharedir=%{_libdir}/ghostscript/%{gsver} \
408 docdir=%{_docdir}/ghostscript-doc-%{gsver} \
409 bindir=%{_bindir} \
410 libdir=%{_libdir} \
411 mandir=%{_mandir} \
412 install-shared
413 %endif
414
415 ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}
416
417 # ps2pdfpress
418 install -m 755 ps2pdfpress %{buildroot}%{_bindir}
419
420 # UPP file for SiPix Pocket Printer A6
421 #mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
422 install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/
423
424 # why?
425 mv %{buildroot}%{_datadir}/cups/mime/gstoraster.convs %{buildroot}%{_sysconfdir}/cups/gstoraster.convs
426
427 # Correct permissions for all documentation files
428 chmod -R a+rX %{buildroot}%{_docdir}
429 chmod -R go-w %{buildroot}%{_docdir}
430 chmod -R u+w %{buildroot}%{_docdir}
431
432 # remove libtool archive
433 rm -f %{buildroot}%{_libdir}/libijs.la
434
435 %post
436 # Set up update-alternatives entries
437 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200
438
439 %post X
440 # Set up update-alternatives entries
441 %{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100
442
443 %post common
444 # Initialize japanese fonts
445 if test -f /usr/share/fonts/ttf/japanese/cidinst; then
446 sh /usr/share/fonts/ttf/japanese/cidinst
447 fi
448
449 %preun
450 if [ "$1" = 0 ]; then
451 # Remove update-alternatives entry
452 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
453 fi
454
455 %preun X
456 if [ "$1" = 0 ]; then
457 # Remove update-alternatives entry
458 %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
459 fi
460
461 %files
462 %{_bindir}/gsc
463
464 %files X
465 %{_bindir}/gsx
466
467 %files common
468 %dir %{_datadir}/ghostscript
469 %{_datadir}/ghostscript/%{gsver}
470 %{_mandir}/man1/*
471 %lang(de) %{_mandir}/de/man1/*
472 #%{_bindir}/[a-c]*
473 %{_bindir}/[e-f]*
474 #{_bindir}/gs-common
475 %{_bindir}/gs[a-b]*
476 %{_bindir}/gs[d-n]*
477 %{_bindir}/[j-l]*
478 %{_bindir}/[n-z]*
479 %if %{withcupsfilters}
480 # "pstoraster" wrapper script to make GhostScript being used as the
481 # cups-internal RIP
482 %attr(0755,root,root) %{_prefix}/lib*/cups/filter/*
483 %{_datadir}/cups/model/*
484 %config(noreplace) %{_sysconfdir}/cups/gstoraster.convs
485 %endif
486
487 %files doc
488 %doc %{_docdir}/ghostscript-doc-%{gsver}
489
490 %files dvipdf
491 %{_bindir}/dvipdf
492
493 %if %{GSx11SVGAmodule}
494 %files module-X
495 %doc README.shared.%{_vendor}
496 %dir %{_libdir}/ghostscript/%{gsver}
497 %{_libdir}/ghostscript/%{gsver}/X11.so
498 %endif
499
500 %files -n %{libgs}
501 %{_libdir}/libgs.so.*%{gsmajor}*
502
503 %files -n %{libgs_devel}
504 %{_libdir}/libgs.so
505 %{_includedir}/ghostscript
506
507 %files -n %{libijs}
508 %{_libdir}/libijs-%{ijsver}.so
509
510 %files -n %{libijs_devel}
511 %doc ijs/README
512 %{_libdir}/libijs.so
513 %{_libdir}/pkgconfig/ijs.pc
514 %{_includedir}/ijs
515 %{_bindir}/ijs_client_example
516 %{_bindir}/ijs_server_example
517 %{_bindir}/ijs-config
518

  ViewVC Help
Powered by ViewVC 1.1.30