2012-03-23 11:40:53 +01:00
#
# spec file for package ghostscript-mini
#
2014-03-27 14:53:38 +01:00
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
2012-03-23 11:40:53 +01:00
#
# 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/
#
2014-03-27 14:53:38 +01:00
2012-03-23 11:40:53 +01:00
Name : ghostscript-mini
BuildRequires : freetype2-devel
BuildRequires : libpng-devel
BuildRequires : libtiff-devel
BuildRequires : libtool
BuildRequires : pkg-config
BuildRequires : zlib-devel
Summary : Minimal Ghostscript for minimal build requirements
2013-02-20 13:27:45 +01:00
License : AGPL-3.0
2012-04-25 16:47:49 +02:00
Group : System/Libraries
2012-03-23 11:40:53 +01:00
Url : http://www.ghostscript.com/
2013-10-09 12:15:22 +02:00
# Special version needed for Ghostscript release candidates e.g. "Version: 9.pre10rc1":
# Version 9.10rc1 would be newer than 9.10 (run "zypper vcmp 9.10rc1 9.10") because the rpmvercmp algorithm
# would treat 9.10rc1 as 9.10.rc.1 (alphabetic and numeric sections get separated into different elements)
# and 9.10.rc.1 is newer than 9.10 (it has one more element in the list while previous elements are equal)
# so that we use an alphabetic prefix to make it older than 9.10 (numbers are considered newer than letters):
#Version: 9.pre10rc1
# Normal version for Ghostscript releases is the upstream version:
2014-03-27 14:53:38 +01:00
Version : 9.14
2012-04-25 16:47:49 +02:00
Release : 0
2013-10-09 12:15:22 +02:00
# tarball_version is used below to specify the directory via "setup -n":
# Special tarball_version needed for Ghostscript release candidates e.g. "define tarball_version 9.10rc1".
# For Ghostscript releases tarball_version and version are the same (i.e. the upstream version):
%define tarball_version %{version}
# built_version is used below in the install and files sections:
# Separated built_version needed in case of Ghostscript release candidates e.g. "define built_version 9.10".
# For Ghostscript releases built_version and version are the same (i.e. the upstream version):
%define built_version %{version}
2012-03-23 11:40:53 +01:00
# Source0...Source9 is for sources from upstream:
2013-10-09 12:15:22 +02:00
# Special URLs for Ghostscript release candidates:
# URL for Source0: http://www.ghostscript.com/~chrisl/ghostscript-9.10rc1.tar.gz
# URL for MD5 checksums: http://www.ghostscript.com/~chrisl/MD5SUMS
# MD5 checksum for Source0: 0cdf23c5dff76040983bca74675f88be
#Source0: http://www.ghostscript.com/~chrisl/ghostscript-9.10rc1.tar.gz
# Normal URLs for Ghostscript releases:
2014-03-27 14:53:38 +01:00
# URL for Source0: http://downloads.ghostscript.com/public/ghostscript-9.14.tar.gz
2012-03-23 11:40:53 +01:00
# URL for MD5 checksums: http://downloads.ghostscript.com/public/MD5SUMS
2014-03-27 14:53:38 +01:00
# MD5 checksum for Source0: 586494befb443363338c1b6379f13973
2013-04-02 10:13:29 +02:00
Source0 : http://downloads.ghostscript.com/public/ghostscript-%{version} .tar.gz
2012-03-23 11:40:53 +01:00
# 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:
2013-12-19 14:49:21 +01:00
# Patch10 ppc64le-support.patch from IBM fixes endianness in lcms (the Little-CMS library)
# to support the new architecture ppc64le (IBM Power PC Little Endian architecture)
# because ppc64 is big-endian and ppc64le is little-endian and lcms has a hard-coded
# check that assumes PowerPC is always big-endian which is incorrect on ppc64le.
# The fix is already in the main Little-CMS repository by this Git commit
# https://github.com/mm2/Little-CMS/commit/b4f5c91a2c1582bd284f0d0f49cb43e2c2235a79
# (There are some cosmetic changes in the patch as it went upstream.)
# It is not yet in the imported copy in Ghostscript.
# IBM will work with upstream to get the fix imported too.
2013-12-18 17:52:33 +01:00
Patch10 : ppc64le-support.patch
2012-03-23 11:40:53 +01:00
#
# 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:
#
Conflicts : ghostscript
Conflicts : ghostscript-x11
Conflicts : ghostscript-devel
2012-04-25 16:47:49 +02:00
Conflicts : ghostscript-library
2012-05-11 12:09:58 +02:00
# Require Ghostscript's fonts because the Ghostscript package provides the
# "Fontmap" file /usr/share/ghostscript/<version>/Resource/Init/Fontmap.GS
# which lists Ghostscript's fonts but the fonts itself are provided in the
# separated packages ghostscript-fonts-std and ghostscript-fonts-other
# (regarding separated packages see /usr/share/ghostscript/<version>/doc/Fonts.htm)
# so that a RPM requirement is needed to make sure that Ghostscript has its fonts:
Requires : ghostscript-fonts-other
2012-09-24 12:58:16 +02:00
Requires : ghostscript-fonts-std
2012-03-23 11:40:53 +01:00
# 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
%description
Crippled Minimal Ghostscript which is not meant
to be used by end-users.
Minimal Ghostscript provides only the file format drivers
in particular to output JPEG PNG PostScript and PDF files
but no printer drivers (in particular neither 'cups'
nor 'ijs' ) and no X11 drivers.
The ghostscript-mini package is only meant to be used
by the openSUSE build service to avoid possible loops
in the build dependencies because ghostscript-mini
has minimal build dependencies (in particular
neither CUPS nor X11 build dependencies).
2012-04-25 16:47:49 +02:00
For most packages which need to only run
Ghostscript during build, a single line
" B u i l d R e q u i r e s : g h o s t s c r i p t - m i n i "
should be sufficient in the RPM spec file.
For most packages which need Ghostscript
development files to build, a single line
" B u i l d R e q u i r e s : g h o s t s c r i p t - m i n i - d e v e l "
should be sufficient in the RPM spec file.
2012-03-23 11:56:35 +01:00
The ghostscript-mini package in the openSUSE build
service contains no sources and it must not contain
any source files. The ghostscript-mini package is only
a link to its matching ghostscript " p a r e n t " package.
Only that ghostscript package must contain all sources
and any changes must happen only for that ghostscript
package. This means any changes for the ghostscript-mini
package will be rejected in the openSUSE build service.
2012-03-23 11:40:53 +01:00
%package devel
Summary : Development files for Minimal Ghostscript
2012-04-25 16:47:49 +02:00
Group : Development/Libraries/C and C++
2012-03-23 11:40:53 +01:00
Requires : ghostscript-mini = %{version}
Conflicts : ghostscript
Conflicts : ghostscript-x11
Conflicts : ghostscript-devel
2012-04-25 16:47:49 +02:00
Conflicts : ghostscript-library
2012-03-23 11:40:53 +01:00
%description devel
This package contains the development files for Minimal Ghostscript.
%prep
2013-01-04 10:02:55 +01:00
# Be quiet when unpacking and
# use a directory name matching Source0 to make it work also for ghostscript-mini:
2013-10-09 12:15:22 +02:00
%setup -q -n ghostscript-%{tarball_version}
2013-12-19 14:49:21 +01:00
# Patch10 ppc64le-support.patch from IBM fixes endianness in lcms (the Little-CMS library):
2013-12-18 17:52:33 +01:00
%patch10 -p1
2012-03-23 11:40:53 +01:00
%build
# Set our preferred architecture-specific flags for the compiler and linker:
export CFLAGS=" $RPM_OPT_FLAGS "
export CXXFLAGS=" $RPM_OPT_FLAGS - f n o - s t r i c t - a l i a s i n g "
autoreconf -fi
2012-04-25 16:47:49 +02:00
# --docdir=%%{_defaultdocdir}/%%{name} does not work therefore it is not used.
2012-03-23 11:40:53 +01:00
# --disable-cups and --without-pdftoraster and --without-install-cups
2012-04-27 14:58:11 +02:00
# to have nothing related to CUPS in the minimal Ghostscript.
# --disable-dbus to have nothing related to D-Bus in the minimal Ghostscript.
2012-03-23 11:40:53 +01:00
# --without-ijs to disable IJS printer driver support in the minimal Ghostscript.
# --with-drivers=FILES to have only the file format drivers
2012-04-27 14:58:11 +02:00
# but no printer drivers in the minimal Ghostscript.
2012-03-23 11:40:53 +01:00
# --without-x to not use the X Window System.
# --without-omni to disable the outdated and unmaintained omni driver.
# --without-jasper and --enable-openjpeg because since Ghostscript 9.05 JasPer is deprecated
2012-04-27 14:58:11 +02:00
# and Ghostscript now ships modified OpenJPEG sources for JPEG2000 decoding
# (replacing JasPer - although JasPer is still included for this release).
# Performance, reliability and memory use whilst decoding JPX streams are all improved.
2012-03-23 11:40:53 +01:00
# --without-ufst and --without-luratech because those are relevant to commercial releases only
2012-04-27 14:58:11 +02:00
# which would require a commercial license.
2012-03-23 11:40:53 +01:00
# --without-libpaper disables libpaper support because SUSE does not have libpaper.
%define gs_font_path /usr/share/fonts/truetype:/usr/share/fonts/Type1:/usr/share/fonts/CID:/usr/share/fonts/URW
2012-09-24 12:58:49 +02:00
# See http://bugs.ghostscript.com/show_bug.cgi?id=693100
2012-09-24 12:58:16 +02:00
export SUSE_ASNEEDED=0
2012-03-23 11:40:53 +01:00
./configure --prefix=%{_prefix} \
--bindir=%{_bindir} \
2012-04-25 16:47:49 +02:00
--libdir=%{_libdir} \
2012-03-23 11:40:53 +01:00
--datadir=%{_datadir} \
2012-04-25 16:47:49 +02:00
--mandir=%{_mandir} \
2012-03-23 11:40:53 +01:00
--infodir=%{_infodir} \
--with-fontpath=%{gs_font_path} \
--with-libiconv=maybe \
--enable-freetype \
--with-jbig2dec \
--without-jasper \
--enable-openjpeg \
--enable-dynamic \
2013-02-20 13:27:45 +01:00
--without-ijs \
2012-03-23 11:40:53 +01:00
--disable-cups \
2012-04-27 14:58:11 +02:00
--disable-dbus \
2012-03-23 11:40:53 +01:00
--without-pdftoraster \
--without-install-cups \
--with-drivers=FILES \
--without-x \
--disable-gtk \
--disable-compile-inits \
--without-omni \
--without-ufst \
--without-luratech \
--without-libpaper
make
2012-04-25 16:47:49 +02:00
# Make libgs.so and two programs which use it, gsx and gsc:
2012-03-23 11:40:53 +01:00
make so
2013-02-20 13:27:45 +01:00
# Configure and make libijs (that is not done regardless whether or not --with-ijs is used above):
2013-01-04 10:02:55 +01:00
pushd ijs
./autogen.sh
./configure --prefix=%{_prefix} \
--bindir=%{_bindir} \
--libdir=%{_libdir} \
--datadir=%{_datadir} \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
--enable-shared \
--disable-static
make
popd
2012-03-23 11:40:53 +01:00
%install
make install DESTDIR=%{buildroot}
2012-04-25 16:47:49 +02:00
# Install libgs.so gsx gsc and some header files:
2012-03-23 11:40:53 +01:00
make soinstall DESTDIR=%{buildroot}
2013-01-04 10:02:55 +01:00
# Install libijs and its header files:
pushd ijs
make install DESTDIR=%{buildroot}
popd
# Remove installed ijs example client and server and its .la file:
rm %{buildroot} %{_bindir} /ijs_client_example
rm %{buildroot} %{_bindir} /ijs_server_example
rm %{buildroot} %{_libdir} /libijs.la
2012-04-25 16:47:49 +02:00
# Install documentation which is not installed by default
# see http://bugs.ghostscript.com/show_bug.cgi?id=693002
# and fail intentionally as notification if something changed:
2013-10-09 12:15:22 +02:00
DOCDIR=%{buildroot} %{_datadir} /ghostscript/%{built_version} /doc
2012-09-27 15:49:11 +02:00
for D in LICENSE
2012-04-25 16:47:49 +02:00
do test -e $DOCDIR/$( basename $D ) && exit 99
install -m 644 $D $DOCDIR
done
# Add a link from SUSE's usual documentation directory to Ghostscript's documentation directory
# because "configure --docdir=%%{_defaultdocdir}/%%{name}" does not work (see above):
2012-05-11 12:09:58 +02:00
install -d -m 755 %{buildroot} %{_defaultdocdir}
2012-04-25 16:47:49 +02:00
pushd %{buildroot} %{_defaultdocdir}
2013-10-09 12:15:22 +02:00
ln -s ../../ghostscript/%{built_version} /doc ghostscript
2012-04-25 16:47:49 +02:00
popd
2012-05-11 12:09:58 +02:00
# Extract the catalog of devices which are actually built-in in exactly this Ghostscript:
# Do not pollute the build log file with zillions of meaningless messages:
set +x
cat /dev/null >catalog.devices
for D in $( %{buildroot} /usr/bin/gs -h | sed -n -e '/^Available devices:/,/^Search path:/p' | egrep -v '^Available devices:|^Search path:' )
do for F in base/devs.mak base/contrib.mak contrib/contrib.mak
do sed -n -e '/ Catalog /,/ End of catalog /p' $F | grep " [ [ : s p a c e : ] ] $ D [ [ : s p a c e : ] ] " | grep -o '[[:alnum:]].*' | tr -s '[:blank:]' ' ' | sed -e 's/ /\t/' | expand -t16 >>catalog.devices
done
done
# Switch back to the usual build log messages:
set -x
install -m 644 catalog.devices $DOCDIR
2012-03-23 11:40:53 +01:00
# 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)
%{_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} /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
%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/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
2013-01-04 10:02:55 +01:00
%doc %{_mandir} /man1/ijs-config.1.gz
2012-03-23 11:40:53 +01:00
%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/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
2012-04-25 16:47:49 +02:00
%doc %{_defaultdocdir} /ghostscript
%dir %{_datadir} /ghostscript
2013-10-09 12:15:22 +02:00
%dir %{_datadir} /ghostscript/%{built_version}
%doc %{_datadir} /ghostscript/%{built_version} /doc/
%{_datadir} /ghostscript/%{built_version} /examples/
%{_datadir} /ghostscript/%{built_version} /iccprofiles/
%{_datadir} /ghostscript/%{built_version} /lib/
%{_datadir} /ghostscript/%{built_version} /Resource/
2012-03-23 11:40:53 +01:00
%{_libdir} /libgs.so.*
%{_libdir} /ghostscript/
2013-01-04 10:02:55 +01:00
%{_libdir} /libijs-0.35.so
2012-03-23 11:40:53 +01:00
%files devel
%defattr (-,root,root)
%{_includedir} /ghostscript/
%{_libdir} /libgs.so
2013-01-04 10:02:55 +01:00
%{_bindir} /ijs-config
%{_includedir} /ijs/
%{_libdir} /libijs.so
%{_libdir} /pkgconfig/ijs.pc
2012-03-23 11:40:53 +01:00
%changelog