ghostscript/ghostscript.spec

374 lines
14 KiB
RPMSpec
Raw Normal View History

#
# spec file for package ghostscript
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: ghostscript
BuildRequires: cups-devel
BuildRequires: docbook-toys
BuildRequires: dos2unix
BuildRequires: ed
BuildRequires: flex
BuildRequires: fontconfig-devel
BuildRequires: freetype2-devel
BuildRequires: gcc-c++
BuildRequires: libexpat-devel
BuildRequires: libjasper-devel
%if 0%{?suse_version:%{suse_version}} > 1130
BuildRequires: liblcms-devel
%endif
BuildRequires: libopenssl-devel
BuildRequires: libpng-devel
BuildRequires: libtiff-devel
BuildRequires: pkg-config
BuildRequires: t1utils
BuildRequires: xorg-x11-devel
BuildRequires: xorg-x11-fonts
BuildRequires: zlib-devel
AutoReqProv: on
Summary: The Ghostscript interpreter for PostScript and PDF
Group: System/Libraries
License: GPL-3.0
Url: http://www.ghostscript.com/
Version: 9.05
Release: 1
# Source0...Source9 is for sources from upstream:
# URL for Source0: http://downloads.ghostscript.com/public/ghostscript-9.05.tar.gz
# URL for MD5 checksums: http://downloads.ghostscript.com/public/MD5SUMS
# MD5 checksum for Source0: f7c6f0431ca8d44ee132a55d583212c1
Source0: ghostscript-%{version}.tar.gz
# Patch0...Patch9 is for patches from upstream:
#
# Source10...Source99 is for sources from SUSE which are intended for upstream:
#
# Patch10...Patch99 is for patches from SUSE which are intended for upstream:
#
# Source100...Source999 is for sources from SUSE which are not intended for upstream:
#
# Patch100...Patch999 is for patches from SUSE which are not intended for upstream:
#
# RPM dependencies:
# Additional RPM Provides of the ghostscript-library packages in openSUSE 11.4 from
# "rpm -q --provides ghostscript-library" and "rpm -q --provides ghostscript-x11":
# ghostscript
# gs
# gs_lib
# pstoraster
# ghostscript_any
# ghostscript-serv
# gs_x11
# ghostscript_x11
# ghostscript-mini
# Which of those are actually used in openSUSE:Factory (dated 22 Feb. 2012):
# ghostscript
# gs
# gs_lib
# ghostscript_any
# ghostscript_x11
# ghostscript-mini
# Which other packages need those in openSUSE:Factory (dated 22 Feb. 2012):
# blocxx-doc BuildRequires ghostscript
# iproute2 BuildRequires ghostscript
# gle-graphics Requires ghostscript
# webdot Requires ghostscript
# ddd BuildRequires ghostscript_any
# emacs-auctex BuildRequires ghostscript_any
# kernel-docs BuildRequires ghostscript_any
# texlive-bin BuildRequires ghostscript_any
# cups Requires ghostscript_any
# html2ps Requires ghostscript_any
# latex2html Requires ghostscript_any
# pstoedit Requires ghostscript_any
# ghostview Requires ghostscript_x11
# gv Requires ghostscript_x11
# texlive-bin Requires ghostscript_x11
# klatexformula BuildRequires gs and Requires gs
# capi4hylafax Requires gs_lib
# hylafax Requires gs_lib
# graphviz-plugins BuildRequires ghostscript-mini
# Provide the additional RPM Provides of the ghostscript-library package
# (ghostscript_x11 is provided by the ghostscript-x11 sub-package, see below):
Provides: gs
Provides: gs_lib
Provides: ghostscript_any
# There is a needless requirement for pstoraster in gutenprint up to openSUSE 11.4.
# Satisfy it to be backward compatible with installed gutenprint packages:
Provides: pstoraster
# Replace any version of the packages ghostscript-library and ghostscript-mini silently.
# The "Obsoletes: ghostscript-mini" is intentionally unversioned because
# this package ghostscript should replace any version of ghostscript-mini.
# There is intentionally no "Provides: ghostscript-mini" here because this
# would cause a conflict when this package ghostscript should be re-replaced
# by ghostscript-library because ghostscript-library conflicts with ghostscript-mini
# so that there would be no easy way back from ghostscript to ghostscript-library.
# Different versions must be explicitly specified in Provides and Obsoletes
# to avoid a RPMLINT warning that the package obsoletes itself
# because an unversioned RPM dependency means "all versions".
# The RPM documentation http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
# and /usr/share/doc/packages/rpm/manual/dependencies (in rpm-4.8.0 in openSUSE 11.4)
# does not show a comparison operator for "not equal" so that two obsoletes are used:
Provides: ghostscript-library = %{version}
Obsoletes: ghostscript-library < %{version}
Obsoletes: ghostscript-library > %{version}
Obsoletes: ghostscript-mini
# The ghostscript-x11 sub-package requires the exact matching version-release
# of the ghostscript main-package (see below) so that the ghostscript main-package
# should conflict with a non-matching ghostscript-x11 package to make sure
# that the ghostscript main-package is not changed without changing
# the ghostscript-x11 sub-package accordingly.
# The RPM documentation http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
# and /usr/share/doc/packages/rpm/manual/dependencies (in rpm-4.8.0 in openSUSE 11.4)
# does not show a comparison operator for "not equal" so that two conflicts are used:
Conflicts: ghostscript-x11 < %{version}-%{release}
Conflicts: ghostscript-x11 > %{version}-%{release}
# When the ghostscript main-package is installed, usually the exact matching
# version-release of the ghostscript-x11 sub-package should be also installed:
Recommends: ghostscript-x11 = %{version}-%{release}
# Prerequire /sbin/ldconfig which is used in the traditional bash scriptlets for post/postun:
PreReq: /sbin/ldconfig
# Install into this non-root directory (required when norootforbuild is used):
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# Used in "configure --with-fontpath=...":
%define gsfontpath /usr/share/fonts/truetype:/usr/share/fonts/Type1:/usr/share/fonts/CID:/usr/share/fonts/URW
%description
Ghostscript is a package of software that provides:
An interpreter for the PostScript language,
with the ability to convert PostScript language files
to many raster formats, view them on displays,
and print them on printers that don't have
PostScript language capability built in.
An interpreter for Portable Document Format (PDF) files,
with the same abilities.
The ability to convert PostScript language files
to PDF (with some limitations) and vice versa.
A set of C procedures (the Ghostscript library)
that implement the graphics and filtering
(data compression / decompression / conversion)
capabilities that appear as primitive operations
in the PostScript language and in PDF.
For information how to use Ghostscript see
/usr/share/ghostscript/%{version}/doc/Use.htm
%package x11
Summary: X11 library for Ghostscript
Group: Productivity/Publishing/PS
License: GPL-3.0
# Require the exact matching version-release of the ghostscript main-package because
# a non-matching ghostscript main-package may let it fail or even crash (e.g. segfault)
# because all Ghostscript software is built from one same Ghostscript source tar ball
# so that there could be any kind of Ghostscript-internal dependencies.
# The exact matching version-release of the ghostscript main-package is available
# on the same package repository where the ghostscript-x11 sub-package is because
# all are built simulaneously from the same Ghostscript source package:
Requires: ghostscript = %{version}-%{release}
# Unfortunately ghostscript-library.spec and ghostscript-mini.spec have
# an unversioned "Provides: ghostscript" and for RPM this means that both
# ghostscript-library and ghostscript-mini provide any version of "ghostscript"
# so that any version of ghostscript-library and ghostscript-mini fulfills
# the above versioned requirement which is wrong and therefore an explicit conflicts
# is used here to avoid the mess.
# Above the ghostscript main package "Provides: ghostscript-library = version" so that
# versioned conflicts are needed to avoid a conflict with the ghostscript main package.
# The RPM documentation http://www.rpm.org/max-rpm/s1-rpm-depend-manual-dependencies.html
# and /usr/share/doc/packages/rpm/manual/dependencies (in rpm-4.8.0 in openSUSE 11.4)
# does not show a comparison operator for "not equal" so that two conflicts are used:
Conflicts: ghostscript-library < %{version}-%{release}
Conflicts: ghostscript-library > %{version}-%{release}
Conflicts: ghostscript-mini
# In openSUSE:Factory (dated 22 Feb. 2012) ghostview gv and texlive-bin require ghostscript_x11 (see above):
Provides: ghostscript_x11
%description x11
This package contains the X11 library which is needed
to view PostScript and PDF files with Ghostscript
under the X Window System.
%package devel
License: GPL-3.0
Summary: Development files for Ghostscript
Requires: ghostscript = %{version}
Group: Development/Libraries/C and C++
%description devel
This package contains the development files for Ghostscript.
%prep
# Be quiet when unpacking:
%setup -q
%build
# Set our preferred architecture-specific flags for the compiler and linker:
export CFLAGS="$RPM_OPT_FLAGS"
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
autoreconf -fi
# --enable-cups and --with-install-cups (the latter is new since version 9.04)
# make and install cups/filter/gstoraster and cups/filter/gstopxl
# and related files (gstoraster.convs pxlcolor.ppd pxlmono.ppd):
./configure --prefix=%{_prefix} \
--bindir=%{_bindir} \
--mandir=%{_mandir} \
--datadir=%{_datadir} \
--infodir=%{_infodir} \
--libdir=%{_libdir} \
--with-fontpath=%{gsfontpath} \
--with-libiconv=maybe \
--with-system-libtiff \
--enable-freetype \
--with-ijs \
--with-jbig2dec \
--with-jasper \
--enable-dynamic \
--enable-cups \
--with-install-cups \
--with-drivers=ALL \
--disable-gtk \
--disable-compile-inits \
--with-pdftoraster \
--without-omni
make
# make libgs.so and two programs which use it, gsx which uses Gtk+ and gsc which does not:
make so
%install
make install DESTDIR=%{buildroot}
# install libgs.so gsx gsc and some header files:
make soinstall DESTDIR=%{buildroot}
# Use traditional bash scriptlet with an explicite "exit 0" line at the end to be fail safe
# see http://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets
%post
/sbin/ldconfig
exit 0
# Use traditional bash scriptlet with an explicite "exit 0" line at the end to be fail safe
# see http://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets
%postun
/sbin/ldconfig
exit 0
%files
%defattr(-, root, root)
%config %{_sysconfdir}/cups/gstoraster.convs
%{_bindir}/dumphint
%{_bindir}/dvipdf
%{_bindir}/eps2eps
%{_bindir}/font2c
%{_bindir}/gs
%{_bindir}/gsx
%{_bindir}/gsc
%{_bindir}/gsbj
%{_bindir}/gsdj
%{_bindir}/gsdj500
%{_bindir}/gslj
%{_bindir}/gslp
%{_bindir}/gsnd
%{_bindir}/lprsetup.sh
%{_bindir}/pdf2dsc
%{_bindir}/pdf2ps
%{_bindir}/pdfopt
%{_bindir}/pf2afm
%{_bindir}/pfbtopfa
%{_bindir}/pphs
%{_bindir}/printafm
%{_bindir}/ps2ascii
%{_bindir}/ps2epsi
%{_bindir}/ps2pdf
%{_bindir}/ps2pdf12
%{_bindir}/ps2pdf13
%{_bindir}/ps2pdf14
%{_bindir}/ps2pdfwr
%{_bindir}/ps2ps
%{_bindir}/ps2ps2
%{_bindir}/unix-lpr.sh
%{_bindir}/wftopfa
%if 0%{?suse_version} == 0 || 0%{?suse_version} > 1120
%dir /usr/lib/cups
%dir /usr/lib/cups/filter
/usr/lib/cups/filter/gstopxl
/usr/lib/cups/filter/gstoraster
%else
%dir %{_libdir}/cups
%dir %{_libdir}/cups/filter
%{_libdir}/cups/filter/gstopxl
%{_libdir}/cups/filter/gstoraster
%endif
%dir %{_datadir}/cups
%dir %{_datadir}/cups/model
%{_datadir}/cups/model/pxlcolor.ppd
%{_datadir}/cups/model/pxlmono.ppd
%doc %{_mandir}/man1/dvipdf.1.gz
%doc %{_mandir}/man1/eps2eps.1.gz
%doc %{_mandir}/man1/font2c.1.gz
%doc %{_mandir}/man1/gs.1.gz
%doc %{_mandir}/man1/gsbj.1.gz
%doc %{_mandir}/man1/gsdj.1.gz
%doc %{_mandir}/man1/gsdj500.1.gz
%doc %{_mandir}/man1/gslj.1.gz
%doc %{_mandir}/man1/gslp.1.gz
%doc %{_mandir}/man1/gsnd.1.gz
%doc %{_mandir}/man1/pdf2dsc.1.gz
%doc %{_mandir}/man1/pdf2ps.1.gz
%doc %{_mandir}/man1/pdfopt.1.gz
%doc %{_mandir}/man1/pf2afm.1.gz
%doc %{_mandir}/man1/pfbtopfa.1.gz
%doc %{_mandir}/man1/printafm.1.gz
%doc %{_mandir}/man1/ps2ascii.1.gz
%doc %{_mandir}/man1/ps2epsi.1.gz
%doc %{_mandir}/man1/ps2pdf.1.gz
%doc %{_mandir}/man1/ps2pdf12.1.gz
%doc %{_mandir}/man1/ps2pdf13.1.gz
%doc %{_mandir}/man1/ps2pdf14.1.gz
%doc %{_mandir}/man1/ps2pdfwr.1.gz
%doc %{_mandir}/man1/ps2ps.1.gz
%doc %{_mandir}/man1/wftopfa.1.gz
%doc %{_mandir}/de/man1/dvipdf.1.gz
%doc %{_mandir}/de/man1/eps2eps.1.gz
%doc %{_mandir}/de/man1/font2c.1.gz
%doc %{_mandir}/de/man1/gsnd.1.gz
%doc %{_mandir}/de/man1/pdf2dsc.1.gz
%doc %{_mandir}/de/man1/pdf2ps.1.gz
%doc %{_mandir}/de/man1/pdfopt.1.gz
%doc %{_mandir}/de/man1/printafm.1.gz
%doc %{_mandir}/de/man1/ps2ascii.1.gz
%doc %{_mandir}/de/man1/ps2pdf.1.gz
%doc %{_mandir}/de/man1/ps2pdf12.1.gz
%doc %{_mandir}/de/man1/ps2pdf13.1.gz
%doc %{_mandir}/de/man1/ps2pdf14.1.gz
%doc %{_mandir}/de/man1/ps2ps.1.gz
%doc %{_mandir}/de/man1/wftopfa.1.gz
%{_datadir}/ghostscript/
%{_libdir}/libgs.so.*
%{_libdir}/ghostscript/
%exclude %{_libdir}/ghostscript/%{version}/X11.so
%files x11
%defattr(-,root,root)
%{_libdir}/ghostscript/%{version}/X11.so
%files devel
%defattr(-,root,root)
%{_includedir}/ghostscript/
%{_libdir}/libgs.so
%changelog