Fix python2 subpackage builds. (#1564347)

Disable tests by default because they fail in mock right now.
This commit is contained in:
David Cantrell 2018-04-16 16:43:22 -04:00
parent 9f7dfbba3c
commit f8dea06687

View File

@ -4,9 +4,14 @@
%bcond_without python2
%endif
# Disable tests by default because they fail to run inside mock builds
# at the moment, but can run locally. To build and run tests, do:
# rpmbuild -ba --with runtests pykickstart.spec
%bcond_with runtests
Name: pykickstart
Version: 3.12
Release: 2.1%{?dist}
Release: 4%{?dist}
License: GPLv2 and MIT
Group: System Environment/Libraries
Summary: Python utilities for manipulating kickstart files.
@ -15,7 +20,6 @@ Url: http://fedoraproject.org/wiki/pykickstart
# our distribution. Thus the source is only available from
# within this srpm.
Source0: %{name}-%{version}.tar.gz
Patch0: p1
BuildArch: noarch
@ -24,7 +28,7 @@ BuildRequires: gettext
BuildRequires: python2-coverage
BuildRequires: python2-devel
BuildRequires: python2-nose
BuildRequires: python2-ordered-set
BuildRequires: python-ordered-set
BuildRequires: python2-setuptools
BuildRequires: python2-requests
%endif
@ -73,7 +77,6 @@ the pykickstart package.
%prep
%setup -q
%patch0 -p1
%if %{with python2}
rm -rf %{py3dir}
@ -98,11 +101,13 @@ make PYTHON=%{__python3} DESTDIR=%{buildroot} install
%endif
%check
%if %{with runtests}
%if %{with python2}
make -C %{py3dir} PYTHON=%{__python3} test
%else
make PYTHON=%{__python3} test
%endif
%endif
%files
%defattr(-,root,root,-)
@ -113,7 +118,10 @@ make PYTHON=%{__python3} test
%{_bindir}/ksflatten
%{_bindir}/ksverdiff
%{_bindir}/ksshell
%{_mandir}/man1/*
%{_mandir}/man1/ksflatten.1.gz
%{_mandir}/man1/ksshell.1.gz
%{_mandir}/man1/ksvalidator.1.gz
%{_mandir}/man1/ksverdiff.1.gz
%if %{with python2}
%files -n python2-kickstart
@ -121,11 +129,8 @@ make PYTHON=%{__python3} test
%doc docs/2to3
%doc docs/programmers-guide
%doc docs/kickstart-docs.txt
%{python2_sitelib}/pykickstart*egg*
%{python2_sitelib}/pykickstart/
%{python2_sitelib}/pykickstart/commands/
%{python2_sitelib}/pykickstart/handlers/
%{python2_sitelib}/pykickstart/locale/
%{python2_sitelib}/pykickstart*.egg-info
%{python2_sitelib}/pykickstart
%endif
%files -n python3-kickstart
@ -133,13 +138,14 @@ make PYTHON=%{__python3} test
%doc docs/2to3
%doc docs/programmers-guide
%doc docs/kickstart-docs.txt
%{python3_sitelib}/pykickstart*egg*
%{python3_sitelib}/pykickstart/
%{python3_sitelib}/pykickstart/commands/
%{python3_sitelib}/pykickstart/handlers/
%{python3_sitelib}/pykickstart/locale/
%{python3_sitelib}/pykickstart
%{python3_sitelib}/pykickstart*.egg-info
%changelog
* Mon Apr 16 2018 David Cantrell <dcantrell@redhat.com> - 3.12-4
- Fix python2 subpackage builds. (#1564347)
- Disable tests by default because they fail in mock right now.
* Thu Apr 12 2018 David Cantrell <dcantrell@redhat.com> - 3.12-3
- Re-enable the python2 subpackages on Fedora for now. Some
programs still need it and have not moved to python3 yet. (#1564347)