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