Sophie

Sophie

distrib > Mageia > 5 > i586 > by-pkgid > 630e113861d9168e4210e009dc62c47a > files > 15

ghostscript-9.14-3.2.mga5.src.rpm

%define _disable_ld_no_undefined 1
%define rel	3
%define subrel	2

%define gsver 9.14
%define ijsver 0.35
%define ijsreloffset 104
%define ijsrelno %(echo $((%{rel} + %{ijsreloffset})))
%define ijsrel %mkrel %{ijsrelno}

%define ijsmajor 1
%define libijs %mklibname ijs %{ijsmajor}
%define libijs_devel %mklibname -d ijs

%define gsmajor 9
%define libgs %mklibname gs %{gsmajor}
%define libgs_devel %mklibname -d gs

%define bootstrap 0

%define GSx11SVGAmodule 1
%define debug 0

Summary:	PostScript/PDF interpreter and renderer (Main executable)
Name:		ghostscript
Version:	%{gsver}
Release:	%mkrel %{rel}
License:	AGPLv3+
Group:		Publishing
URL:		http://www.ghostscript.com/awki/Index
Source0:	http://downloads.ghostscript.com/public/ghostscript-%{gsver}.tar.gz
Source2:	ps2pdfpress.bz2
Source3:	http://www.linuxprinting.org/download/printing/sipixa6.upp.bz2

Patch0:		ghostscript-9.14-CVE-2015-3228.patch
Patch12:        ghostscript-9.14-openjpeg2-non-static.patch

# Fedora patches
# Fix ijs-config not to have multilib conflicts (bug #192672)
Patch1: ghostscript-multilib.patch
# Fix some shell scripts
Patch2: ghostscript-scripts.patch
# Build igcref.c with -O0 to work around bug #150771.
Patch3: ghostscript-noopt.patch
# Define .runlibfileifexists.
Patch4: ghostscript-runlibfileifexists.patch
# Fixed missing error check when setting ICC profile.
Patch5: ghostscript-icc-missing-check.patch
# Restored Fontmap.local patch, incorrectly dropped after
# ghostscript-8.15.4-3 (bug #610301).
# Note: don't use -b here to avoid the backup file ending up in the
# package manifest.
Patch6: ghostscript-Fontmap.local.patch
# Don't assume %%rom%% device is available for initial ICC profile dir.
Patch7: ghostscript-iccprofiles-initdir.patch
# gdevcups: don't use uninitialized variables in debugging output.
Patch8: ghostscript-gdevcups-debug-uninit.patch
# Use more caution when converting floats to strings (bug #980085).
Patch9: ghostscript-wrf-snprintf.patch
# Use upstream patch to fix gs segfault (bug #1036428).
Patch10: ghostscript-gs694154.patch
# Fix build when using system zlib.
Patch11: ghostscript-sys-zlib.patch


%if !%{bootstrap}
BuildRequires: gtk+3-devel
BuildRequires: cups-devel
BuildRequires: fontconfig-devel
%endif
BuildRequires: bison
BuildRequires: flex
BuildRequires: libtool
BuildRequires: unzip
BuildRequires: gettext-devel
BuildRequires: glibc-devel
BuildRequires: jbig2dec-devel
BuildRequires: jpeg-devel
BuildRequires: libpaper-devel
BuildRequires: netpbm-devel
BuildRequires: tiff-devel
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(ice)
BuildRequires: pkgconfig(jasper)
BuildRequires: pkgconfig(lcms2) >= 2.5
BuildRequires: pkgconfig(libidn)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(sm)
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xext)
BuildRequires: pkgconfig(xt)
BuildRequires: pkgconfig(zlib)

Requires: 	ghostscript-common
Requires:	update-alternatives
%if !%{GSx11SVGAmodule}
%rename	ghostscript-module-X ghostscript-module-SVGALIB
%endif

%description
Ghostscript is a set of software tools that provide 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 and vector
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.

You should install ghostscript if you need to display PostScript or
PDF files, or if you have a non-PostScript printer.

%package dvipdf
Summary: PostScript/PDF interpreter and renderer (DVI-to-PDF converter)
Group: 		Publishing
Requires: 	ghostscript
Requires:	coreutils
Requires:	dvips
Provides:	dvipdf = %{version}-%{release}

%description dvipdf
Tool to convert the DVI format of TeX into the PDF format. There are
more such tools (for different quality levels) in the dvipdfm
package. All these tools use dvips of TeX to convert the DVI file to
PostScript, then they use GhostScript to generate the PDF file.

%package common
Summary: PostScript/PDF interpreter and renderer (Common files)
Group: 		Publishing
Requires:	urw-fonts >= 1.1
Requires:	ghostscript-fonts

%description common
Ghostscript is a PostScript/PDF interpreter. It can render both
PostScript and PDF files to devices which include X window, many
printer formats, and popular graphics file formats.

This package contains the common data files needed by GhostScript.

%package X
Summary: PostScript/PDF interpreter and renderer (with X11 screen display)
Group: 		Publishing
Requires: 	ghostscript-common
Requires:	update-alternatives

%description X
Ghostscript is a PostScript/PDF interpreter. It can render both
PostScript and PDF files to devices which include X window, many
printer formats, and popular graphics file formats.

This package contains a GhostScript executable with GTK-based X
display support ("display" device, default, so it displays files by
simply entering "gs <file>" on the command line). It makes use of the
GhostScript shared library.

%if %{GSx11SVGAmodule}
%package module-X
Summary: PostScript/PDF interpreter and renderer (Additional support for X)
Group: 		Publishing
Requires: 	ghostscript-common

%description module-X
Ghostscript is a PostScript/PDF interpreter. It can render both
PostScript and PDF files to devices which include X window, many
printer formats, and popular graphics file formats.

This package enhances Ghostscript with X window support
%endif

%package -n %libgs
Summary: PostScript/PDF interpreter and renderer (GhostScript shared library)
Group: Publishing

%description -n %libgs
This is the API library for programs which use the PostScript and/or
PDF interpreters of GhostScript.

%package -n %libgs_devel
Summary: Headers and links to compile against the "%{libgs}" library
Group: Development/C
Requires: %libgs >= %{gsver}
Provides: %{name}-devel = %{gsver}
Provides: libgs-devel = %{gsver}
Obsoletes: %{_lib}gs9-devel < %{gsver}
Obsoletes: %{_lib}gs8-devel < %{gsver}

%description -n %libgs_devel
This package contains the static library and the header files needed
to compile applications using the GhostScript shared library.

%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}

%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.

%package -n %{libijs_devel}
Version:	%{ijsver}
Release:	%{ijsrel}
Summary:	Headers and links for compiling against the "%{libijs}" library
Group:		Development/C
URL:		http://www.linuxprinting.org/ijs/
Requires:	%{libijs} >= %{ijsver}
Requires:	multiarch-utils
Provides:	libijs-devel = %{ijsver}-%{ijsrel}
Provides:	ijs-devel = %{ijsver}-%{ijsrel}
Obsoletes:	%{_lib}ijs1-devel < %{ijsver}-%{ijsrel}

%description -n %{libijs_devel}
This package contains the static library and the header files needed
to compile applications using the IJS library.

%package doc
Summary:	Documentation for GhostScript
Group:		Publishing
BuildArch:	noarch

%description doc
This package contains documentation for GhostScript.

%prep
%setup -q
rm -rf expat freetype icclib jasper jpeg jpegxr lcms2 libpng openjpeg zlib cups/libs
%apply_patches
# Don't ship backup files
find . -name "*.*~" |xargs rm -f

# prevent building and using bundled libs
rm -rf jasper jbig2dec libpng jpeg tiff expat zlib lcms* freetype

# Convert manual pages to UTF-8
from8859_1() {
        iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_"
        mv "${1}_" "$1"
}
for i in man/de/*.1; do from8859_1 "$i"; done

# Stuff for shared library support to ghostscript.
%if %{GSx11SVGAmodule}
# build a small README describing the features available.
cat <<EOF >README.shared.%{_vendor}
This version of ghostscript support shared modules dynamically loaded
at run time.

There are currently two modules compiled with the %{distribution} 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

# UPP file for SiPix Pocket Printer A6
bzcat %{SOURCE3} > sipixa6.upp

%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

# We have a Subversion version, so we must re-generate "configure"
./autogen.sh

%configure2_5x \
	--enable-dynamic \
%if !%{bootstrap}
    --enable-fontconfig \
%endif
%ifarch %{ix86}
    --disable-sse2 \
%endif
    --with-drivers=ALL,opvp \
    --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" \
    --with-ijs \
    --with-x \
    --disable-compile-inits \
    --with-system-libtiff \

# Build IJS
pushd ijs
./autogen.sh
%configure2_5x \
%ifarch %{ix86}
	--disable-sse2 \
%endif
    --enable-shared \
    --disable-static

%make
popd

# Set documentation dir
perl -p -i -e 's|^(docdir=).*$|$1\$\(datadir\)/doc/%{name}-doc-%{gsver}|' Makefile

# Fix references to X11 libraries
perl -p -i -e "s|(/usr/X11R6)/lib\b|\1/%{_lib}|g" Makefile base/*.mak

# Correct paths for CJK fonts
perl -p -i -e "s:/usr/share/ghostscript/:/usr/share/ghostscript/Resource/:g" Resource/Init/gs_res.ps
perl -p -i -e "s:ghostscript/Resource/fonts:ghostscript/Resource/Font:g" Resource/Init/gs_res.ps

# bork
perl -p -i -e "s|^EXTRALIBS=|EXTRALIBS=-L/%{_lib} -lz |g" Makefile

# The RPM macro for make is not used here, as parallelization of the build 
# process does not work.
%if %{GSx11SVGAmodule}
make obj/X11.so
%endif
make so

%install
# 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
%if !%{bootstrap}
install -d %{buildroot}%{_prefix}/lib/cups
install -d %{buildroot}%{_datadir}/cups/model
install -d %{buildroot}%{_sysconfdir}/cups
%endif

pushd ijs*
%configure2_5x \
	--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
popd

##### GHOSTSCRIPT
mkdir -p %{buildroot}%{_docdir}/ghostscript-doc-%{gsver}

%if !%{bootstrap}
make \
	prefix=%{_prefix} \
	DESTDIR=%{buildroot} \
	gssharedir=%{_libdir}/ghostscript/%{gsver} \
	docdir=%{_docdir}/ghostscript-doc-%{gsver} \
	bindir=%{_bindir} \
	mandir=%{_mandir} \
%endif

make \
	prefix=%{_prefix} \
	DESTDIR=%{buildroot} \
	gssharedir=%{_libdir}/ghostscript/%{gsver} \
	docdir=%{_docdir}/ghostscript-doc-%{gsver} \
	bindir=%{_bindir} \
	libdir=%{_libdir} \
	mandir=%{_mandir} \
	soinstall

%if %{GSx11SVGAmodule}
make \
	prefix=%{_prefix} \
	DESTDIR=%{buildroot} \
	gssharedir=%{_libdir}/ghostscript/%{gsver} \
	docdir=%{_docdir}/ghostscript-doc-%{gsver} \
	bindir=%{_bindir} \
	libdir=%{_libdir} \
	mandir=%{_mandir} \
	install-shared
%endif

ln -sf gs.1%{_extension} %{buildroot}%{_mandir}/man1/ghostscript.1%{_extension}

# ps2pdfpress
install -m 755 ps2pdfpress %{buildroot}%{_bindir}

# UPP file for SiPix Pocket Printer A6
#mkdir -p %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib
install -m 644 sipixa6.upp %{buildroot}%{_datadir}/ghostscript/%{gsver}/lib/

# Correct permissions for all documentation files
chmod -R a+rX %{buildroot}%{_docdir}
chmod -R go-w %{buildroot}%{_docdir}
chmod -R u+w %{buildroot}%{_docdir}

# remove libtool archive
rm -f %{buildroot}%{_libdir}/libijs.la

%post
# Set up update-alternatives entries
%{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsc 200

%post X
# Set up update-alternatives entries
%{_sbindir}/update-alternatives --install %{_bindir}/gs gs %{_bindir}/gsx 100

%post common
# Initialize japanese fonts
if test -f /usr/share/fonts/ttf/japanese/cidinst; then
    sh /usr/share/fonts/ttf/japanese/cidinst
fi

%preun
if [ "$1" = 0 ]; then
  # Remove update-alternatives entry
  %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsc
fi

%preun X
if [ "$1" = 0 ]; then
  # Remove update-alternatives entry
  %{_sbindir}/update-alternatives --remove gs %{_bindir}/gsx
fi

%files
%{_bindir}/gsc

%files X
%{_bindir}/gsx

%files common
%dir %{_datadir}/ghostscript
%{_datadir}/ghostscript/%{gsver}
%{_mandir}/man1/*
%lang(de) %{_mandir}/de/man1/*
#%{_bindir}/[a-c]*
%{_bindir}/[e-f]*
#{_bindir}/gs-common
%{_bindir}/gs[a-b]*
%{_bindir}/gs[d-n]*
%{_bindir}/[j-l]*
%{_bindir}/[n-z]*

%files doc
%doc %{_docdir}/ghostscript-doc-%{gsver}

%files dvipdf
%{_bindir}/dvipdf

%if %{GSx11SVGAmodule}
%files module-X
%doc README.shared.%{_vendor}
%dir %{_libdir}/ghostscript/%{gsver}
%{_libdir}/ghostscript/%{gsver}/X11.so
%endif

%files -n %{libgs}
%{_libdir}/libgs.so.*%{gsmajor}*

%files -n %{libgs_devel}
%{_libdir}/libgs.so
%{_includedir}/ghostscript

%files -n %{libijs}
%{_libdir}/libijs-%{ijsver}.so

%files -n %{libijs_devel}
%doc ijs/README
%{_libdir}/libijs.so
%{_libdir}/pkgconfig/ijs.pc
%{_includedir}/ijs
%{_bindir}/ijs_client_example
%{_bindir}/ijs_server_example
%{_bindir}/ijs-config


%changelog
* Fri Jul 22 2016 akien <akien> 9.14-3.2.mga5
+ Revision: 1043164
- Fix build with openjpeg 2.1.1 due to hidden API in static build

  + luigiwalser <luigiwalser>
    - add upstream patch to fix CVE-2015-3228

* Wed Oct 15 2014 umeabot <umeabot> 9.14-3.mga5
+ Revision: 742581
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 9.14-2.mga5
+ Revision: 679561
- Mageia 5 Mass Rebuild

* Sat Mar 29 2014 luigiwalser <luigiwalser> 9.14-1.mga5
+ Revision: 609699
- 9.14
- update patches from fedora

  + tv <tv>
    - kill bundled system libraries
    - drop unused withcupsfilters (which cannot work anymore anyway...)

* Sat Feb 22 2014 tv <tv> 9.10-4.mga5
+ Revision: 595419
- sync patches with RH:
  o patch 5: fix icc missing check
  o patch 9: Use more caution when converting floats to strings (rhbz#980085)
  o patch 11: Use upstream patch to fix gs segfault (rhbz#1039718)
- reap commented out patches

* Sun Feb 16 2014 tv <tv> 9.10-3.mga5
+ Revision: 592756
- fix gs segfault (rhbz#1036428)

* Sat Oct 19 2013 umeabot <umeabot> 9.10-2.mga4
+ Revision: 533637
- Mageia 4 Mass Rebuild

  + fwang <fwang>
    - bump ijs rel

* Mon Sep 02 2013 luigiwalser <luigiwalser> 9.10-1.mga4
+ Revision: 474418
- 9.10

* Sat Aug 31 2013 joequant <joequant> 9.09-1.mga4
+ Revision: 473746
- upgrade to 9.09 and remove cups filters (now in cups-filter)

* Mon Jun 17 2013 blino <blino> 9.07-1.mga4
+ Revision: 444132
- sync patches with Fedora:
- locale fix (rh #961149)
- fix pdfwrite segfault (rh #962120)
- buildrequire lcms2 >= 2.5
- disable omni, it does not build and is deprecated (ghostscript #693440)
- drop CVE-2012-4405 patch, upstream is now using lcms2 and has dropped icclib
- build gsx against gtk+3
- use updated patches from Fedora)
- remove merged patch4 (ijs automake version)
- license is now AGPLv3+
- 9.07

* Sun Jun 02 2013 fwang <fwang> 9.06-11.mga4
+ Revision: 434650
- rebuild for new libpng

* Tue Mar 26 2013 tv <tv> 9.06-10.mga3
+ Revision: 405372
- make doc subpackage noarch

* Fri Feb 15 2013 fwang <fwang> 9.06-9.mga3
+ Revision: 398527
- do not use bundled lcms2

* Fri Feb 15 2013 fwang <fwang> 9.06-8.mga3
+ Revision: 398519
- build with lcms2

* Sat Jan 12 2013 umeabot <umeabot> 9.06-7.mga3
+ Revision: 351540
- Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sun Jan 06 2013 cjw <cjw> 9.06-6.mga3
+ Revision: 339808
- patch301: fix ijs build with automake 1.13

* Tue Oct 09 2012 luigiwalser <luigiwalser> 9.06-5.mga3
+ Revision: 304018
- rediff patch from mdv to fix CVE-2012-4405

* Sat Sep 15 2012 blino <blino> 9.06-4.mga3
+ Revision: 294138
- Fix hang in gstoraster if gs fails (reported as upstream bug #693336)

* Tue Sep 11 2012 blino <blino> 9.06-3.mga3
+ Revision: 292200
- use Fedora patches instead of broken rediffs; this fixes
  broken runlibfileifexists which made gs abort because of missing
  Fontmap.local

* Tue Sep 11 2012 blino <blino> 9.06-2.mga3
+ Revision: 292185
- add ICC checks from Fedora

* Sat Sep 08 2012 luigiwalser <luigiwalser> 9.06-1.mga3
+ Revision: 289744
- integrate changes from mdv
- 9.06
- fix files list (no more dumphint)

* Sat Apr 21 2012 tv <tv> 9.05-2.mga2
+ Revision: 232252
- no need to require perl

* Sat Feb 11 2012 fwang <fwang> 9.05-1.mga2
+ Revision: 207316
- force system libtiff
- new version 9.05

* Thu Dec 22 2011 fwang <fwang> 9.04-4.mga2
+ Revision: 186097
- rebuild for new libtiff

* Sun Nov 06 2011 anaselli <anaselli> 9.04-3.mga2
+ Revision: 164568
- imported some patches from fedora

* Sun Oct 02 2011 fwang <fwang> 9.04-2.mga2
+ Revision: 150967
- update file list
- fix libname of X11 module

* Wed Sep 14 2011 fwang <fwang> 9.04-1.mga2
+ Revision: 143161
- bump rel
- new version 9.04
- rebuild for new libpng

* Tue Jun 28 2011 ahmad <ahmad> 9.02-3.mga2
+ Revision: 115035
- Drop the redundant BR libxml-devel, it builds with libxml2-devel which was
  already pulled by some other BR

* Sun May 15 2011 pterjan <pterjan> 9.02-2.mga1
+ Revision: 98993
- Rebuild for fixed find-requires

* Sun Apr 17 2011 lmenut <lmenut> 9.02-1.mga1
+ Revision: 87327
- update to 9.02
- update file list
- remove obsolete patch4 ghostscript-linkage
- remove patch106 applied upstream ghostscript-system-jasper
- disable sse2 on ix86

* Fri Mar 04 2011 boklm <boklm> 9.00-4.mga1
+ Revision: 64166
- ghostscript-dvipdf provides dvipdf

* Fri Mar 04 2011 boklm <boklm> 9.00-3.mga1
+ Revision: 64147
- require dvips instead of tetex-dvips

* Sat Jan 15 2011 blino <blino> 9.00-2.mga1
+ Revision: 19370
- remove old compatibility symlinks (gs-common and ghostscript in bin)
- use distribution macro
- use vendor macro
- remove old ldconfig scriptlets, conflicts and version checks
- imported package ghostscript