use separate build directories

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2018-01-24 07:00:54 +01:00
parent ee9b54e2b4
commit 8ea19b7e2d
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C

View File

@ -98,19 +98,20 @@ cp doc/*.py py3doc
sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py sed -i 's|#!/usr/bin/python |#!%{__python3} |' py3doc/*.py
%build %build
%configure mkdir py2 py3
%make_build %global _configure ../configure
( cd py2 && %configure --cache-file=../config.cache --with-python=%{__python2} )
( cd py3 && %configure --cache-file=../config.cache --with-python=%{__python3} )
%make_build -C py2
%make_build -C py3
find doc -type f -exec chmod 0644 \{\} \; find doc -type f -exec chmod 0644 \{\} \;
%install %install
rm -fr %{buildroot} rm -fr %{buildroot}
%make_install %make_install -C py2
%make_install -C py3
make clean
%configure --with-python=%{__python3}
%make_install
# multiarch crazyness on timestamp differences or Makefile/binaries for examples # multiarch crazyness on timestamp differences or Makefile/binaries for examples
touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config touch -m --reference=$RPM_BUILD_ROOT/%{_includedir}/libxml2/libxml/parser.h $RPM_BUILD_ROOT/%{_bindir}/xml2-config
@ -120,11 +121,12 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.a
rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/python*/site-packages/*.la
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/* rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-%{version}/*
rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/* rm -rf $RPM_BUILD_ROOT%{_datadir}/doc/libxml2-python-%{version}/*
(cd doc/examples ; make clean ; rm -rf .deps Makefile) #(cd doc/examples ; make clean ; rm -rf .deps Makefile)
gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz gzip -9 -c doc/libxml2-api.xml > doc/libxml2-api.xml.gz
%check %check
make runtests %make_build runtests -C py2
%make_build runtests -C py3
%post -p /sbin/ldconfig %post -p /sbin/ldconfig