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