##### VERSION NUMBERS %define gsversion 8.15 %define gsextraversion .1 %define gsrelease 22.1.102mdk %define gssvnrevision -rev127 %define ijsver 0.35 %define ijsreloffset 0 %define ijsrel %(R=%{gsrelease}; echo $((${R/.1.102mdk/} + %{ijsreloffset}))).1.102mdk %define ijsmajor 1 %define libijs %mklibname ijs %{ijsmajor} ##### BUILD OPTIONS %define GSx11SVGAmodule 1 %define withsvgalib 0 %define withcupsfilters 1 %define debug 0 ##### RPM PROBLEM WORKAROUNDS # Suppress automatically generated Requires for Perl libraries. #define _requires_exceptions perl\(.*\) #define _unpackaged_files_terminate_build 0 #define _missing_doc_files_terminate_build 0 ##### GENERAL DEFINITIONS Summary: PostScript/PDF interpreter and renderer Name: ghostscript Version: %{gsversion} Release: %{gsrelease} License: GPL Group: Publishing Requires: urw-fonts >= 1.1, ghostscript-fonts, perl Obsoletes: ghostscript-PrintOnly Provides: ghostscript-PrintOnly %if !%{GSx11SVGAmodule} Obsoletes: ghostscript-module-X ghostscript-module-SVGALIB Provides: ghostscript-module-X ghostscript-module-SVGALIB %endif Conflicts: omni < 0.4 cups <= 1.1.14 Conflicts: printer-filters <= 10.1 URL: http://www.cups.org/espgs/index.php ##### BUILDREQUIRES BuildRequires: autoconf2.5, libtiff-devel, glib-devel BuildRequires: bison, flex, freetype-devel, gettext-devel, libnetpbm-devel BuildRequires: libpng-devel, tetex-dvips, libxml-devel BuildRequires: libcups-devel >= 1.1.18, unzip, freetype-devel BuildRequires: XFree86-devel %ifarch %ix86 %if %{withsvgalib} BuildRequires: svgalib-devel %endif %endif ##### GHOSTSCRIPT SOURCES Source0: ftp://ftp2.easysw.com/pub/ghostscript/espgs-%{gsversion}%{gsextraversion}%{gssvnrevision}.tar.bz2 #Source0: ftp://ftp2.easysw.com/pub/ghostscript/espgs-%{gsversion}%{gsextraversion}%{gssvnrevision}-source.tar.bz2 Source1: ftp://ftp.uu.net/graphics/jpeg/jpegsrc.v6b.tar.bz2 Source2: ps2pdfpress.bz2 ##### GHOSTSCRIPT PATCHES # Fortunately none currently ##### LIBIJS PATCHES # Fortunately none currently ##### BUILD ROOT BuildRoot: %_tmppath/%name-%gsversion-%gsrelease-root ##### PACKAGE DESCRIPTIONS ##### GHOSTSCRIPT %if %{GSx11SVGAmodule} %package -n ghostscript-module-X Version: %{gsversion} Release: %{gsrelease} Summary: PostScript interpreter and renderer (additional support for X) Group: Publishing PreReq: ghostscript, fileutils Obsoletes: ghostscript-X, ghostscript-Both Provides: ghostscript-X, ghostscript-Both %ifarch %ix86 %if %{withsvgalib} %package -n ghostscript-module-SVGALIB Version: %{gsversion} Release: %{gsrelease} Summary: PostScript interpreter and renderer (additional support for SVGALIB) Group: Publishing PreReq: ghostscript, fileutils Obsoletes: ghostscript-SVGALIB, ghostscript-Both Provides: ghostscript-SVGALIB, ghostscript-Both %endif %endif %endif ##### IJS %package -n %{libijs} Version: %{ijsver} Release: %{ijsrel} Summary: Dynamic library for the IJS printer driver plug-in interface Group: Publishing URL: http://www.linuxprinting.org/ijs/ Provides: libijs = %{ijsver}-%{ijsrel} %package -n %{libijs}-devel Version: %{ijsver} Release: %{ijsrel} Summary: Headers and links for compiling against Group: Development/C URL: http://www.linuxprinting.org/ijs/ Requires: %{libijs} = %{ijsver} multiarch-utils Provides: libijs-devel = %{ijsver}-%{ijsrel} Provides: ijs-devel = %{ijsver}-%{ijsrel} ##### DESCRIPTION TEXTS %description Ghostscript is a set of software that provides a PostScript(TM) interpreter, a set of C procedures (the Ghostscript library, which implements the graphics capabilities in the PostScript language) and an interpreter for Portable Document Format (PDF) files. Ghostscript translates PostScript code into many common, bitmapped formats, like those understood by your printer or screen. Ghostscript is normally used to display PostScript files and to print PostScript files to non-PostScript printers. Most applications use PostScript for printer output. You should install ghostscript if you need to display PostScript files, or if you have a non-PostScript printer. %if %{GSx11SVGAmodule} %description module-X Ghostscript is a PostScript interpreter. It can render both PostScript and PDF compliant files to devices which include an X window, many printer formats (including support for colour printers), and popular graphics file formats. This package enhances Ghostscript with X windows support. %ifarch %ix86 %if %{withsvgalib} %description module-SVGALIB Ghostscript is a PostScript interpreter. It can render both PostScript and PDF compliant files to devices which include many printer formats (including support for colour printers), and popular graphics file formats. This package enhances Ghostscript with console output using SVGALIB. %endif %endif %endif %description -n %{libijs} This is the API library for programs using the IJS printer driver plug-in interface. Printer drivers using this interface can be added to GhostScript (6.53 or newer) without needing to rebuild GhostScript. Application programs providing an IJS interface can make use of IJS printer drivers directly, without needing GhostScript. %description -n %{libijs}-devel This package contains the static library and the header files needed to compile applications using this library. %prep # remove old directory rm -rf $RPM_BUILD_DIR/espgs ##### GHOSTSCRIPT %setup -q -n espgs # # unpack jpeg %setup -q -T -D -a 1 -n espgs # For GhostScript, rename jpeg subdirectory mv jpeg-6b jpeg # Stuff for shared library support to ghostscript. %if %{GSx11SVGAmodule} # build a small README describing the features available. cat <<EOF >README.shared.mandrivalinux This version of ghostscript support shared modules dynamically loaded at run time. There are currently two modules compiled with the Mandriva Linux version of ghostscript, one to support all X11 devices (typically used by gv) and another to support the svgalib devices. Look at the ghostscript-module-??? packages. There is no configuration needed, just can add (or remove) the package to add (or remove) the devices concerned in ghostscript. EOF %endif # ps2pdfpress bzcat %{SOURCE2} > ps2pdfpress %build # Change compiler flags for debugging when in debug mode %if %debug export DONT_STRIP=1 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" %endif ##### IJS cd ijs* # Rebuild broken build infrastructure ./autogen.sh %configure --enable-shared %make cd .. ##### GHOSTSCRIPT # We have a Subversion version, so we must re-generate "configure" ./autogen.sh %configure --enable-dynamic --with-ijs --with-cups --with-omni --with-x --with-drivers=ALL,opvp --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" # Drivers which do not compile: # Needs newsiop/lbp.h: nwp533 # Needs sys/ioccom.h: sparc # Needs unbdev/lpviio.h: sparc # Set documentation dir perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-%{gsversion}|' Makefile # Fix references to X11 libraries perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile src/*.mak # Correct paths for CJK fonts perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" lib/gs_res.ps perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" lib/gs_res.ps # Do not use "-ansi" in gcc calls perl -p -i -e "s:-ansi::g" Makefile # The RPM macro for make is not used here, as parallelization of the build # process does not work. make make pcl3opts %install rm -rf %{buildroot} # Change compiler flags for debugging when in debug mode %if %debug export DONT_STRIP=1 export CFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" export CXXFLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" export RPM_OPT_FLAGS="`echo %optflags |sed -e 's/-O3/-g/' |sed -e 's/-O2/-g/'`" %endif # Make directories install -d %{buildroot}%{_bindir} install -d %{buildroot}%{_libdir} install -d %{buildroot}%{_includedir} install -d %{buildroot}%{_sysconfdir} install -d %{buildroot}%{_mandir}/man1 ##### IJS cd ijs* ./configure --enable-shared --prefix=%buildroot%{_prefix} --libdir=%buildroot%{_libdir} # Work around bug in "configure" script perl -p -i -e 's/\@OBJEXT\@/o/g' Makefile perl -p -i -e 's/\@EXEEXT\@//g' Makefile %makeinstall # Fix prefixes in scripts perl -p -i -e "s:%buildroot::g" %buildroot%{_bindir}/ijs-config perl -p -i -e "s:%buildroot::g" %buildroot%{_libdir}/pkgconfig/ijs.pc cd .. ##### GHOSTSCRIPT mkdir -p %{buildroot}%{_docdir} mkdir -p %{buildroot}%{_docdir}/ghostscript-%{gsversion} mkdir -p %{buildroot}%{_libdir}/ghostscript/%{gsversion} make prefix=%{buildroot}/usr install_prefix=%{buildroot} gssharedir=%{buildroot}%{_libdir}/ghostscript/%{gsversion} docdir=%{_docdir}/ghostscript-%{gsversion} bindir=%{buildroot}%{_bindir} mandir=%{buildroot}%{_mandir} install make prefix=%{buildroot}/usr install_prefix=%{buildroot} gssharedir=%{buildroot}%{_libdir}/ghostscript/%{gsversion} docdir=%{_docdir}/ghostscript-%{gsversion} bindir=%{_bindir} mandir=%{buildroot}%{_mandir} man1dir=%{_mandir}/man1 pcl3-install ln -sf gs.1.bz2 %{buildroot}%{_mandir}/man1/ghostscript.1.bz2 mv %{buildroot}%{_bindir}/gs %{buildroot}%{_bindir}/gs-common # ps2pdfpress install -m 755 ps2pdfpress %{buildroot}%{_bindir} %if %{withcupsfilters} %if 0 # "pstoraster" wrapper script to make GhostScript being used as the # cups-internal RIP install -d %{buildroot}%{_libdir}/cups/filter install -m 755 pstoraster/pstoraster %{buildroot}%{_libdir}/cups/filter install -m 755 pstoraster/pstopxl %{buildroot}%{_libdir}/cups/filter install -d %{buildroot}%{_datadir}/cups/model install -m 755 pstoraster/*.ppd %{buildroot}%{_datadir}/cups/model install -d %{buildroot}%{_sysconfdir}/cups install -m 644 pstoraster/pstoraster.convs %{buildroot}%{_sysconfdir}/cups %endif %endif ##### GENERAL STUFF # Correct permissions for all documentation files chmod -R a+rX %{buildroot}%{_docdir} chmod -R go-w %{buildroot}%{_docdir} chmod -R u+w %{buildroot}%{_docdir} ##### FILES %files %defattr(-,root,root) %docdir %{_docdir}/ghostscript-%{gsversion} %{_docdir}/ghostscript-%{gsversion} %dir %{_datadir}/ghostscript %{_datadir}/ghostscript/%{gsversion} #%{_datadir}/ghostscript/Resource #%{_datadir}/ghostscript/CIDFont %{_mandir}/man1/* %{_mandir}/de/man1/* %{_bindir}/[a-h]* %{_bindir}/[j-l]* %{_bindir}/[n-z]* %if %{withcupsfilters} # "pstoraster" wrapper script to make GhostScript being used as the # cups-internal RIP %attr(0755,root,root) %{_libdir}/cups/filter/* %{_datadir}/cups/model/* %config(noreplace) %{_sysconfdir}/cups/pstoraster.convs %endif %if %{GSx11SVGAmodule} %files module-X %defattr(-,root,root) %doc README.shared.mandrivalinux %dir %{_libdir}/ghostscript/%{gsversion} %{_libdir}/ghostscript/%{gsversion}/X11.so %ifarch %ix86 %if %{withsvgalib} %files module-SVGALIB %defattr(-,root,root) %doc README.shared.mandrivalinux %dir %{_libdir}/ghostscript/%{gsversion} %{_libdir}/ghostscript/%{gsversion}/lvga256.so %{_libdir}/ghostscript/%{gsversion}/vgalib.so %endif %endif %endif %files -n %{libijs} %defattr(-,root,root) %{_libdir}/libijs.so.* %files -n %{libijs}-devel %defattr(-,root,root) %doc ijs/README %{_libdir}/libijs.a %{_libdir}/libijs.la %{_libdir}/libijs.so %{_libdir}/pkgconfig/ijs.pc %{_includedir}/ijs %{_bindir}/ijs_client_example %{_bindir}/ijs_server_example %{_bindir}/ijs-config ##### PRE/POSTINSTALL SCRIPTS %post -n %{libijs} -p /sbin/ldconfig %post # Set links for executable /bin/ln -sf %{_bindir}/gs-common %{_bindir}/gs /bin/ln -sf %{_bindir}/gs-common %{_bindir}/ghostscript # Initialize japanese fonts if test -f /usr/share/fonts/ttf/japanese/cidinst; then sh /usr/share/fonts/ttf/japanese/cidinst fi %postun -n %{libijs} -p /sbin/ldconfig %postun if [ "$1" -eq "0" ]; then # On removal rm -f %{_bindir}/gs %{_bindir}/ghostscript fi ##### CLEAN UP %clean rm -rf %{buildroot} %changelog * Fri Sep 30 2005 Vincent Danen <vdanen@mandriva.com> 8.15-22.1.102mdk - build for updates * Fri Sep 23 2005 Till Kamppeter <till@mandriva.com> 8.15-22mdk - Updated to subversion revision 127 (Release 8.15.1 plus assorted fixes from Werner Fink from SuSE: Several segfaults, color model adaptations to GS 8.15 in some drivers, vertical japanese text fix, applied patches 0, 100, and 101 upstream). - Removed patches 0, 100, and 101 (merged upstream). Now we have the first patch-free GhostScript package in a Linux distribution! - There was still a Mandrake inside, Mandrivized it. * Tue Aug 16 2005 Till Kamppeter <till@mandriva.com> 8.15-21mdk - Updated to subversion revision 119 (Fixed bugs in the "pxlmono" and "pxlcolor" drivers, once on the Legal paper size definition, and second a missing PJL command telling whether the job is grayscale or color). * Sat Aug 13 2005 Till Kamppeter <till@mandriva.com> 8.15-20mdk - Updated to subversion revision 118 (Fixed a FreeType bug on 64-bit platforms, STR 1235; fixed multiple media selection bugs, STR 1172, STR 1204, Foomatic bug 1222120 on Sourceforge; merged in fixes from GPL GhostScript repository). * Fri Jul 15 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-19mdk - Updated to subversion revision 106 (Fixed GhostScript crashing with some PostScript files on 64-bit platforms, STR 1168, bug 16694). * Wed Jun 15 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-18mdk - Updated to subversion revision 105 (More bug fixes, especially several contributed by Werner Fink from SuSE). * Wed Apr 20 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-17mdk - Updated to subversion revision 99/release 8.15.1rc3 (Tons of bug fixes, especially broken "ps2epsi", 16-bit/color support for "cups" device/native CUPS drivers). * Tue Mar 29 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-16mdk - Updated to subversion revision 79 (Several bug fixes, especially crashes of "imagen" and "lx5000" drivers, output into a pipe not possible for some drivers, ...). * Thu Mar 17 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-15mdk - Updated to subversion revision 78 (Several bug fixes, improvement of antialiased screen output when using gv or ghostview). - Added "Conflicts: printer-filters <= 10.1" (bug 14710). * Tue Mar 8 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-14mdk - Updated to subversion revision 70 (Deactivated "dmprt", it breaks GhostScript completely). * Mon Mar 7 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-13mdk - Updated to subversion revision 68 (Added remaining japanese printer drivers: "dmprt", "escpage", "lp2000", "npdl", "rpdl"). * Fri Mar 4 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-12mdk - Updated to subversion revision 67 (Fixed segfaults in "opvp" and "lips4v"; fixed color handling in "opvp"). * Wed Mar 2 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-11mdk - Updated to subversion revision 63 (Made PNG devices being compiled). * Thu Feb 24 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-10mdk - Updated to subversion revision 62 (Epson Kowa laser printer driver added upstream, CUPS driver for PCL-XL improved). * Mon Feb 21 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-9mdk - Updated to subversion revision 51 (Fixed segfault of Epson EPL-xxxxL driver with KRGB patch). - Reactivated KRGB. * Fri Feb 18 2005 Christiaan Welvaart <cjw@daneel.dyndns.org> 8.15-8mdk - drop patch1: fixed upstream * Thu Feb 17 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-7mdk - Updated to subversion revision 50 (Added old japanese drivers). * Wed Feb 16 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-6mdk - Updated to subversion revision 49 (Many bug fixes, especially "pxlmono" driver). - Temporarily reverted to the original IJS driver from GPL GhostScript, without KRGB, but does not segfault with Epson EPL-xxxxL driver. * Tue Feb 15 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-5mdk - Updated to subversion revision 46 (shortly after 8.15.1rc1). - Added Epson Kowa laser printer drivers (alpha version). - Cleaned up spec file somewhat. * Sun Feb 13 2005 Christiaan Welvaart <cjw@daneel.dyndns.org> 8.15-4mdk - Patch1: fix segfault at startup on ppc * Wed Feb 9 2005 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 8.15-3mdk - lib64 fixes - build DSO with PIC * Sat Jan 29 2005 Christiaan Welvaart <cjw@daneel.dyndns.org> 8.15-2mdk - add BuildRequires: XFree86-devel * Fri Jan 28 2005 Till Kamppeter <till@mandrakesoft.com> 8.15-1mdk - Updated to ESP GhostScript 8.15.