a2ps/a2ps.spec
2014-09-17 19:28:15 +00:00

179 lines
5.3 KiB
RPMSpec

#
# spec file for package a2ps
#
# Copyright (c) 2014 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/
#
Name: a2ps
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: emacs-nox
BuildRequires: flex
BuildRequires: ghostscript-fonts-std
BuildRequires: gv
BuildRequires: psutils
BuildRequires: texlive-latex
BuildRequires: xorg-x11-devel
%if %suse_version > 1220
BuildRequires: gperf
BuildRequires: makeinfo
BuildRequires: texinfo
%endif
Url: http://www.gnu.org/software/a2ps/a2ps.html
Provides: a2ps-bin
Requires: ghostscript-fonts-std
Requires: pkgconfig(file)
Requires: pkgconfig(glibc)
Requires: pkgconfig(sed)
Requires: pkgconfig(w3m)
Requires: pkgconfig(wdiff)
Suggests: acroread gv ImageMagick psutils texinfo texlive-latex
PreReq: %{install_info_prereq}
Version: 4.14
Release: 0
Summary: Converts ASCII Text into PostScript
License: GPL-3.0+
Group: Productivity/Publishing/PS
Source: http://ftp.gnu.org/gnu/a2ps/%{name}-%{version}.tar.gz
Source1: a2ps-ko.po
Source2: a2ps-open
Patch: a2ps-4.14.diff
Patch1: a2ps-4.13-security.patch
Patch2: a2ps-4.14-ogonkify.patch
Patch3: a2ps-4.14-tempfile.patch
Patch6: a2ps-4.13-include.patch
Patch7: a2ps-4.14-acroread.patch
Patch8: a2ps-4.13-base.patch
Patch9: a2ps-4.13-utf8.patch
Patch10: a2ps-4.13-types.patch
Patch11: a2ps-4.13-psgen.patch
Patch13: a2ps-4.14-linker.patch
# PATCH-FIX-USTREAM Bug 871097 - CVE-2014-0466: a2ps: fixps does not use -dSAFER
Patch14: CVE-2014-0466.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
a2ps converts ASCII text into PostScript. This feature is used by
apsfilter, for example, to pretty-print ASCII text.
Warning: a2ps is not able to convert complex unicode (UTF-8) text to
PostScript. Only language text which can be converted from UTF-8 to
latin encodings are supported.
%package -n a2ps-devel
Summary: Library and header file for the interface of a2ps
Group: Development/Libraries/Other
Provides: a2ps:%{_libdir}/liba2ps.a
Requires: %{name} = %{version}
Requires: glibc-devel
%description -n a2ps-devel
a2ps converts ASCII text into PostScript. This feature is used by
apsfilter, for example, to pretty-print ASCII text.
Warning: a2ps is not able to convert complex unicode (UTF-8) text to
PostScript. Only language text which can be converted from UTF-8 to
latin encodings are supported.
%prep
%setup -q -n a2ps-4.14
touch -r configure.in .ref
%patch -P 1 -p 0 -b .security
%patch2 -p1
%patch3 -p1
%patch -P 6 -p 1 -b .incld
%ifarch %ix86 x86_64
%patch7 -p1
%endif
%patch -P 8 -p 0 -b .base
%patch -P 9 -p 0 -b .utf8
%patch -P 10 -p 0 -b .types
%patch -P 11 -p 0 -b .psgen
%patch13 -p1
%patch14 -p1
%patch -p1
cp -f %SOURCE1 po/ko.po
%build
#XXX: ugly hack; necessary??
cp /usr/share/automake-*/config.{guess,sub} auxdir/
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -funroll-loops -Wall -pipe -fstack-protector"
export LPR=lpr
export CC=gcc
touch -r .ref configure.in
%configure --enable-shared --disable-static --with-pic --with-medium=LC_PAPER \
--with-encoding=LC_CTYPE
con=""
for m4 in contrib/*.m4; do
in=${m4%.*}.in
rm -f ${in} ${m4%.*}
con="$con ${in##*/}"
done
make %{?_smp_mflags} -C contrib/ ${con}
sh ./config.status
make %{?_smp_mflags} PSFONT_PATH=%{_datadir}/ghostscript/fonts
pushd doc
texi2html a2ps.texi
popd
%install
make install DESTDIR=%{buildroot} PSFONT_PATH=%{_datadir}/ghostscript/fonts
rm -r %{buildroot}/%{_infodir}/regex*
rm -r %{buildroot}/%{_infodir}/dir
%{find_lang} %{name}
rm -f %{buildroot}%{_libdir}/liba2ps.la
install -m 0755 %{S:2} %{buildroot}/%{_bindir}/
%post
/sbin/ldconfig
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/ogonkify.info.gz
%postun
/sbin/ldconfig
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/ogonkify.info.gz
%files -f %{name}.lang
%defattr(-,root,root)
%doc AUTHORS COPYING ABOUT-NLS FAQ ChangeLog NEWS THANKS README doc/a2ps.html
%config %{_sysconfdir}/a2ps-site.cfg
%config %{_sysconfdir}/a2ps.cfg
%{_bindir}/a2ps
%{_bindir}/a2ps-open
%{_bindir}/card
%{_bindir}/composeglyphs
%{_bindir}/fixnt
%{_bindir}/fixps
%{_bindir}/ogonkify
%{_bindir}/pdiff
%{_bindir}/psmandup
%{_bindir}/psset
%{_bindir}/texi2dvi4a2ps
%doc %{_infodir}/*.gz
%doc %{_mandir}/man1/*.1.gz
%{_datadir}/a2ps
%{_datadir}/emacs/site-lisp/*.el
%{_datadir}/emacs/site-lisp/*.elc
%{_datadir}/ogonkify
%{_libdir}/liba2ps.so.*
%files -n a2ps-devel
%defattr(-,root,root)
%{_includedir}/liba2ps.h
%{_libdir}/liba2ps.so
%changelog