Package latex2html: Specfile

Name: latex2html
Version: 2020.2
Release: alt1
Summary: LaTeX to HTML converter
License: GPLv2
Group: Publishing
Url: http://saftsack.fs.uni-bayreuth.de/~latex2ht
BuildArch: noarch

# https://github.com/latex2html/latex2html.git
Source: %name-%version.tar
Patch3: latex2html-2002-path.patch
Patch4: latex2html-2002-alt-perl-path.patch
Patch5: latex2html-2002-alt-perl-syntax.patch
Patch7: latex2html-2020-alt-perlpath.patch

Patch31: latex2html-2017.2-alt-perl-compat.patch

Requires: /usr/bin/latex /usr/bin/dvips
Requires: netpbm

# note that gs is required by tetex-dvips
Requires: %_bindir/gs
BuildRequires: %_bindir/gs %_bindir/dvipdf

BuildRequires(pre): rpm-build-tex
# Automatically added by buildreq on Thu Mar 27 2008
BuildRequires: netpbm perl-DBM texlive-collection-basic texlive-collection-latexrecommended

%description
Elaborate perl program to convert latex documents to html,
using LaTeX to process images and equations.

%prep
%setup -q
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch7 -p1
#patch31 -p1

%build
%define _perl_lib_path %_datadir/%name
%add_findprov_skiplist %_datadir/%name/versions/*.pl

TMP=/tmp ./configure --with-gs=%_bindir/gs \
	--with-texpath=%_datadir/texmf/tex/ \
	--without-mktexlsr \
	--with-perl=%_bindir/perl \
	--prefix=%prefix \
	--libdir=%_datadir/%name \
	--shlibdir=%_datadir/%name \
	#

%make_build

cd ./docs
TEXINPUTS=.:../texinputs: latex manual
TEXINPUTS=.:../texinputs: latex manual
make
make manual.ps
bzip2 -9f manual.ps

%install
# custom "make install" so paths are proper in the perl programs

mkdir -p %buildroot%_bindir
install -p -m755 %name pstoimg texexpand %buildroot%_bindir/

mkdir -p %buildroot%_datadir/%name
cp -avRf \
	IndicTeX-HTML L2hos.pm L2hos XyMTeX-HTML cweb2html docs example foilhtml icons makeseg styles texinputs versions \
	cfgcache.pm dot.latex2html-init l2hconf.pm makemap \
	%buildroot%_datadir/%name/

mkdir -p %buildroot%_datadir/texmf/tex/latex/html
cp -avRf texinputs/* %buildroot%_datadir/texmf/tex/latex/html

# this russian style is subject to bNOPNYA
rm %buildroot%_datadir/%name/styles/russian.perl

# fix perl path in a few places:
sed -i '1s|/usr/local/bin/|/usr/bin/|' \
	%buildroot%_datadir/%name/cweb2html/cweb2html \
	%buildroot%_datadir/%name/cweb2html/makemake.pl \
	%buildroot%_datadir/%name/makeseg/makeseg

%files
%_bindir/*
%_datadir/%name/
%_datadir/texmf/tex/latex/html
%doc Changes FAQ LICENSE LICENSE.orig README.md TODO BUGS INSTALL dot.latex2html-init example docs/manual.ps.bz2

%changelog
* Wed Oct 07 2020 Igor Vlasenko <viy@altlinux.ru> 2020.2-alt1
- new version

* Mon Mar 05 2018 Igor Vlasenko <viy@altlinux.ru> 2017.2-alt1.2
- NMU: build with rpm-build-tex

* Sat Mar 03 2018 Igor Vlasenko <viy@altlinux.ru> 2017.2-alt1.1
- NMU: rebuild with texlive instead of tetex

* Thu Jan 25 2018 Aleksei Nikiforov <darktemplar@altlinux.org> 2017.2-alt1
- Updated to upstream version 2017.2.

* Thu Dec 17 2015 Igor Vlasenko <viy@altlinux.ru> 2012-alt1
- QA NMU: new version && perl 522 patch
- Note, everyone: Kirill wants to give this package away.
- feel free to take it.
- see https://bugzilla.altlinux.org/31598

* Tue May 19 2009 Kirill Maslinsky <kirill@altlinux.ru> 2008-alt1
- NMU
- 2002-2-1 -> 2008
- new license (GPLv2)
- built with rpm-build-texmf
- replace dependencies on tetex-{latex,dvips} with /usr/bin/{latex,dvips}
- removed unnecessary calls to mktexlsr in post(un)

* Thu Mar 27 2008 Alexey Tourbin <at@altlinux.ru> 2002-alt6
- updated to 20041025 upstream tarball
- changed License tag to "non-free", packaged LICENSE
- removed /usr/share/texmf/*/url.sty which is part of latex (#10698)
- rh-grayimg.patch: fixes pstoimg ugly grey-backgrounded images
- rh-tabularx.patch: better support for tabularx environments
- relocated /usr/lib/latex2html to /usr/share/latex2html
- updated dependencies

* Sat Oct 04 2003 Dmitry V. Levin <ldv@altlinux.org> 2002-alt5
- Updated to release 2002-2-1.
- koi8r patch merged upstream.
- Fixed perl errors (at).

* Tue Jul 01 2003 Dmitry V. Levin <ldv@altlinux.org> 2002-alt4
- Fixed package dependencies.
- Fixed buildrequires.

* Wed Nov 27 2002 AEN <aen@altlinux.ru> 2002-alt3
- rebuilt with tetex-2.0

* Mon Nov 25 2002 AEN <aen@altlinux.ru> 2002-alt2
- --shlibdir added to %%configure (bug #1527)

* Mon Oct 28 2002 AEN <aen@altlinux.ru> 2002-alt1
- new version

* Mon Oct 08 2001 Dmitry V. Levin <ldv@altlinux.ru> 2000.1beta-alt2
- Updated beta tarball from ftp site.
- Added russian style patch (from Georgy Salnikov <sge@nmr.nioch.nsc.ru>).

* Thu Jun 21 2001 AEN <aen@logic.ru> 2000.1beta-alt1
- build for Sisyphus

* Tue Jun  5 2001 Matthias Badaire <mbadaire@mandrakesoft.com> 2000.1beta-2mdk
- fix pstoimg tmp variable issue

* Tue May 15 2001 Matthias Badaire <mbadaire@mandrakesoft.com> 2000.1beta-1mdk
- update to 2K.1beta

* Mon Jan 22 2001 Guillaume Cottenceau <gc@mandrakesoft.com> 99.2beta8-4mdk
- include manual.ps following suggestion by David Aspinall <da@dcs.ed.ac.uk>

* Tue Nov  7 2000 Guillaume Cottenceau <gc@mandrakesoft.com> 99.2beta8-3mdk
- fix specfile

* Fri Aug 25 2000 Geoffrey Lee <snailtalk@mandrakesof.com> 99.2beta8-2mdk
- readd /usr/bin/pstoimg ...oops ... (Erik Devriendt)
- fix license. There is no such thing as a GNU license.!

* Wed Aug 02 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 99.2beta8-1mdk
- new version to fix some nasty bugz (Meinhard E. Mayer)

* Sun Jul 30 2000 Geoffrey Lee <snailtalk@mandrakesoft.com> 99.2beta6-4mdk
- rebuild with cleanup

* Mon Mar 20 2000 Camille Begnis <camille@mandrakesoft.com> 99.2beta6-3mdk
- Fixed group

* Sat Mar 18 2000 Camille Begnis <camille@mandrakesoft.com> 99.2beta6-2mdk
- minor spec update

* Thu Feb 10 2000 Lenny Cartier <lenny@mandrakesoft.com>
- new in contribs
- used - once again - a great srpm provided by Vincent Danen <vdanen@linux-mandrake.com>

* Tue Feb 8 2000 Vincent Danen <vdanen@linux-mandrake.com>
- added fixes for some perl scripts that point to /usr/local/bin/perl

* Sun Feb 6 2000 Vincent Danen <vdanen@linux-mandrake.com>
- initial specfile
- bzip sources
- removed make install and replaced with custom installer to ensure correct
  paths in the latex2html perl programs