11064fa
%define enable_japanese 1
11064fa
11064fa
Summary: Converts LaTeX documents to HTML
11064fa
Name: latex2html
b304f75
Version: 2018.2
87ef112
Release: 3%{?dist}
7390da9
License: GPLv2+
11064fa
Group: Applications/Publishing
11064fa
URL: http://www.latex2html.org/
7390da9
# main latex2html source
6e1b9ad
Source0: http://mirrors.ctan.org/support/latex2html/%{name}-%{version}.tar.gz
11064fa
Source1: cfgcache.pm
c57b5c0
Source2: %{name}-manpages.tar.gz
7390da9
# support for Japanese
055703f
Source3: http://takeno.iee.niit.ac.jp/~shige/TeX/latex2html/data2/l2h-2017-jp20180308.tar.gz
11064fa
Patch0: latex2html-2K.1beta-tabularx.patch
b304f75
Patch1: latex2html-2018.2-teTeX-l2h-config.patch
11064fa
Patch4: latex2html-2002-2-1-SHLIB.patch
11064fa
Patch5: latex2html-2002-2-1-gsfont.patch
87ef112
Patch6: latex2html-issue48-1.patch
87ef112
Patch7: latex2html-issue48-2.patch
07610a8
Requires: tex(latex), tex(dvips), tex(url.sty), netpbm-progs
4eb6c98
BuildRequires: perl-interpreter >= 5.003, perl-generators, ghostscript >= 4.03, netpbm-progs >= 9.21, tex(latex)
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 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
87ef112
# Patch Perl compatibility. Fixes are upstream but not yet released
87ef112
%patch6 -p1
87ef112
%patch7 -p1
87ef112
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
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
4d0e086
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
4d0e086
perl -pi -e "s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm
4d0e086
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
4d0e086
perl -pi -e "s,/usr/(share/)?lib,%{_datadir},;
3368585
	    s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
11064fa
make
4d0e086
perl -pi -e "s,\\\$\{dd}pstoimg,\\\$\{dd}jpstoimg, ;
f5689d9
	    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
7390da9
pushd %{name}-%{version}
4d0e086
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
4d0e086
sed -i "s,%{buildroot},," l2hconf.pm
4d0e086
4d0e086
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,;
f5689d9
	    s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,;
f5689d9
	    s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,;
f5689d9
	    s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
f5689d9
	    s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html
11064fa
11064fa
make install
4d0e086
rm -rf %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig \
4d0e086
       %{buildroot}%{_datadir}/latex2html/docs/ \
4d0e086
       %{buildroot}%{_datadir}/latex2html/example/
4d0e086
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
4d0e086
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makemap
4d0e086
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makemap
4d0e086
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
4d0e086
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg
4d0e086
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/texexpand
4d0e086
sed -i "s,%{buildroot},," cfgcache.pm
4d0e086
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}';," cfgcache.pm
4d0e086
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
4d0e086
# install japanese version
11064fa
%if %{enable_japanese}
7390da9
pushd %{name}-%{version}JA
4d0e086
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
4d0e086
perl -pi -e "s,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
4d0e086
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,;
f5689d9
	    s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,;
f5689d9
	    s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,;
f5689d9
	    s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
f5689d9
	    s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html
4d0e086
sed -i "s,%{buildroot},," l2hconf.pm
11064fa
11064fa
make install
4d0e086
rm -rf %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig \
4d0e086
       %{buildroot}%{_datadir}/jlatex2html/docs/ \
4d0e086
       %{buildroot}%{_datadir}/jlatex2html/example/
4d0e086
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
4d0e086
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makemap
4d0e086
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makemap 
4d0e086
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
4d0e086
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg
4d0e086
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand
4d0e086
sed -i "s,%{buildroot},," cfgcache.pm
4d0e086
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}JA';," cfgcache.pm
4d0e086
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
07610a8
# do not clash with texlive, prefer url.sty from texlive instead
07610a8
rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty
07610a8
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
b304f75
%check
b304f75
make -C %{name}-%{version} check
b304f75
%if %{enable_japanese}
b304f75
make -C %{name}-%{version}JA check
b304f75
%endif
b304f75
11064fa
%files
6e1b9ad
%doc latex2html-%{version}/{LICENSE,LICENSE.orig,README.md,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
87ef112
* Fri Jul 07 2018 Ben Cotton <bcotton@fedoraproject.org> - 2018.2-3
87ef112
- Add patch to fix bz#1582267 (upstream issue 48) until next upstream release
87ef112
055703f
* Fri Jun 22 2018 Than Ngo <than@redhat.com> - 2018.2-2
055703f
- update l2h-2017-jp20180308
055703f
b304f75
* Fri Jun 22 2018 Than Ngo <than@redhat.com> - 2018.2-1
b304f75
- update to 2018.2
b304f75
- add check
b304f75
4d0e086
* Thu Jun 14 2018 Than Ngo <than@redhat.com> - 2017.2-6
4d0e086
- fixed bz#1591144, buildroot issue
4d0e086
a79b64e
* Fri May 11 2018 Than Ngo <than@redhat.com> - 2017.2-5
a79b64e
- fixed FTBFS
a79b64e
39d636c
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2017.2-4
39d636c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
39d636c
0d038a9
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2017.2-3
0d038a9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0d038a9
f5689d9
* Wed Jul 12 2017 Ben Cotton <bcotton@fedoraproject.org> 2017.2-2
f5689d9
- Update Perl commands in spec file to use valid syntax
f5689d9
6e1b9ad
* Mon Jun 26 2017 Tom Callaway <spot@fedoraproject.org> 2017.2-1
6e1b9ad
- update to 2017.2
6e1b9ad
e6f2ae0
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2012-8
e6f2ae0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
e6f2ae0
6cbc26a
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2012-7
6cbc26a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6cbc26a
6cc86be
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012-6
6cc86be
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6cc86be
0291659
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012-5
0291659
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
0291659
0525588
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2012-4
0525588
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
0525588
e9c6a14
* Wed Jul 17 2013 Petr Pisar <ppisar@redhat.com> - 2012-3
e9c6a14
- Perl 5.18 rebuild
e9c6a14
07610a8
* Tue Jan 29 2013 Jindrich Novy <jnovy@redhat.com> 2012-2
07610a8
- prefer url.sty from texlive (#904888)
07610a8
01c890e
* Wed Nov 21 2012 Jindrich Novy <jnovy@redhat.com> 2012-1
01c890e
- update to latex2html 2012
01c890e
- update URL
01c890e
882008b
* Thu Nov 15 2012 Jindrich Novy <jnovy@redhat.com> 2008-8
882008b
- BR: netpbm-progs to fix build
882008b
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
6e1b9ad
* 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.