From e0375c6325616ec688c150f478b2f149b18d4368 Mon Sep 17 00:00:00 2001 From: Javier Pena Date: Jan 15 2019 16:12:57 +0000 Subject: Remove the python2 package for Fedora 30+ (bz#1666190) --- diff --git a/python-murano-pkg-check.spec b/python-murano-pkg-check.spec index 65c922f..a4b38ad 100644 --- a/python-murano-pkg-check.spec +++ b/python-murano-pkg-check.spec @@ -1,14 +1,18 @@ %{!?upstream_version: %global upstream_version %{version}%{?milestone}} -%if 0%{?fedora >= 24} -%global with_python3 1 -%endif +%if 0%{?fedora} || 0%{?rhel} > 7 +%bcond_with python2 +%bcond_without python3 +%else +%bcond_without python2 +%bcond_with python3 +%endif %global pypi_name murano-pkg-check %global library muranopkgcheck Name: python-%{pypi_name} Version: 0.3.0 -Release: 9%{?dist} +Release: 10%{?dist} Summary: Murano package validator tool License: ASL 2.0 @@ -17,6 +21,15 @@ Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{versi BuildArch: noarch BuildRequires: git + +%description +Murano package validator tool + + +%if %{with python2} +%package -n python2-%{pypi_name} +Summary: Murano package validator tool +%{?python_provide:%python_provide python2-%{pypi_name}} BuildRequires: python2-devel BuildRequires: python2-pbr BuildRequires: python2-hacking @@ -36,14 +49,6 @@ BuildRequires: python2-semantic_version BuildRequires: python2-oslo-i18n BuildRequires: python2-yaql BuildRequires: python2-stevedore - -%description -Murano package validator tool - -%package -n python2-%{pypi_name} -Summary: Murano package validator tool -%{?python_provide:%python_provide python2-%{pypi_name}} - Requires: python2-pbr >= 1.6 Requires: python2-pyyaml >= 3.10 Requires: python2-yaql >= 1.1.0 @@ -52,8 +57,11 @@ Requires: python2-stevedore >= 1.16.0 Requires: python2-semantic_version >= 2.3.1 Requires: python2-oslo-i18n >= 2.1.0 Requires: python2-setuptools + %description -n python2-%{pypi_name} %{description} +%endif + %package -n python-%{pypi_name}-doc Summary: murano-pkg-check documentation @@ -66,7 +74,7 @@ Provides: bundled(js-websupport) %description -n python-%{pypi_name}-doc Documentation for murano-pkg-check -%if 0%{?with_python3} +%if %{with python3} %package -n python3-%{pypi_name} Summary: Murano package validator tool %{?python_provide:%python_provide python3-%{pypi_name}} @@ -88,7 +96,6 @@ BuildRequires: python3-semantic_version BuildRequires: python3-oslo-i18n BuildRequires: python3-yaql BuildRequires: python3-stevedore - Requires: python3-pbr >= 1.6 Requires: python3-PyYAML >= 3.10 Requires: python3-yaql >= 1.1.0 @@ -97,6 +104,7 @@ Requires: python3-stevedore >= 1.16.0 Requires: python3-semantic_version >= 2.3.1 Requires: python3-oslo-i18n >= 2.1.0 Requires: python3-setuptools + %description -n python3-%{pypi_name} %{description} %endif @@ -109,76 +117,78 @@ rm -rf %{pypi_name}.egg-info rm -rf {test-,}requirements.txt tools/{pip,test}-requires %build +%if %{with python2} %py2_build -%if 0%{?with_python3} +%endif +%if %{with python3} %py3_build %endif + # generate html docs -%{__python2} setup.py build_sphinx -b html +sphinx-build -b html doc/source doc/build/html # generate man page -%{__python2} setup.py build_sphinx -b man +sphinx-build -b man doc/source doc/build/man # remove the sphinx-build leftovers -rm -rf html/.{doctrees,buildinfo} +rm -rf doc/build/html/.{doctrees,buildinfo} %install # Must do the subpackages' install first because the scripts in /usr/bin are # overwritten with every setup.py install. -%if 0%{?with_python3} +%if %{with python3} %py3_install -cp -p %{buildroot}/%{_bindir}/murano-pkg-check %{buildroot}/%{_bindir}/murano-pkg-check-3 -ln -sf %{_bindir}/murano-pkg-check-3 %{buildroot}/%{_bindir}/murano-pkg-check-%{python3_version} +mv %{buildroot}/%{_bindir}/murano-pkg-check %{buildroot}/%{_bindir}/murano-pkg-check-3 +ln -s ./murano-pkg-check-3 %{buildroot}%{_bindir}/murano-pkg-check %endif +%if %{with python2} %py2_install -cp -p %{buildroot}/%{_bindir}/murano-pkg-check %{buildroot}/%{_bindir}/murano-pkg-check-2 -ln -sf %{_bindir}/murano-pkg-check-2 %{buildroot}/%{_bindir}/murano-pkg-check-%{python2_version} -install -p -D -m 644 doc/build/man/murano-pkg-check.1 %{buildroot}%{_mandir}/man1/murano-pkg-check.1 -ln -s %{_mandir}/man1/murano-pkg-check.1 %{buildroot}%{_mandir}/man1/murano-pkg-check-2.1 -ln -s %{_mandir}/man1/murano-pkg-check.1 %{buildroot}%{_mandir}/man1/murano-pkg-check-%{python2_version}.1 - -%if 0%{?with_python3} -cp -p %{buildroot}%{_mandir}/man1/murano-pkg-check.1 %{buildroot}%{_mandir}/man1/murano-pkg-check-3.1 -ln -s %{_mandir}/man1/murano-pkg-check-3.1.gz %{buildroot}%{_mandir}/man1/murano-pkg-check-%{python3_version}.1.gz +mv %{buildroot}/%{_bindir}/murano-pkg-check %{buildroot}/%{_bindir}/murano-pkg-check-2 +ln -s ./murano-pkg-check-2 %{buildroot}%{_bindir}/murano-pkg-check %endif +install -p -D -m 644 doc/build/man/murano-pkg-check.1 %{buildroot}%{_mandir}/man1/murano-pkg-check.1 + %check +%if %{with python2} PYTHON=python2 %{__python2} setup.py test -%if 0%{?with_python3} +%endif +%if %{with python3} rm -rf .testrepository PYTHON=python3 %{__python3} setup.py test %endif +%if %{with python2} %files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{_bindir}/murano-pkg-check %{_bindir}/murano-pkg-check-2 -%{_bindir}/murano-pkg-check-%{python2_version} %{_mandir}/man1/murano-pkg-check.1.gz -%{_mandir}/man1/murano-pkg-check-2.1.gz -%{_mandir}/man1/murano-pkg-check-%{python2_version}.1.gz %{python2_sitelib}/%{library} %exclude %{python2_sitelib}/%{library}/tests %{python2_sitelib}/murano_pkg_check-*.egg-info +%endif %files -n python-%{pypi_name}-doc %license LICENSE %doc doc/build/html -%if 0%{?with_python3} +%if %{with python3} %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{_bindir}/murano-pkg-check-3 -%{_bindir}/murano-pkg-check-%{python3_version} -%{_mandir}/man1/murano-pkg-check-3.1.gz -%{_mandir}/man1/murano-pkg-check-%{python3_version}.1.gz +%{_bindir}/murano-pkg-check +%{_mandir}/man1/murano-pkg-check.1.gz %{python3_sitelib}/%{library} %exclude %{python3_sitelib}/%{library}/tests %{python3_sitelib}/murano_pkg_check-*.egg-info %endif %changelog +* Tue Jan 15 2019 Javier Peña - 0.3.0-10 +- Remove the python2 package for Fedora 30+ (bz#1666190) + * Tue Aug 07 2018 Javier Peña - 0.3.0-9 - Fixed rawhide build (bz#1605782)