e54890
%define enable_japanese 1
e54890
e54890
Summary: Converts LaTeX documents to HTML
e54890
Name: latex2html
e54890
Version: 2018.2
e54890
Release: 2%{?dist}
e54890
License: GPLv2+
e54890
Group: Applications/Publishing
e54890
URL: http://www.latex2html.org/
e54890
# main latex2html source
e54890
Source0: http://mirrors.ctan.org/support/latex2html/%{name}-%{version}.tar.gz
e54890
Source1: cfgcache.pm
e54890
Source2: %{name}-manpages.tar.gz
e54890
# support for Japanese
e54890
Source3: http://takeno.iee.niit.ac.jp/~shige/TeX/latex2html/data2/l2h-2017-jp20180308.tar.gz
e54890
Patch0: latex2html-2K.1beta-tabularx.patch
e54890
Patch1: latex2html-2018.2-teTeX-l2h-config.patch
e54890
Patch4: latex2html-2002-2-1-SHLIB.patch
e54890
Patch5: latex2html-2002-2-1-gsfont.patch
e54890
Requires: tex(latex), tex(dvips), tex(url.sty), netpbm-progs
e54890
BuildRequires: perl-interpreter >= 5.003, perl-generators, ghostscript >= 4.03, netpbm-progs >= 9.21, tex(latex)
e54890
BuildArch: noarch
e54890
e54890
%description
e54890
LATEX2HTML is a converter written in Perl that converts LATEX
e54890
documents to HTML. This way e.g. scientific papers - primarily typeset
e54890
for printing - can be put on the Web for online viewing.
e54890
e54890
LATEX2HTML does also a good job in rapid web site deployment. These
e54890
pages are generated from a single LATEX source.
e54890
e54890
%prep
e54890
%setup -q -n %{name}-%{version} -c -a 0
e54890
e54890
pushd %{name}-%{version}
e54890
# patch latex2html to support tabularx environments better
e54890
%patch0 -p1 -b .tabularx
e54890
e54890
# Patch from Oliver Paukstadt <oliver.paukstadt@millenux.com>
e54890
%patch1 -p2 -b .config
e54890
e54890
# fix SHLIBDIR
e54890
%patch4 -p1 -b .shlib
e54890
e54890
# don't require the font directory to be ended with PATH/fonts
e54890
%patch5 -p1 -b .gsfont
e54890
e54890
# remove all platforms we don't need
e54890
for i in Dos Mac OS2 Win32; do
e54890
  rm -f L2hos/${i}.pm
e54890
done
e54890
rm -rf cweb2html
e54890
rm -f readme.hthtml
e54890
popd
e54890
e54890
%if %{enable_japanese}
e54890
cp -a %{name}-%{version} %{name}-%{version}JA
e54890
pushd %{name}-%{version}JA
e54890
tar fxz %{SOURCE3}
e54890
popd
e54890
%endif
e54890
e54890
%build
e54890
pushd %{name}-%{version}
e54890
cp %{SOURCE1} cfgcache.pm
e54890
tar fxz %{SOURCE2}
e54890
e54890
./configure	--program-prefix=%{?_program_prefix} \
e54890
		--prefix=%{_prefix} \
e54890
		--exec-prefix=%{_exec_prefix} \
e54890
		--bindir=%{_bindir} \
e54890
		--sbindir=%{_sbindir} \
e54890
		--sysconfdir=%{_sysconfdir} \
e54890
		--datadir=%{_datadir} \
e54890
		--includedir=%{_includedir} \
e54890
		--libdir=%{_datadir}/latex2html \
e54890
		--libexecdir=%{_libexecdir} \
e54890
		--localstatedir=%{_localstatedir} \
e54890
		--sharedstatedir=%{_sharedstatedir} \
e54890
		--mandir=%{_mandir} \
e54890
		--infodir=%{_infodir} \
e54890
		--shlibdir=%{_datadir}/latex2html \
e54890
		--with-texpath=%{_datadir}/texmf/tex/latex/html
e54890
e54890
perl -pi -e "s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm
e54890
make
e54890
popd
e54890
e54890
%if %{enable_japanese}
e54890
pushd %{name}-%{version}JA
e54890
sed s/latex2html/jlatex2html/g < %{SOURCE1} > cfgcache.pm
e54890
perl -pi -e "s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm
e54890
perl -pi -e "s,/usr/bin/latex,/usr/bin/platex," cfgcache.pm
e54890
e54890
./configure	--program-prefix=%{?_program_prefix} \
e54890
		--prefix=%{_prefix} \
e54890
		--exec-prefix=%{_exec_prefix} \
e54890
		--bindir=%{_bindir} \
e54890
		--sbindir=%{_sbindir} \
e54890
		--sysconfdir=%{_sysconfdir} \
e54890
		--datadir=%{_datadir} \
e54890
		--includedir=%{_includedir} \
e54890
		--libdir=%{_datadir}/jlatex2html \
e54890
		--libexecdir=%{_libexecdir} \
e54890
		--localstatedir=%{_localstatedir} \
e54890
		--sharedstatedir=%{_sharedstatedir} \
e54890
		--mandir=%{_mandir} \
e54890
		--infodir=%{_infodir} \
e54890
		--shlibdir=%{_datadir}/jlatex2html \
e54890
		--with-texpath=%{_datadir}/texmf/tex/latex/html
e54890
e54890
perl -pi -e "s,/usr/(share/)?lib,%{_datadir},;
e54890
	    s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
e54890
make
e54890
perl -pi -e "s,\\\$\{dd}pstoimg,\\\$\{dd}jpstoimg, ;
e54890
	    s,\\\$\{dd}texexpand,\\\$\{dd}jtexexpand," l2hconf.pm
e54890
e54890
for i in latex2html pstoimg texexpand ; do
e54890
	mv ${i} j${i}
e54890
done
e54890
popd
e54890
%endif
e54890
e54890
%install
e54890
pushd %{name}-%{version}
e54890
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
e54890
sed -i "s,%{buildroot},," l2hconf.pm
e54890
e54890
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,;
e54890
	    s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,;
e54890
	    s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,;
e54890
	    s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
e54890
	    s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html
e54890
e54890
make install
e54890
rm -rf %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig \
e54890
       %{buildroot}%{_datadir}/latex2html/docs/ \
e54890
       %{buildroot}%{_datadir}/latex2html/example/
e54890
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
e54890
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makemap
e54890
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makemap
e54890
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
e54890
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg
e54890
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/texexpand
e54890
sed -i "s,%{buildroot},," cfgcache.pm
e54890
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}';," cfgcache.pm
e54890
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
e54890
install -m0644 *.pm %{buildroot}%{_datadir}/latex2html
e54890
chmod +x %{buildroot}%{_datadir}/latex2html/makeseg/makeseg %{buildroot}%{_datadir}/latex2html/makemap
e54890
e54890
# install man pages
e54890
mkdir -p %{buildroot}%{_mandir}/man1
e54890
install -m0644 *.1 %{buildroot}%{_mandir}/man1
e54890
popd
e54890
e54890
# install japanese version
e54890
%if %{enable_japanese}
e54890
pushd %{name}-%{version}JA
e54890
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
e54890
perl -pi -e "s,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
e54890
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,;
e54890
	    s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,;
e54890
	    s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,;
e54890
	    s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
e54890
	    s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html
e54890
sed -i "s,%{buildroot},," l2hconf.pm
e54890
e54890
make install
e54890
rm -rf %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig \
e54890
       %{buildroot}%{_datadir}/jlatex2html/docs/ \
e54890
       %{buildroot}%{_datadir}/jlatex2html/example/
e54890
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
e54890
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makemap
e54890
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makemap 
e54890
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
e54890
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg
e54890
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand
e54890
sed -i "s,%{buildroot},," cfgcache.pm
e54890
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}JA';," cfgcache.pm
e54890
perl -pi -e "s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
e54890
install -m0644 *.pm %{buildroot}%{_datadir}/jlatex2html
e54890
chmod +x %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg %{buildroot}%{_datadir}/jlatex2html/makemap
e54890
popd
e54890
%endif
e54890
e54890
# do not clash with texlive, prefer url.sty from texlive instead
e54890
rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty
e54890
e54890
%post
e54890
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
e54890
e54890
%postun
e54890
[ -x %{_bindir}/texconfig-sys ] && %{_bindir}/texconfig-sys rehash 2> /dev/null || :
e54890
e54890
%check
e54890
make -C %{name}-%{version} check
e54890
%if %{enable_japanese}
e54890
make -C %{name}-%{version}JA check
e54890
%endif
e54890
e54890
%files
e54890
%doc latex2html-%{version}/{LICENSE,LICENSE.orig,README.md,FAQ,BUGS,docs,example}
e54890
%{_bindir}/latex2html
e54890
%{_bindir}/pstoimg
e54890
%{_bindir}/texexpand
e54890
%dir %{_datadir}/latex2html
e54890
%{_datadir}/latex2html/*
e54890
%dir %{_datadir}/texmf/tex/latex/html
e54890
%{_datadir}/texmf/tex/latex/html/*
e54890
e54890
%if %{enable_japanese}
e54890
%{_bindir}/jlatex2html
e54890
%{_bindir}/jpstoimg
e54890
%{_bindir}/jtexexpand
e54890
%dir %{_datadir}/jlatex2html
e54890
%{_datadir}/jlatex2html/*
e54890
%endif
e54890
e54890
%{_mandir}/man1/latex2html.*
e54890
%{_mandir}/man1/texexpand.*
e54890
%{_mandir}/man1/pstoimg.*
e54890
e54890
%changelog
e54890
* Fri Jun 22 2018 Than Ngo <than@redhat.com> - 2018.2-2
e54890
- update l2h-2017-jp20180308
e54890
e54890
* Fri Jun 22 2018 Than Ngo <than@redhat.com> - 2018.2-1
e54890
- update to 2018.2
e54890
- add check
e54890
e54890
* Thu Jun 14 2018 Than Ngo <than@redhat.com> - 2017.2-6
e54890
- fixed bz#1591144, buildroot issue
e54890
e54890
* Fri May 11 2018 Than Ngo <than@redhat.com> - 2017.2-5
e54890
- fixed FTBFS
e54890
e54890
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2017.2-4
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e54890
e54890
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2017.2-3
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e54890
e54890
* Wed Jul 12 2017 Ben Cotton <bcotton@fedoraproject.org> 2017.2-2
e54890
- Update Perl commands in spec file to use valid syntax
e54890
e54890
* Mon Jun 26 2017 Tom Callaway <spot@fedoraproject.org> 2017.2-1
e54890
- update to 2017.2
e54890
e54890
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2012-8
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e54890
e54890
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2012-7
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e54890
e54890
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012-6
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
e54890
e54890
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012-5
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
e54890
e54890
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012-4
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
e54890
e54890
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 2012-3
e54890
- Perl 5.18 rebuild
e54890
e54890
* Tue Jan 29 2013 Jindrich Novy <jnovy@redhat.com> 2012-2
e54890
- prefer url.sty from texlive (#904888)
e54890
e54890
* Wed Nov 21 2012 Jindrich Novy <jnovy@redhat.com> 2012-1
e54890
- update to latex2html 2012
e54890
- update URL
e54890
e54890
* Thu Nov 15 2012 Jindrich Novy <jnovy@redhat.com> 2008-8
e54890
- BR: netpbm-progs to fix build
e54890
e54890
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2008-7
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
e54890
e54890
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2008-6
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
e54890
e54890
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2008-5
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
e54890
e54890
* Fri Dec 11 2009 Jindrich Novy <jnovy@redhat.com> 2008-4
e54890
- require netpbm-progs
e54890
- review fixes (#225980):
e54890
  - include documentation
e54890
  - set executable bit for makeseg and makemap scripts
e54890
  - white-space spec correction
e54890
  - move docs and example directory to %%doc
e54890
  - nuke duplicated stuff
e54890
e54890
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2008-3
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
e54890
e54890
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2008-2
e54890
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
e54890
e54890
* Fri Jan 02 2009 Jindrich Novy <jnovy@redhat.com> 2008
e54890
- update to latex2html-2008
e54890
- license changed to GPL
e54890
- update japanese support to l2h-2K8-jp20081220
e54890
- update cfgcache.pm
e54890
- fix BR
e54890
e54890
* Mon Jan 07 2008 Jindrich Novy <jnovy@redhat.com> 2002.2.1-8
e54890
- fix post/postun scriptlets
e54890
e54890
* Wed Nov 29 2006 Jindrich Novy <jnovy@redhat.com> 2002.2.1-7
e54890
- add dist tag, fix BuildRoot
e54890
- fix typo in description
e54890
e54890
* Tue Jun 27 2006 Jindrich Novy <jnovy@redhat.com> 2002.2.1-6
e54890
- remove .pdvips patch
e54890
- man pages are now stored in tar.gz
e54890
- rebuilt
e54890
e54890
* Sun Jun 25 2006 Mamoru Tasaka <mtasaka@ioa.s.u-tokyo.ac.jp>
e54890
- fix BuildRequires to be rebuilt with mock (#191762)
e54890
- fix spec file scripts.
e54890
- update source files (use tar.gz with the date 20041025 and 2.1b1.6 Japanese patch)
e54890
e54890
* Fri Dec 09 2005 Jesse Keating <jkeating@redhat.com>
e54890
- rebuilt
e54890
e54890
* Thu Nov 24 2005 Jindrich Novy <jnovy@redhat.com> 2002.2.1-5
e54890
- fix path to rgb.txt, thanks to Ville Skyttä (#174089)
e54890
e54890
* Tue Jun 21 2005 Jindrich Novy <jnovy@redhat.com> 2002.2.1-4
e54890
- remove '\n' causing that pstoimg generates gray images
e54890
  (#161186, #127010), solution from Julius Smith
e54890
e54890
* Wed May  4 2005 Jindrich Novy <jnovy@redhat.com> 2002.2.1-3
e54890
- add latex2html, texexpand, pstoimg man pages (#60308)
e54890
e54890
* Tue May  3 2005 Jindrich Novy <jnovy@redhat.com> 2002.2.1-2
e54890
- run texhash in the %%post and %%postun phase (#156660)
e54890
e54890
* Tue Mar 15 2005 Jindrich Novy <jnovy@redhat.com> 2002.2.1-1
e54890
- create backups for patches
e54890
- update Source1
e54890
- BuildArchitectures -> BuildArch
e54890
- remove direct RPM_BUILD_ROOT links from l2hconf.pm
e54890
- fix bad interpreter name path in pstoimg, texexpand
e54890
- define --with-texpath explicitely
e54890
- remove Dos.pm, Mac.pm, OS2.pm, Win32.pm
e54890
- don't require the font directory to be ended with PATH/fonts
e54890
e54890
* Wed Dec 15 2004 MATSUURA Takanori <t-matsuu@sx-lx3.protein.net>
e54890
- Initial build.