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