Blame SPECS/latex2html.spec

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