fixed bz#1591144, buildroot issue

This commit is contained in:
Than Ngo 2018-06-14 16:01:34 +02:00
parent a79b64e492
commit 4d0e086c84

View File

@ -3,7 +3,7 @@
Summary: Converts LaTeX documents to HTML
Name: latex2html
Version: 2017.2
Release: 5%{?dist}
Release: 6%{?dist}
License: GPLv2+
Group: Applications/Publishing
URL: http://www.latex2html.org/
@ -126,25 +126,28 @@ popd
%endif
%install
# fix check-buildroot failure, bootroot is dropped manually
%define __arch_install_post %{nil}
pushd %{name}-%{version}
perl -pi -e"s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
sed -i "s,%{buildroot},," l2hconf.pm
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,;
s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html
perl -pi -e"s,%{buildroot},," l2hconf.pm
make install
rm -f %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig
rm -rf %{buildroot}%{_datadir}/latex2html/docs/
rm -rf %{buildroot}%{_datadir}/latex2html/example/
perl -pi -e"s,%{buildroot},," %{buildroot}%{_datadir}/latex2html/cfgcache.pm
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/texexpand
perl -pi -e"s,%{buildroot},," cfgcache.pm
rm -rf %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/latex2html/docs/ \
%{buildroot}%{_datadir}/latex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/texexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}';," 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
chmod +x %{buildroot}%{_datadir}/latex2html/makeseg/makeseg %{buildroot}%{_datadir}/latex2html/makemap
@ -154,38 +157,36 @@ mkdir -p %{buildroot}%{_mandir}/man1
install -m0644 *.1 %{buildroot}%{_mandir}/man1
popd
# install japanese version
%if %{enable_japanese}
pushd %{name}-%{version}JA
perl -pi -e"s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
perl -pi -e "s,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,;
s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html
perl -pi -e"s,%{buildroot},," l2hconf.pm
sed -i "s,%{buildroot},," l2hconf.pm
make install
rm -f %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig
rm -rf %{buildroot}%{_datadir}/jlatex2html/docs/
rm -rf %{buildroot}%{_datadir}/jlatex2html/example/
perl -pi -e"s,%{buildroot},," %{buildroot}%{_datadir}/jlatex2html/cfgcache.pm
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand
perl -pi -e"s,%{buildroot},," cfgcache.pm
rm -rf %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig \
%{buildroot}%{_datadir}/jlatex2html/docs/ \
%{buildroot}%{_datadir}/jlatex2html/example/
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makemap
sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg
sed -i "s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand
sed -i "s,%{buildroot},," cfgcache.pm
sed -i "s,$cfg{'srcdir'}.*,$cfg{'srcdir'} = q'%{name}-%{version}JA';," 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
chmod +x %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg %{buildroot}%{_datadir}/jlatex2html/makemap
popd
%endif
for f in cweb2html/cweb2html makeseg/makeseg makemap ; do
perl -pi -e "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/$f
%if %{enable_japanese}
perl -pi -e "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/$f
%endif
done
# do not clash with texlive, prefer url.sty from texlive instead
rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty
@ -218,6 +219,9 @@ rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty
%{_mandir}/man1/pstoimg.*
%changelog
* Thu Jun 14 2018 Than Ngo <than@redhat.com> - 2017.2-6
- fixed bz#1591144, buildroot issue
* Fri May 11 2018 Than Ngo <than@redhat.com> - 2017.2-5
- fixed FTBFS