File enscript.spec of Package enscript

# spec file for package enscript
# Copyright (c) 2013 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

Name:           enscript
BuildRequires:  automake
%if %suse_version >= 1230
BuildRequires:  makeinfo
Provides:       genscript
Provides:       nenscrip
Requires:       /bin/sed
Requires:       /usr/bin/file
Requires:       /usr/bin/iconv
Requires:       ghostscript-fonts-std
PreReq:         %install_info_prereq
Version:        1.6.4
Release:        0
Summary:        An ASCII to PostScript(tm) Converter
License:        GPL-2.0+
Group:          Productivity/Publishing/PS
Source:         enscript-%{version}.tar.bz2
Patch:          enscript-%{version}.dif
Patch1:         enscript-1.6.4-CAN-2004-1184.patch
Patch2:         enscript-1.6.4-CAN-2004-1185.patch
Patch3:         enscript-1.6.4-CAN-2004-1186.patch
Patch4:         enscript-1.6.4-CVE-2008-3863.patch
Patch5:         enscript-1.6.4-perl_parens.patch
Patch6:         enscript-1.6.4-sh_string.patch
Patch7:         enscript-1.6.4-fdleak.patch
Patch8:         enscript-automake.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

Enscript converts ASCII files to PostScript and writes the generated
output to a file or sends it directly to the printer.

The Enscript configuration file is in /etc/enscript.cfg.

Warning: enscript 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 with the help of a wrapper script. ~ ~

%setup -q
%patch -P 1 -p 1 -b .CAN-2004-1184
%patch -P 2 -p 1 -b .CAN-2004-1185
%patch -P 3 -p 1 -b .CAN-2004-1186
%patch -P 4 -p 0 -b .CVE-2008-3863
%patch -P 5 -p 0 -b .perl
%patch -P 6 -p 0 -b .shell
%patch -P 7 -p 0 -b .fdleak
%patch -P 8 -p 1

  CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -funroll-loops -Wall -fno-strict-aliasing -pipe -fstack-protector"
  AUTOPOINT=true autoreconf --force --install
  test ! -f po/Makevars.template || mv po/Makevars.template po/Makevars
  %configure \
	--with-media=LC_PAPER \
  pushd lib/
    make -f Makefile-encodings %{?_smp_mflags}
  pushd afmlib/
    make -f Makefile-encodings %{?_smp_mflags}
  make CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" %{?_smp_mflags}

  make install DESTDIR=$RPM_BUILD_ROOT
  ln -sf enscript   $RPM_BUILD_ROOT/usr/bin/genscript
  ln -sf enscript.1 $RPM_BUILD_ROOT%{_mandir}/man1/genscript.1
  mkdir   -p -m 0755         $RPM_BUILD_ROOT%{_datadir}/ghostscript/fonts
  install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/ghostscript/fonts/
  mv $RPM_BUILD_ROOT/usr/bin/enscript $RPM_BUILD_ROOT/usr/bin/enscript.bin
  install -m 0755 %{SOURCE2}          $RPM_BUILD_ROOT/usr/bin/enscript
%find_lang %{name}

%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz

%files -f %{name}.lang
%doc docs/ChangeLog docs/FAQ.html
%config /etc/enscript.cfg
%doc %{_mandir}/man1/diffpp.1.gz
%doc %{_mandir}/man1/enscript.1.gz
%doc %{_mandir}/man1/genscript.1.gz
%doc %{_mandir}/man1/sliceprint.1.gz
%doc %{_mandir}/man1/states.1.gz
%dir /usr/share/ghostscript
%dir /usr/share/ghostscript/fonts
%doc %{_infodir}/%{name}.info.gz

openSUSE Build Service is sponsored by