diff --git a/.cvsignore b/.cvsignore
index e69de29..3a27699 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -0,0 +1,2 @@
+l2h-2002-2-1+jp2.0.patch.gz
+latex2html-2002-2-1.tar.bz2
diff --git a/cfgcache.pm b/cfgcache.pm
new file mode 100644
index 0000000..d8aa5e2
--- /dev/null
+++ b/cfgcache.pm
@@ -0,0 +1,76 @@
+# LaTeX2HTML site specific configuration file
+# generated by config.pl
+
+# You may edit this file to get around deficiencies of the configuration
+# procedure, but you have to be sure of what you are doing!
+# If you think there are bugs in the configuration procedure, please report
+# them. See the BUGS file on how to do it. Your help is appreciated!
+
+package cfgcache;
+require Exporter;
+@ISA = qw(Exporter);
+@EXPORT = qw(%cfg);
+
+$cfg{'BINDIR'} = q'/usr/bin';
+$cfg{'CRAYOLAFILE'} = q'/usr/share/latex2html/styles/crayola.txt';
+$cfg{'DVIPS'} = q'/usr/bin/dvips';
+$cfg{'DVIPSOPT'} = q' -E';
+$cfg{'GS'} = q'/usr/bin/gs';
+$cfg{'GSALIASDEVICE'} = q'ppmraw';
+$cfg{'GSDEVICE'} = q'pnmraw';
+$cfg{'GSLANDSCAPE'} = q'';
+$cfg{'GS_LIB'} = q'';
+$cfg{'HASHBANG'} = q'1';
+$cfg{'HTML_VALIDATOR'} = q'';
+$cfg{'ICONPATH'} = q'file:/usr/share/latex2html/icons';
+$cfg{'ICONSTORAGE'} = q'';
+$cfg{'IMAGE_TYPES'} = q'png gif';
+$cfg{'INITEX'} = q'/usr/bin/initex';
+$cfg{'KPSEWHICH'} = q'/usr/bin/kpsewhich';
+$cfg{'LATEX'} = q'/usr/bin/latex';
+$cfg{'LATEX2HTMLDIR'} = q'/usr/share/latex2html';
+$cfg{'LIBDIR'} = q'/usr/share/latex2html';
+$cfg{'METADPI'} = q'0';
+$cfg{'METAMODE'} = q'';
+$cfg{'MKTEXLSR'} = q'/usr/bin/mktexlsr';
+$cfg{'NULLFILE'} = q'/dev/null';
+$cfg{'PBMMAKE'} = q'/usr/bin/pbmmake';
+$cfg{'PERL'} = q'/usr/bin/perl';
+$cfg{'PERLFOOTER'} = q'';
+$cfg{'PERLHEADER'} = <<'EOQ';
+#! /usr/bin/perl -w
+EOQ
+$cfg{'PERLSCRIPTDIR'} = q'/usr/bin';
+$cfg{'PK_GENERATION'} = q'0';
+$cfg{'PNMCAT'} = q'/usr/bin/pnmcat';
+$cfg{'PNMCROP'} = q'/usr/bin/pnmcrop';
+$cfg{'PNMFILE'} = q'/usr/bin/pnmfile';
+$cfg{'PNMFLIP'} = q'/usr/bin/pnmflip';
+$cfg{'PNMTOPNG'} = q'/usr/bin/pnmtopng';
+$cfg{'PPMQUANT'} = q'/usr/bin/ppmquant';
+$cfg{'PPMTOGIF'} = q'/usr/bin/ppmtogif';
+$cfg{'PREFIX'} = q'/usr';
+$cfg{'RGBCOLORFILE'} = q'/usr/X11R6/lib/X11/rgb.txt';
+$cfg{'TEX'} = q'/usr/bin/tex';
+$cfg{'TEXPATH'} = q'/usr/share/texmf/tex/latex/html';
+$cfg{'TMPSPACE'} = q'/tmp';
+$cfg{'WEB2C'} = q'1';
+$cfg{'dd'} = q'/';
+$cfg{'distver'} = q'2K.1beta';
+$cfg{'exec_extension'} = q'';
+$cfg{'gif_interlace'} = q'netpbm';
+$cfg{'gif_trans'} = q'netpbm';
+$cfg{'have_dvipsmode'} = q'';
+$cfg{'have_geometry'} = q'1';
+$cfg{'have_images'} = q'1';
+$cfg{'have_pstoimg'} = q'1';
+$cfg{'perl_starter'} = q'';
+$cfg{'pipes'} = q'1';
+$cfg{'plat'} = q'unix';
+$cfg{'scriptdir'} = q'/usr/bin';
+$cfg{'scriptext'} = q'';
+$cfg{'srcdir'} = q'/X/tetex/teTeX-1.0/latex2html-2K.1beta';
+$cfg{'texlive'} = q'0';
+$cfg{'wrapper'} = q'0';
+
+1; # must be last line
diff --git a/latex2html-2002-2-1-SHLIB.patch b/latex2html-2002-2-1-SHLIB.patch
new file mode 100644
index 0000000..0165454
--- /dev/null
+++ b/latex2html-2002-2-1-SHLIB.patch
@@ -0,0 +1,20 @@
+--- latex2html-2002-2-1/config/config.pl.orig 2004-11-02 20:17:57.000000000 +0900
++++ latex2html-2002-2-1/config/config.pl 2004-11-02 20:48:22.024993493 +0900
+@@ -1915,12 +1915,12 @@
+ else {
+ # similar to the perl installation procedure, append latex2html only
+ # if it does not appear in the PREFIX
+- if($newcfg{'PREFIX'} =~ /l2h|latex2html/i) {
+- $newcfg{'SHLIBDIR'} = $newcfg{'PREFIX'};
+- }
+- else {
++# if($newcfg{'PREFIX'} =~ /l2h|latex2html/i) {
++# $newcfg{'SHLIBDIR'} = $newcfg{'PREFIX'};
++# }
++# else {
+ $newcfg{'SHLIBDIR'} = "$newcfg{'PREFIX'}${dd}share${dd}lib${dd}latex2html";
+- }
++# }
+ }
+ add_drive_letter($newcfg{'SHLIBDIR'});
+
diff --git a/latex2html-2002-2-1-gsfont.patch b/latex2html-2002-2-1-gsfont.patch
new file mode 100644
index 0000000..d098505
--- /dev/null
+++ b/latex2html-2002-2-1-gsfont.patch
@@ -0,0 +1,11 @@
+--- latex2html-2002-2-1/config/config.pl.gsfont 2002-09-28 07:15:01.000000000 +0200
++++ latex2html-2002-2-1/config/config.pl 2005-03-16 10:50:17.392513136 +0100
+@@ -1176,7 +1176,7 @@
+ push(@right_paths,L2hos->path2os($testpath));
+ $gs_lib = 1;
+ }
+- $testpath .= "${dd}fonts" unless($testpath =~ /\Q$dd\Efonts$/i);
++ $testpath .= "${dd}fonts" unless($testpath =~ /\Q$dd\Efonts/i);
+ if(!$gs_fonts && -d $testpath) {
+ push(@right_paths,L2hos->path2os($testpath));
+ $gs_fonts = 1;
diff --git a/latex2html-2K.1beta-DB.patch b/latex2html-2K.1beta-DB.patch
new file mode 100644
index 0000000..1f1ef64
--- /dev/null
+++ b/latex2html-2K.1beta-DB.patch
@@ -0,0 +1,11 @@
+--- teTeX-1.0/latex2html-2K.1beta/config/config.pl.DB Wed Jan 16 13:08:34 2002
++++ teTeX-1.0/latex2html-2K.1beta/config/config.pl Wed Jan 16 13:09:14 2002
+@@ -587,7 +587,7 @@
+
+ &checking('if perl supports some dbm');
+
+-use DB_File;
++use DB;
+ my %array;
+ unless(eval {dbmopen(%array,'DBMtest',0755)}) {
+ my $err = $@ || 'dbmopen failed';
diff --git a/latex2html-2K.1beta-tabularx.patch b/latex2html-2K.1beta-tabularx.patch
new file mode 100644
index 0000000..90ed3be
--- /dev/null
+++ b/latex2html-2K.1beta-tabularx.patch
@@ -0,0 +1,26 @@
+--- latex2html-2K.1beta/versions/table.pl.tabularx Fri Nov 14 11:10:52 1997
++++ latex2html-2K.1beta/versions/table.pl Wed Jan 24 15:11:01 2001
+@@ -121,6 +121,10 @@
+ $htmlcolspec .= "
";
+ push(@colspec,"$cellopen=RIGHT NOWRAP>$content_mark$cellclose");
+ $cols++;
++ } elsif ( $char eq "X" ) {
++ $htmlcolspec .= "";
++ push(@colspec,"$cellopen=LEFT>$content_mark$cellclose");
++ $cols++;
+ } elsif ( $char eq "p" ) {
+ $colspec =~ s/$next_pair_rx//;
+ ($pts,$len) = &convert_length($2);
+@@ -170,7 +174,11 @@
+ local($_) = @_;
+ s/$next_pair_rx//;
+ local($pts,$len) = &convert_length($2);
+- &do_env_tabular($_," width=$pts");
++ if ($pts != "") {
++ &do_env_tabular($_," width=$pts");
++ } else {
++ &do_env_tabular($_);
++ }
+ }
+
+ sub do_env_tabular {
diff --git a/latex2html.spec b/latex2html.spec
new file mode 100644
index 0000000..52d56b3
--- /dev/null
+++ b/latex2html.spec
@@ -0,0 +1,207 @@
+%define enable_japanese 1
+%define latex2html_ver 2002-2-1
+
+Summary: Converts LaTeX documents to HTML
+Name: latex2html
+Version: 2002.2.1
+Release: 1
+License: Free To Use But Restricted (See LICENSE)
+Group: Applications/Publishing
+URL: http://www.latex2html.org/
+Source0: http://saftsack.fs.uni-bayreuth.de/~latex2ht/current/%{name}-%{latex2html_ver}.tar.bz2
+Source1: cfgcache.pm
+Patch0: latex2html-2K.1beta-tabularx.patch
+Patch1: teTeX-l2h-config.patch
+Patch3: latex2html-2K.1beta-DB.patch
+Patch4: latex2html-2002-2-1-SHLIB.patch
+Patch5: latex2html-2002-2-1-gsfont.patch
+
+###
+# Japanization patches
+###
+Patch100: http://takeno.iee.niit.ac.jp/~shige/TeX/latex2html/data/l2h-2002-2-1+jp2.0.patch.gz
+Patch101: latex2html-2002.2.1-pdvips.patch
+
+Requires: tetex-latex, tetex-dvips
+BuildRequires: perl >= 5.003, ghostscript >= 4.03, netpbm >= 9.21
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
+BuildArch: noarch
+
+%description
+LATEX2HTML is a convertor written in Perl that converts LATEX
+documents to HTML. This way e.g. scientific papers - primarily typeset
+for printing - can be put on the Web for online viewing.
+
+LATEX2HTML does also a good job in rapid web site deployment. These
+pages are generated from a single LATEX source.
+
+%prep
+%setup -q -n %{name}-%{version} -c -a 0
+
+pushd %{name}-%{latex2html_ver}
+# patch latex2html to support tabularx environments better
+%patch0 -p1 -b .tabularx
+
+# Patch from Oliver Paukstadt
+%patch1 -p2 -b .config
+
+# Fix latex2html not to use DB_File
+%patch3 -p2 -b .db_file
+
+# fix SHLIBDIR
+%patch4 -p1 -b .shlib
+
+# don't require the font directory to be ended with PATH/fonts
+%patch5 -p1 -b .gsfont
+
+# remove all platforms we don't need
+for i in Dos Mac OS2 Win32; do
+ rm -f L2hos/${i}.pm
+done
+popd
+
+%if %{enable_japanese}
+cp -a %{name}-%{latex2html_ver} %{name}-%{latex2html_ver}JA
+pushd %{name}-%{latex2html_ver}JA
+# JA patches for latex2html.
+%patch100 -p1 -b .jp2
+%patch101 -p1 -b .pdvips
+popd
+%endif
+
+%build
+pushd %{name}-%{latex2html_ver}
+cp %{SOURCE1} cfgcache.pm
+
+./configure --program-prefix=%{?_program_prefix} \
+ --prefix=%{_prefix} \
+ --exec-prefix=%{_exec_prefix} \
+ --bindir=%{_bindir} \
+ --sbindir=%{_sbindir} \
+ --sysconfdir=%{_sysconfdir} \
+ --datadir=%{_datadir} \
+ --includedir=%{_includedir} \
+ --libdir=%{_libdir} \
+ --libexecdir=%{_libexecdir} \
+ --localstatedir=%{_localstatedir} \
+ --sharedstatedir=%{_sharedstatedir} \
+ --mandir=%{_mandir} \
+ --infodir=%{_infodir} \
+ --with-texpath=%{_datadir}/texmf/tex/latex/html
+
+perl -pi -e"s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm
+make
+popd
+
+%if %{enable_japanese}
+pushd %{name}-%{latex2html_ver}JA
+sed s/latex2html/jlatex2html/g < %{SOURCE1} > cfgcache.pm
+perl -pi -e"s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm
+
+./configure --program-prefix=%{?_program_prefix} \
+ --prefix=%{_prefix} \
+ --exec-prefix=%{_exec_prefix} \
+ --bindir=%{_bindir} \
+ --sbindir=%{_sbindir} \
+ --sysconfdir=%{_sysconfdir} \
+ --datadir=%{_datadir} \
+ --includedir=%{_includedir} \
+ --libdir=%{_libdir} \
+ --libexecdir=%{_libexecdir} \
+ --localstatedir=%{_localstatedir} \
+ --sharedstatedir=%{_sharedstatedir} \
+ --mandir=%{_mandir} \
+ --infodir=%{_infodir} \
+ --with-texpath=%{_datadir}/texmf/tex/latex/html
+
+perl -pi -e"s,/usr/(share/)?lib,%{_datadir},;
+ s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
+make
+perl -pi -e"s,${RPM_BUILD_ROOT},," l2hconf.pm
+for i in latex2html pstoimg texexpand ; do
+ mv ${i} j${i}
+done
+popd
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+pushd %{name}-%{latex2html_ver}
+perl -pi -e"s,%{_bindir},${RPM_BUILD_ROOT}%{_bindir},;
+ s,%{_datadir}/latex2html,${RPM_BUILD_ROOT}%{_datadir}/latex2html,;
+ s,%{_datadir}/texmf,${RPM_BUILD_ROOT}%{_datadir}/texmf," cfgcache.pm
+perl -pi -e"s,%{_builddir}/latex2html-%{latex2html_ver}\${dd}tetexexpand,%{_bindir}/texexpand,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}\${dd}pstoimg,%{_bindir}/pstoimg,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}\${dd}icons,\${LATEX2HTMLDIR}/icons,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}\${dd}styles\${dd}rgb.txt,\${LATEX2HTMLDIR}/styles/rgb.txt,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}\${dd}styles\${dd}crayola.txt,\${LATEX2HTMLDIR}/styles/crayola.txt," latex2html
+perl -pi -e"s,$RPM_BUILD_ROOT,," l2hconf.pm
+
+make install
+rm -f %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig
+perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_datadir}/latex2html/cfgcache.pm
+perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_bindir}/pstoimg
+perl -pi -e"s,$RPM_BUILD_ROOT,," %{buildroot}%{_bindir}/texexpand
+perl -pi -e"s,$RPM_BUILD_ROOT,," cfgcache.pm
+perl -pi -e"s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
+install -m0644 *.pm %{buildroot}%{_datadir}/latex2html
+popd
+
+%if %{enable_japanese}
+pushd %{name}-%{latex2html_ver}JA
+perl -pi -e"s,%{_bindir},${RPM_BUILD_ROOT}%{_bindir},;
+ s,%{_datadir}/jlatex2html,${RPM_BUILD_ROOT}%{_datadir}/jlatex2html,;
+ s,%{_datadir}/texmf,${RPM_BUILD_ROOT}%{_datadir}/texmf," cfgcache.pm
+perl -pi -e"s,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
+perl -pi -e"s,%{_builddir}/latex2html-%{latex2html_ver}JA\${dd}tetexexpand,%{_bindir}/texexpand,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}JA\${dd}pstoimg,%{_bindir}/pstoimg,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}JA\${dd}icons,\${LATEX2HTMLDIR}/icons,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}JA\${dd}styles\${dd}rgb.txt,\${LATEX2HTMLDIR}/styles/rgb.txt,;
+ s,%{_builddir}/latex2html-%{latex2html_ver}JA\${dd}styles\${dd}crayola.txt,\${LATEX2HTMLDIR}/styles/crayola.txt," latex2html
+perl -pi -e"s,$RPM_BUILD_ROOT,," l2hconf.pm
+
+make install
+rm -f %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig
+perl -pi -e"s,$RPM_BUILD_ROOT,," cfgcache.pm
+perl -pi -e"s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm
+install -m0644 *.pm %{buildroot}%{_datadir}/jlatex2html
+popd
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+
+%files
+%defattr(-,root,root,-)
+%doc
+ /usr/bin/latex2html
+ /usr/bin/pstoimg
+ /usr/bin/texexpand
+%dir %{_datadir}/latex2html
+%{_datadir}/latex2html/*
+%dir %{_datadir}/texmf/tex/latex/html
+%{_datadir}/texmf/tex/latex/html/*
+
+%if %{enable_japanese}
+ /usr/bin/jlatex2html
+ /usr/bin/jpstoimg
+ /usr/bin/jtexexpand
+%dir %{_datadir}/jlatex2html
+%{_datadir}/jlatex2html/*
+%endif
+
+%changelog
+* Fri Mar 15 2005 Jindrich Novy 2002.2.1-1
+- create backups for patches
+- update Source1
+- BuildArchitectures -> BuildArch
+- remove direct RPM_BUILD_ROOT links from l2hconf.pm
+- fix bad interpreter name path in pstoimg, texexpand
+- define --with-texpath explicitely
+- remove Dos.pm, Mac.pm, OS2.pm, Win32.pm
+- don't require the font directory to be ended with PATH/fonts
+
+* Wed Dec 15 2004 MATSUURA Takanori
+- Initial build.
diff --git a/sources b/sources
index e69de29..58b2c9e 100644
--- a/sources
+++ b/sources
@@ -0,0 +1,2 @@
+0b44186e870fa5790205231cbab0f789 l2h-2002-2-1+jp2.0.patch.gz
+e8374264303f56ef66c97ec2392eccbe latex2html-2002-2-1.tar.bz2
diff --git a/teTeX-l2h-config.patch b/teTeX-l2h-config.patch
new file mode 100644
index 0000000..9d245eb
--- /dev/null
+++ b/teTeX-l2h-config.patch
@@ -0,0 +1,10 @@
+--- teTeX-1.0/latex2html-2K.1beta/config/config.pl.orig Fri May 4 12:26:45 2001
++++ teTeX-1.0/latex2html-2K.1beta/config/config.pl Fri May 4 12:27:11 2001
+@@ -566,6 +566,7 @@
+
+ &checking('if perl supports some dbm');
+
++use DB_File;
+ my %array;
+ unless(eval {dbmopen(%array,'DBMtest',0755)}) {
+ my $err = $@ || 'dbmopen failed';