11064fa
%define enable_japanese 1
11064fa
%define latex2html_ver	2002-2-1
11064fa
11064fa
Summary: Converts LaTeX documents to HTML
11064fa
Name: latex2html
11064fa
Version: 2002.2.1
b0b0a93
Release: 7%{?dist}
11064fa
License: Free To Use But Restricted (See LICENSE)
11064fa
Group: Applications/Publishing
11064fa
URL: http://www.latex2html.org/
c57b5c0
Source0: http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/%{name}-%{latex2html_ver}.tar.gz
11064fa
Source1: cfgcache.pm
c57b5c0
Source2: %{name}-manpages.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
11064fa
11064fa
###
11064fa
# Japanization patches
11064fa
###
c57b5c0
Patch100: http://takeno.iee.niit.ac.jp/~shige/TeX/latex2html/current/data/l2h-2K2-2-1+jp2.1b1.6.patch.gz
11064fa
11064fa
Requires: tetex-latex, tetex-dvips
c57b5c0
BuildRequires: perl >= 5.003, ghostscript >= 4.03, netpbm >= 9.21, tetex-latex
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
11064fa
pushd %{name}-%{latex2html_ver}
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
11064fa
popd
11064fa
11064fa
%if %{enable_japanese}
11064fa
cp -a %{name}-%{latex2html_ver} %{name}-%{latex2html_ver}JA
11064fa
pushd %{name}-%{latex2html_ver}JA
11064fa
# JA patches for latex2html.
11064fa
%patch100 -p1 -b .jp2
11064fa
popd
11064fa
%endif
11064fa
c57b5c0
pushd %{name}-%{latex2html_ver}
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
11064fa
pushd %{name}-%{latex2html_ver}
11064fa
cp %{SOURCE1} cfgcache.pm
c57b5c0
tar fxz %{SOURCE2}
11064fa
11064fa
./configure  --program-prefix=%{?_program_prefix} \
11064fa
             --prefix=%{_prefix} \
11064fa
             --exec-prefix=%{_exec_prefix} \
11064fa
             --bindir=%{_bindir} \
11064fa
             --sbindir=%{_sbindir} \
11064fa
             --sysconfdir=%{_sysconfdir} \
11064fa
             --datadir=%{_datadir} \
11064fa
             --includedir=%{_includedir} \
c57b5c0
             --libdir=%{_datadir}/latex2html \
11064fa
             --libexecdir=%{_libexecdir} \
11064fa
             --localstatedir=%{_localstatedir} \
11064fa
             --sharedstatedir=%{_sharedstatedir} \
11064fa
             --mandir=%{_mandir} \
11064fa
             --infodir=%{_infodir} \
c57b5c0
	     --shlibdir=%{_datadir}/latex2html \
11064fa
	     --with-texpath=%{_datadir}/texmf/tex/latex/html
11064fa
 
11064fa
perl -pi -e"s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm
11064fa
make
11064fa
popd
11064fa
11064fa
%if %{enable_japanese}
11064fa
pushd %{name}-%{latex2html_ver}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
11064fa
./configure  --program-prefix=%{?_program_prefix} \
11064fa
             --prefix=%{_prefix} \
11064fa
             --exec-prefix=%{_exec_prefix} \
11064fa
             --bindir=%{_bindir} \
11064fa
             --sbindir=%{_sbindir} \
11064fa
             --sysconfdir=%{_sysconfdir} \
11064fa
             --datadir=%{_datadir} \
11064fa
             --includedir=%{_includedir} \
c57b5c0
             --libdir=%{_datadir}/jlatex2html \
11064fa
             --libexecdir=%{_libexecdir} \
11064fa
             --localstatedir=%{_localstatedir} \
11064fa
             --sharedstatedir=%{_sharedstatedir} \
11064fa
             --mandir=%{_mandir} \
11064fa
             --infodir=%{_infodir} \
c57b5c0
	     --shlibdir=%{_datadir}/jlatex2html \
11064fa
	     --with-texpath=%{_datadir}/texmf/tex/latex/html
11064fa
11064fa
perl -pi -e"s,/usr/(share/)?lib,%{_datadir},;
11064fa
            s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
11064fa
make
11064fa
perl -pi -e"s,${RPM_BUILD_ROOT},," l2hconf.pm
c57b5c0
perl -pi -e"s,\\\${dd}pstoimg,\\\${dd}jpstoimg, ;
c57b5c0
	   s,\\\${dd}texexpand,\\\${dd}jtexexpand," l2hconf.pm
c57b5c0
11064fa
for i in latex2html pstoimg texexpand ; do
11064fa
  mv ${i} j${i}
11064fa
done
11064fa
popd
11064fa
%endif
11064fa
11064fa
%install
11064fa
rm -rf $RPM_BUILD_ROOT
11064fa
11064fa
pushd %{name}-%{latex2html_ver}
c57b5c0
perl -pi -e"s,%{_prefix},${RPM_BUILD_ROOT}%{_prefix}," cfgcache.pm
c57b5c0
perl -pi -e"s,/.*\\\${dd}texexpand,%{_bindir}/texexpand,;
c57b5c0
            s,/.*\\\${dd}pstoimg,%{_bindir}/pstoimg,;
c57b5c0
            s,/.*\\\${dd}*icons,\\\${LATEX2HTMLDIR}/icons,;
c57b5c0
            s,/.*\\\${dd}rgb.txt,\\\${LATEX2HTMLDIR}/styles/rgb.txt,;
c57b5c0
            s,/.*\\\${dd}styles\\\${dd}crayola.txt,\\\${LATEX2HTMLDIR}/styles/crayola.txt," latex2html
11064fa
perl -pi -e"s,$RPM_BUILD_ROOT,," l2hconf.pm
11064fa
11064fa
make install
11064fa
rm -f %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig
11064fa
perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_datadir}/latex2html/cfgcache.pm
11064fa
perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_bindir}/pstoimg
11064fa
perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_bindir}/texexpand
11064fa
perl -pi -e"s,$RPM_BUILD_ROOT,," 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
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}
11064fa
pushd %{name}-%{latex2html_ver}JA
c57b5c0
perl -pi -e"s,%{_prefix},${RPM_BUILD_ROOT}%{_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,;
c57b5c0
            s,/.*\\\${dd}pstoimg,%{_bindir}/jpstoimg,;
c57b5c0
            s,/.*\\\${dd}icons,\\\${LATEX2HTMLDIR}/icons,;
c57b5c0
            s,/.*\\\${dd}styles\\\${dd}rgb.txt,\\\${LATEX2HTMLDIR}/styles/rgb.txt,;
c57b5c0
            s,/.*\\\${dd}styles\\\${dd}crayola.txt,\\\${LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html
11064fa
perl -pi -e"s,$RPM_BUILD_ROOT,," l2hconf.pm
11064fa
11064fa
make install
11064fa
rm -f %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig
c57b5c0
perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_datadir}/jlatex2html/cfgcache.pm
c57b5c0
perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_bindir}/jpstoimg
c57b5c0
perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_bindir}/jtexexpand
11064fa
perl -pi -e"s,$RPM_BUILD_ROOT,," 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
11064fa
popd
11064fa
%endif
11064fa
c57b5c0
for f in cweb2html/cweb2html makeseg/makeseg makemap ; do
c57b5c0
   perl -pi -e "s,/usr/local/bin/perl,/usr/bin/perl," $RPM_BUILD_ROOT%{_datadir}/latex2html/$f
c57b5c0
%if %{enable_japanese}
c57b5c0
   perl -pi -e "s,/usr/local/bin/perl,/usr/bin/perl," $RPM_BUILD_ROOT%{_datadir}/jlatex2html/$f
c57b5c0
%endif
c57b5c0
done
c57b5c0
11064fa
%clean
11064fa
rm -rf $RPM_BUILD_ROOT
11064fa
54b241f
%post
54b241f
[ -x %{_bindir}/texhash ] && /usr/bin/env - %{_bindir}/texhash 2> /dev/null
54b241f
exit 0
54b241f
54b241f
%postun
54b241f
[ -x %{_bindir}/texhash ] && /usr/bin/env - %{_bindir}/texhash 2> /dev/null
54b241f
exit 0
11064fa
11064fa
%files
11064fa
%defattr(-,root,root,-)
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
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
11064fa
* Fri 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.