Blame SPECS/latex2html.spec

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