diff --git a/SOURCES/html2ps-1.0b5-config.patch b/SOURCES/html2ps-1.0b5-config.patch new file mode 100644 index 0000000..49e959b --- /dev/null +++ b/SOURCES/html2ps-1.0b5-config.patch @@ -0,0 +1,19 @@ +diff -up html2ps-1.0b5/debian/config/html2psrc.config html2ps-1.0b5/debian/config/html2psrc +--- html2ps-1.0b5/debian/config/html2psrc.config 2008-04-19 00:34:31.000000000 +0200 ++++ html2ps-1.0b5/debian/config/html2psrc 2008-04-19 00:34:57.000000000 +0200 +@@ -5,14 +5,11 @@ + ImageMagick: 1; + PerlMagick: 1; + TeX: 1; ++ dvips: 1; + Ghostscript: 1; +- check: weblint; + libwww-perl: 1; + path: "/usr/bin"; + } +- paper { +- type: letter; +- } + hyphenation { + en { + file: "/usr/share/texmf-texlive/tex/generic/hyphen/hyphen.tex"; diff --git a/SOURCES/html2ps-1.0b5-xdg-open.patch b/SOURCES/html2ps-1.0b5-xdg-open.patch new file mode 100644 index 0000000..c23046c --- /dev/null +++ b/SOURCES/html2ps-1.0b5-xdg-open.patch @@ -0,0 +1,12 @@ +diff -up html2ps-1.0b5/contrib/xhtml2ps/xhtml2ps.xdg-open html2ps-1.0b5/contrib/xhtml2ps/xhtml2ps +--- html2ps-1.0b5/contrib/xhtml2ps/xhtml2ps.xdg-open 2008-04-18 23:33:50.000000000 +0200 ++++ html2ps-1.0b5/contrib/xhtml2ps/xhtml2ps 2008-04-18 23:34:05.000000000 +0200 +@@ -804,7 +804,7 @@ proc UT_Config {} { + array set stusr { + command "html2ps" + checker "weblint -x Netscape" +- viewer "ghostview -magstep -2 -a4" ++ viewer "xdg-open" + printcmd "lp" + filepcmd "exec cp" + orientation " " diff --git a/SOURCES/html2ps-1.0b7-Fix-perl-5.22-warnings.patch b/SOURCES/html2ps-1.0b7-Fix-perl-5.22-warnings.patch new file mode 100644 index 0000000..fde170a --- /dev/null +++ b/SOURCES/html2ps-1.0b7-Fix-perl-5.22-warnings.patch @@ -0,0 +1,61 @@ +From 9f2cd47563fc85bed30f5f4eb224d443b7e65c43 Mon Sep 17 00:00:00 2001 +From: Todd Lewis +Date: Thu, 15 Dec 2016 12:30:37 +0100 +Subject: [PATCH] Fix perl-5.22 warnings +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Unescaped literal left curly bracket and POSIX::tmpnam() are +deprecated and produce warnings since Perl 5.22. This patch fixes it. + +Signed-off-by: Petr Písař +--- + html2ps | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/html2ps b/html2ps +index a5f363d..6bcc0d1 100755 +--- a/html2ps ++++ b/html2ps +@@ -353,6 +353,7 @@ A:link, HR { color: black } + + EOR + ++use File::Temp qw/ tempfile /; + use POSIX; + $posix = 1; + +@@ -494,9 +495,8 @@ die "Ghostscript is required to generate DSC PostScript\n" + if($opt_D && !$package{'Ghostscript'}); + die "Ghostscript is required to generate cross references\n" + if($opt_R && !$package{'Ghostscript'}); +-$tmpname=$posix?POSIX::tmpnam():"h2p_$$"; +-sysopen TMP, $tmpname, O_RDWR|O_CREAT|O_EXCL, 0600 or die "$!"; +-close TMP; ++(undef,$tmpname)=tempfile(); ++die "$!" unless $tmpname; + ($scr=$tmpname)=~/\w+$/; + $tempdir=$`; + +@@ -3829,7 +3829,7 @@ sub DSC { + $temp=$'=~/\/P\d+_?\d* \{/?$`:$rest; + ($eps{$pid})=$temp=~/([\w\W]*)} D/; + } +- if(/\/DH {/) { ++ if(/\/DH \{/) { + $'=~/%EndDH/; + $ph="/DH {$`"; + } +@@ -4080,7 +4080,7 @@ sub inihyph { + } + if(open(HYPH,"<$hyfile")) { + &dbg("Reading hyphenation patterns from $hyfile\n") if($opt_d); +- =~/\\patterns{.*/; ++ =~/\\patterns\{.*/; + close HYPH; + $def=$`; + ($patterns=$')=~s/\^\^($X$X)/chr hex $1/eg; +-- +2.7.4 + diff --git a/SOURCES/html2ps-1.0b7-Remove-deprecated-variable.patch b/SOURCES/html2ps-1.0b7-Remove-deprecated-variable.patch new file mode 100644 index 0000000..0d795cf --- /dev/null +++ b/SOURCES/html2ps-1.0b7-Remove-deprecated-variable.patch @@ -0,0 +1,26 @@ +From cf9d76ef6b15bb31d86313e6b97ed13910908044 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Wed, 16 May 2012 14:40:41 +0200 +Subject: [PATCH] Remove deprecated $[ variable + +Usage of the variable is deprecated since perl 5.12 and it default to +0 either. See . +--- + html2ps | 1 - + 1 files changed, 0 insertions(+), 1 deletions(-) + +diff --git a/html2ps b/html2ps +index ba6bf3b..a5f363d 100755 +--- a/html2ps ++++ b/html2ps +@@ -3405,7 +3405,6 @@ sub Getopts { + local($optlist)=@_; + local(@args,$_,$opt,$opts,$rest,$olist,$plist,$found,@popts); + local($errs)=0; +- local($[)=0; + @args=split( /\|/, $optlist ); + for $opt (@args) { + if(substr($opt,-1,1) ne ':') {$olist.=$opt} +-- +1.7.7.6 + diff --git a/SOURCES/xhtml2ps.desktop b/SOURCES/xhtml2ps.desktop new file mode 100644 index 0000000..64601b5 --- /dev/null +++ b/SOURCES/xhtml2ps.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=X-html2ps +GenericName=html2ps frontend +Comment=GUI frontend for html2ps +Exec=xhtml2ps +Terminal=false +Type=Application +Categories=Utility; diff --git a/SPECS/html2ps.spec b/SPECS/html2ps.spec new file mode 100644 index 0000000..814d5fe --- /dev/null +++ b/SPECS/html2ps.spec @@ -0,0 +1,252 @@ +# Enable ImageMagick for converting images other than EPS and XBM +%if 0%{?rhel} +%bcond_with html2ps_enables_ImageMagick +%else +%bcond_without html2ps_enables_ImageMagick +%endif +# Otherwise handle JPEG images with djpeg +%bcond_without html2ps_enables_djpeg +# Otherwise handle images with netpbm +%bcond_without html2ps_enables_netpbm + +%define my_subversion b7 +Name: html2ps +Version: 1.0 +Release: 0.34.%{my_subversion}%{?dist} +Summary: HTML to PostScript converter +License: GPLv2+ +URL: http://user.it.uu.se/~jan/%{name}.html +Source0: http://user.it.uu.se/~jan/%{name}-1.0%{my_subversion}.tar.gz +Source1: xhtml2ps.desktop +Patch0: http://ftp.de.debian.org/debian/pool/main/h/%{name}/%{name}_1.0b5-5.diff.gz +# use xdg-open in xhtml2ps +Patch1: %{name}-1.0b5-xdg-open.patch +# patch config file from debian to use dvips, avoid using weblint +# don't set letter as default page type, paperconf will set the default +Patch2: %{name}-1.0b5-config.patch +# Remove deprecated variable, bug #822117 +Patch3: %{name}-1.0b7-Remove-deprecated-variable.patch +# Fix Perl 5.22 warnings, bug #1404275 +Patch4: html2ps-1.0b7-Fix-perl-5.22-warnings.patch +BuildArch: noarch +BuildRequires: coreutils +BuildRequires: desktop-file-utils +BuildRequires: glibc-common +BuildRequires: perl-generators +BuildRequires: perl-interpreter +BuildRequires: sed +Requires: ghostscript +# Depend on paperconf directly (instead of libpaper package) for rpmlint sake +Requires: %{_bindir}/paperconf +Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version)) +Requires: perl(HTTP::Cookies) +Requires: perl(HTTP::Request) +Requires: perl(LWP::UserAgent) +Requires: tex(dvips) +Requires: tex(tex) + +# Remove ImageMagick dependency if the feature is disabled +%if %{without html2ps_enables_ImageMagick} +%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Image::Magick\\) +%if %{with html2ps_enables_djpeg} +# libjpeg-turbo-utils for djpeg +Requires: libjpeg-turbo-utils +%endif +%if %{with html2ps_enables_netpbm} +Requires: netpbm-progs +%endif +%endif + +%description +An HTML to PostScript converter written in Perl. +* Many possibilities to control the appearance. +* Support for processing multiple documents. +* A table of contents can be generated. +* Configurable page headers/footers. +* Automatic hyphenation and text justification can be selected. + + +%package -n xhtml2ps +Summary: GUI front-end for html2ps +Requires: html2ps = %{version}-%{release} +Requires: xdg-utils + +%description -n xhtml2ps +X-html2ps is freely-available GUI front-end for html2ps, a HTML-to-PostScript +converter. + + +%prep +%setup -q -n %{name}-1.0%{my_subversion} +%patch0 -p1 +%patch1 -p1 -b .xdg-open +%patch2 -p1 -b .config +%patch3 -p1 -b .deprecated + +# convert README to utf8 +iconv -f latin1 -t utf8 < README > README.utf8 +touch -c -r README README.utf8 +mv README.utf8 README + +patch -p1 < debian/patches/01_manpages.dpatch +# 03_html2ps.dpatch is against 1.0b5, adjust it to 1.0b6 +< debian/patches/03_html2ps.dpatch sed -e 's|/opt/misc/|/it/sw/share/www/|' | \ + patch -p1 + +%patch4 -p1 + +%build +# Change default configuration +sed -i \ + -e 's/ImageMagick: [01]/ImageMagick: %{with html2ps_enables_ImageMagick}/' \ + -e 's/PerlMagick: [01]/PerlMagick: %{with html2ps_enables_ImageMagick}/' \ + debian/config/html2psrc +%if %{without html2ps_enables_ImageMagick} +sed -i \ + -e '/package {/ a \ \ \ \ djpeg: %{with html2ps_enables_djpeg};' \ + -e '/package {/ a \ \ \ \ netpbm: %{with html2ps_enables_netpbm};' \ + debian/config/html2psrc +%endif + + +%install +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir} +mkdir -p $RPM_BUILD_ROOT%{_bindir} +mkdir -p $RPM_BUILD_ROOT%{_mandir}/man{1,5} + +sed -e 's;/etc/html2psrc;%{_sysconfdir}/html2psrc;' \ + -e 's;/usr/share/doc/html2ps;%{_pkgdocdir};' \ + html2ps > $RPM_BUILD_ROOT%{_bindir}/html2ps +chmod 0755 $RPM_BUILD_ROOT%{_bindir}/html2ps +install -p -m0644 html2ps.1 $RPM_BUILD_ROOT%{_mandir}/man1 +install -p -m0644 html2psrc.5 $RPM_BUILD_ROOT%{_mandir}/man5 +sed -e 's;/usr/bin;%{_bindir};' \ + -e 's;/usr/share/texmf-texlive;%{_datadir}/texmf;' \ + debian/config/html2psrc > $RPM_BUILD_ROOT%{_sysconfdir}/html2psrc + +install -m0755 -p contrib/xhtml2ps/xhtml2ps $RPM_BUILD_ROOT%{_bindir} +desktop-file-install \ + --dir=${RPM_BUILD_ROOT}%{_datadir}/applications \ + %{SOURCE1} + + +%files +%license COPYING +%doc README sample html2ps.html +%config(noreplace) %{_sysconfdir}/html2psrc +%{_bindir}/html2ps +%{_mandir}/man1/html2ps.1* +%{_mandir}/man5/html2psrc.5* + +%files -n xhtml2ps +%license contrib/xhtml2ps/LICENSE +%doc contrib/xhtml2ps/README +%{_bindir}/xhtml2ps +%{_datadir}/applications/*xhtml2ps.desktop + +%changelog +* Thu Jul 25 2019 Fedora Release Engineering - 1.0-0.34.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Thu May 30 2019 Jitka Plesnikova - 1.0-0.33.b7 +- Perl 5.30 rebuild + +* Fri Feb 01 2019 Fedora Release Engineering - 1.0-0.32.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 1.0-0.31.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Wed Jun 27 2018 Jitka Plesnikova - 1.0-0.30.b7 +- Perl 5.28 rebuild + +* Tue Apr 10 2018 Petr Pisar - 1.0-0.29.b7 +- Disable ImageMagick on RHEL (bug #1564998) + +* Wed Feb 07 2018 Fedora Release Engineering - 1.0-0.28.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jul 27 2017 Petr Pisar - 1.0-0.27.b7 +- Remove deprecated Encoding entry from xhtml2ps desktop file + +* Wed Jul 26 2017 Fedora Release Engineering - 1.0-0.26.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sun Jun 04 2017 Jitka Plesnikova - 1.0-0.25.b7 +- Perl 5.26 rebuild + +* Fri Feb 10 2017 Fedora Release Engineering - 1.0-0.24.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Thu Dec 15 2016 Petr Pisar - 1.0-0.23.b7 +- Fix Perl 5.22 warnings (bug #1404275) + +* Sat May 14 2016 Jitka Plesnikova - 1.0-0.22.b7 +- Perl 5.24 rebuild + +* Wed Feb 03 2016 Fedora Release Engineering - 1.0-0.21.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 1.0-0.20.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Wed Jun 03 2015 Jitka Plesnikova - 1.0-0.19.b7 +- Perl 5.22 rebuild + +* Wed Aug 27 2014 Jitka Plesnikova - 1.0-0.18.b7 +- Perl 5.20 rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 1.0-0.17.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Tue Aug 27 2013 Petr Pisar - 1.0-0.16.b7 +- Documentation directory is unversioned now (bug #993842) + +* Sat Aug 03 2013 Fedora Release Engineering - 1.0-0.15.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Wed Jul 17 2013 Petr Pisar - 1.0-0.14.b7 +- Perl 5.18 rebuild + +* Wed Apr 24 2013 Jon Ciesla - 1.0-0.13.b7 +- Drop desktop vendor tag. + +* Thu Feb 14 2013 Fedora Release Engineering - 1.0-0.12.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Thu Jul 19 2012 Fedora Release Engineering - 1.0-0.11.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jun 08 2012 Petr Pisar - 1.0-0.10.b7 +- Perl 5.16 rebuild + +* Wed May 16 2012 Petr Pisar - 1.0-0.9.b7 +- Remove deprecated variable (bug #822117) +- Clean spec file +- Insert dependency on perl + +* Fri Jan 13 2012 Fedora Release Engineering - 1.0-0.8.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Wed Feb 09 2011 Fedora Release Engineering - 1.0-0.7.b7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri May 7 2010 Petr Pisar - 1.0-0.6.b7 +- 1.0b7 bump +- Increase revision to 0.6 to have NVR upper then F-13 package + +* Thu Apr 29 2010 Petr Pisar - 1.0-0.1.b6 +- 1.0b6 bump (CVE-2009-5067, bug #530403) +- Fix regression from upstream 1.0b5..1.0b6 +- Fix spelling +- Default attributes for xhtml2ps %%files +- Replace libpaper dependency with paperconf binary to make rpmlint happy + +* Fri Jul 24 2009 Fedora Release Engineering - 1.0-0.3.b5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Tue Feb 24 2009 Fedora Release Engineering - 1.0-0.2.b5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Apr 18 2008 Patrice Dumas 1.0-0.1.b5 +- initial release