Don't mix RPM_BUILD_ROOT and buildroot.

This commit is contained in:
Elliott Sales de Andrade 2020-06-17 03:09:40 -04:00
parent 3c5ba1d992
commit db91f16da3

View File

@ -150,10 +150,9 @@ popd
%install
# NOTE: this is nasty, but if we want to have parallel Py2/Py3 mercurial..
# ignoring now stuff related to *_completion, extensions
rm -rf $RPM_BUILD_ROOT
%{__python3} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}3.files
%{__python2} setup.py install -O1 --root $RPM_BUILD_ROOT --prefix %{_prefix} --record=%{name}2.files
make install-doc DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir}
%{__python3} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}3.files
%{__python2} setup.py install -O1 --root %{buildroot} --prefix %{_prefix} --record=%{name}2.files
make install-doc DESTDIR=%{buildroot} MANDIR=%{_mandir}
grep -v -e 'hgk.py*' \
-e "%{python3_sitearch}/mercurial/" \
@ -168,36 +167,36 @@ grep -v -e 'hgk.py*' \
grep 'hgk.py*' < %{name}3.files > %{name}3-hgk.files
grep 'hgk.py*' < %{name}2.files > %{name}2-hgk.files
install -D -m 755 contrib/hgk $RPM_BUILD_ROOT%{_libexecdir}/mercurial/hgk
install -m 755 contrib/hg-ssh $RPM_BUILD_ROOT%{_bindir}
install -D -m 755 contrib/hgk %{buildroot}%{_libexecdir}/mercurial/hgk
install -m 755 contrib/hg-ssh %{buildroot}%{_bindir}
bash_completion_dir=$RPM_BUILD_ROOT$(pkg-config --variable=completionsdir bash-completion)
bash_completion_dir=%{buildroot}$(pkg-config --variable=completionsdir bash-completion)
mkdir -p $bash_completion_dir
install -m 644 contrib/bash_completion $bash_completion_dir/hg
zsh_completion_dir=$RPM_BUILD_ROOT%{_datadir}/zsh/site-functions
zsh_completion_dir=%{buildroot}%{_datadir}/zsh/site-functions
mkdir -p $zsh_completion_dir
install -m 644 contrib/zsh_completion $zsh_completion_dir/_mercurial
mkdir -p $RPM_BUILD_ROOT%{_emacs_sitelispdir}/mercurial
mkdir -p %{buildroot}%{_emacs_sitelispdir}/mercurial
pushd contrib
for file in mercurial.el mq.el; do
#emacs -batch -l mercurial.el --no-site-file -f batch-byte-compile $file
%{_emacs_bytecompile} $file
install -p -m 644 $file ${file}c $RPM_BUILD_ROOT%{_emacs_sitelispdir}/mercurial
install -p -m 644 $file ${file}c %{buildroot}%{_emacs_sitelispdir}/mercurial
rm ${file}c
done
popd
pushd contrib/chg
make install DESTDIR=$RPM_BUILD_ROOT PREFIX=%{_usr} MANDIR=%{_mandir}/man1
make install DESTDIR=%{buildroot} PREFIX=%{_usr} MANDIR=%{_mandir}/man1
popd
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d
mkdir -p %{buildroot}%{_sysconfdir}/mercurial/hgrc.d
mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} && install -m644 %SOURCE1 $RPM_BUILD_ROOT%{_emacs_sitestartdir}
mkdir -p %{buildroot}%{_emacs_sitestartdir} && install -m644 %SOURCE1 %{buildroot}%{_emacs_sitestartdir}
cat >hgk.rc <<EOF
[extensions]
@ -207,19 +206,19 @@ hgk=
[hgk]
path=%{_libexecdir}/mercurial/hgk
EOF
install -m 644 hgk.rc $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d
install -m 644 hgk.rc %{buildroot}%{_sysconfdir}/mercurial/hgrc.d
cat > certs.rc <<EOF
# see: http://mercurial.selenic.com/wiki/CACertificates
[web]
cacerts = /etc/pki/tls/certs/ca-bundle.crt
EOF
install -m 644 certs.rc $RPM_BUILD_ROOT/%{_sysconfdir}/mercurial/hgrc.d
install -m 644 certs.rc %{buildroot}%{_sysconfdir}/mercurial/hgrc.d
# Despite the original path, locales can be used for Python3 as well
mv $RPM_BUILD_ROOT%{python2_sitearch}/mercurial/locale $RPM_BUILD_ROOT%{_datadir}/locale
rm -rf $RPM_BUILD_ROOT%{python3_sitearch}/mercurial/locale
rm -rf $RPM_BUILD_ROOT%{python2_sitearch}/mercurial/locale
mv %{buildroot}%{python2_sitearch}/mercurial/locale %{buildroot}%{_datadir}/locale
rm -rf %{buildroot}%{python3_sitearch}/mercurial/locale
rm -rf %{buildroot}%{python2_sitearch}/mercurial/locale
%find_lang hg
@ -228,16 +227,16 @@ grep -v locale %{name}3-base.files > %{name}3-base-filtered.files
# Move hg-ssh aside
cp -p $RPM_BUILD_ROOT%{_bindir}/hg-ssh $RPM_BUILD_ROOT%{_bindir}/hg-ssh2
cp -p $RPM_BUILD_ROOT%{_bindir}/hg-ssh $RPM_BUILD_ROOT%{_bindir}/hg-ssh3
rm $RPM_BUILD_ROOT%{_bindir}/hg-ssh
pathfix.py -pni "%{__python2}" $RPM_BUILD_ROOT%{_bindir}/hg-ssh2
pathfix.py -pni "%{__python3}" $RPM_BUILD_ROOT%{_bindir}/hg-ssh3
cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh2
cp -p %{buildroot}%{_bindir}/hg-ssh %{buildroot}%{_bindir}/hg-ssh3
rm %{buildroot}%{_bindir}/hg-ssh
pathfix.py -pni "%{__python2}" %{buildroot}%{_bindir}/hg-ssh2
pathfix.py -pni "%{__python3}" %{buildroot}%{_bindir}/hg-ssh3
# Touch the base executables for alternatives
touch $RPM_BUILD_ROOT%{_bindir}/hg
touch $RPM_BUILD_ROOT%{_bindir}/hg-ssh
touch %{buildroot}%{_bindir}/hg
touch %{buildroot}%{_bindir}/hg-ssh
%post py2
%{_sbindir}/update-alternatives --install %{_bindir}/hg \