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 Summary: Converts LaTeX documents to HTML
Name: latex2html Name: latex2html
Version: 2017.2 Version: 2017.2
Release: 5%{?dist} Release: 6%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/Publishing Group: Applications/Publishing
URL: http://www.latex2html.org/ URL: http://www.latex2html.org/
@ -86,15 +86,15 @@ tar fxz %{SOURCE2}
--shlibdir=%{_datadir}/latex2html \ --shlibdir=%{_datadir}/latex2html \
--with-texpath=%{_datadir}/texmf/tex/latex/html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e"s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm perl -pi -e "s,/usr/(share/)?lib,%{_datadir}," cfgcache.pm
make make
popd popd
%if %{enable_japanese} %if %{enable_japanese}
pushd %{name}-%{version}JA pushd %{name}-%{version}JA
sed s/latex2html/jlatex2html/g < %{SOURCE1} > cfgcache.pm sed s/latex2html/jlatex2html/g < %{SOURCE1} > cfgcache.pm
perl -pi -e"s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm perl -pi -e "s,/usr/bin/dvips,/usr/bin/pdvips," cfgcache.pm
perl -pi -e"s,/usr/bin/latex,/usr/bin/platex," cfgcache.pm perl -pi -e "s,/usr/bin/latex,/usr/bin/platex," cfgcache.pm
./configure --program-prefix=%{?_program_prefix} \ ./configure --program-prefix=%{?_program_prefix} \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
@ -113,10 +113,10 @@ perl -pi -e"s,/usr/bin/latex,/usr/bin/platex," cfgcache.pm
--shlibdir=%{_datadir}/jlatex2html \ --shlibdir=%{_datadir}/jlatex2html \
--with-texpath=%{_datadir}/texmf/tex/latex/html --with-texpath=%{_datadir}/texmf/tex/latex/html
perl -pi -e"s,/usr/(share/)?lib,%{_datadir},; perl -pi -e "s,/usr/(share/)?lib,%{_datadir},;
s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm s,%{_datadir}/latex2html,%{_datadir}/jlatex2html," cfgcache.pm
make make
perl -pi -e"s,\\\$\{dd}pstoimg,\\\$\{dd}jpstoimg, ; perl -pi -e "s,\\\$\{dd}pstoimg,\\\$\{dd}jpstoimg, ;
s,\\\$\{dd}texexpand,\\\$\{dd}jtexexpand," l2hconf.pm s,\\\$\{dd}texexpand,\\\$\{dd}jtexexpand," l2hconf.pm
for i in latex2html pstoimg texexpand ; do for i in latex2html pstoimg texexpand ; do
@ -126,26 +126,29 @@ popd
%endif %endif
%install %install
# fix check-buildroot failure, bootroot is dropped manually
%define __arch_install_post %{nil}
pushd %{name}-%{version} pushd %{name}-%{version}
perl -pi -e"s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm sed -i "s,%{_prefix},%{buildroot}%{_prefix}," cfgcache.pm
perl -pi -e"s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,; sed -i "s,%{buildroot},," l2hconf.pm
perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/texexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,; s,/.*\\\$\{dd}pstoimg,%{_bindir}/pstoimg,;
s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,; s,/.*\\\$\{dd}*icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,; s,/.*\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," latex2html
perl -pi -e"s,%{buildroot},," l2hconf.pm
make install make install
rm -f %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig rm -rf %{buildroot}%{_datadir}/latex2html/versions/table.pl.orig \
rm -rf %{buildroot}%{_datadir}/latex2html/docs/ %{buildroot}%{_datadir}/latex2html/docs/ \
rm -rf %{buildroot}%{_datadir}/latex2html/example/ %{buildroot}%{_datadir}/latex2html/example/
perl -pi -e"s,%{buildroot},," %{buildroot}%{_datadir}/latex2html/cfgcache.pm sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/pstoimg sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/latex2html/makemap
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/texexpand sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makemap
perl -pi -e"s,%{buildroot},," cfgcache.pm sed -i "s,###\!.*,," %{buildroot}%{_datadir}/latex2html/makeseg/makeseg
perl -pi -e"s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm 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 install -m0644 *.pm %{buildroot}%{_datadir}/latex2html
chmod +x %{buildroot}%{_datadir}/latex2html/makeseg/makeseg %{buildroot}%{_datadir}/latex2html/makemap 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 install -m0644 *.1 %{buildroot}%{_mandir}/man1
popd popd
# install japanese version
%if %{enable_japanese} %if %{enable_japanese}
pushd %{name}-%{version}JA 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,latex2html pstoimg texexpand,jlatex2html jpstoimg jtexexpand," config/install.pl
perl -pi -e"s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,; perl -pi -e "s,/.*\\\$\{dd}texexpand,%{_bindir}/jtexexpand,;
s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,; s,/.*\\\$\{dd}pstoimg,%{_bindir}/jpstoimg,;
s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,; s,/.*\\\$\{dd}icons,\\\$\{LATEX2HTMLDIR}/icons,;
s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,; s,/.*\\\$\{dd}styles\\\$\{dd}rgb.txt,\\\$\{LATEX2HTMLDIR}/styles/rgb.txt,;
s,/.*\\\$\{dd}styles\\\$\{dd}crayola.txt,\\\$\{LATEX2HTMLDIR}/styles/crayola.txt," jlatex2html 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 make install
rm -f %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig rm -rf %{buildroot}%{_datadir}/jlatex2html/versions/table.pl.orig \
rm -rf %{buildroot}%{_datadir}/jlatex2html/docs/ %{buildroot}%{_datadir}/jlatex2html/docs/ \
rm -rf %{buildroot}%{_datadir}/jlatex2html/example/ %{buildroot}%{_datadir}/jlatex2html/example/
perl -pi -e"s,%{buildroot},," %{buildroot}%{_datadir}/jlatex2html/cfgcache.pm sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/jpstoimg sed -i "s,/usr/local/bin/perl,/usr/bin/perl," %{buildroot}%{_datadir}/jlatex2html/makemap
perl -pi -e"s,%{buildroot},," %{buildroot}%{_bindir}/jtexexpand sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makemap
perl -pi -e"s,%{buildroot},," cfgcache.pm sed -i "s,###\!.*,," %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg
perl -pi -e"s,$cfg{'GS_LIB'} = q'';,$cfg{'GS_LIB'} = q'%{_datadir}/ghostscript/`ghostscript --version`';," cfgcache.pm 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 install -m0644 *.pm %{buildroot}%{_datadir}/jlatex2html
chmod +x %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg %{buildroot}%{_datadir}/jlatex2html/makemap chmod +x %{buildroot}%{_datadir}/jlatex2html/makeseg/makeseg %{buildroot}%{_datadir}/jlatex2html/makemap
popd popd
%endif %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 # do not clash with texlive, prefer url.sty from texlive instead
rm -f %{buildroot}%{_datadir}/texmf/tex/latex/html/url.sty 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.* %{_mandir}/man1/pstoimg.*
%changelog %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 * Fri May 11 2018 Than Ngo <than@redhat.com> - 2017.2-5
- fixed FTBFS - fixed FTBFS