%{!?upstream_version: %global upstream_version %{version}%{?milestone}} %if 0%{?fedora >= 24} %global with_python3 1 %endif %global pypi_name murano-pkg-check %global library muranopkgcheck Name: python-%{pypi_name} Version: 0.3.0 Release: 1%{?dist} Summary: Murano package validator tool License: ASL 2.0 URL: http://docs.openstack.org/developer/murano/ Source0: https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: git BuildRequires: python2-devel BuildRequires: python-pbr BuildRequires: python-hacking BuildRequires: python-coverage BuildRequires: python-subunit BuildRequires: python-sphinx BuildRequires: python-oslo-sphinx BuildRequires: python-oslotest BuildRequires: python-testrepository BuildRequires: python-testscenarios BuildRequires: python-testtools BuildRequires: python-reno BuildRequires: python-setuptools BuildRequires: python-sphinx # Required for tests BuildRequires: python-semantic_version BuildRequires: python-oslo-i18n BuildRequires: python-yaql BuildRequires: python-stevedore %description Murano package validator tool %package -n python2-%{pypi_name} Summary: Murano package validator tool %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python-pbr >= 1.6 Requires: PyYAML >= 3.10.0 Requires: python-yaql >= 1.1.0 Requires: python-six >= 1.9.0 Requires: python-stevedore >= 1.16.0 Requires: python-semantic_version >= 2.3.1 Requires: python-oslo-i18n >= 2.1.0 Requires: python-setuptools %description -n python2-%{pypi_name} %{description} %package -n python-%{pypi_name}-doc Summary: murano-pkg-check documentation Provides: bundled(js-doctools) Provides: bundled(js-jquery) Provides: bundled(js-searchtools) Provides: bundled(js-underscore) Provides: bundled(js-websupport) %description -n python-%{pypi_name}-doc Documentation for murano-pkg-check %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: Murano package validator tool %{?python_provide:%python_provide python3-%{pypi_name}} BuildRequires: python3-devel BuildRequires: python3-pbr BuildRequires: python3-hacking BuildRequires: python3-coverage BuildRequires: python3-subunit BuildRequires: python3-sphinx BuildRequires: python3-oslo-sphinx BuildRequires: python3-oslotest BuildRequires: python3-testrepository BuildRequires: python3-testscenarios BuildRequires: python3-testtools BuildRequires: python3-reno BuildRequires: python3-setuptools # Required for tests BuildRequires: python3-semantic_version BuildRequires: python3-oslo-i18n BuildRequires: python3-yaql BuildRequires: python3-stevedore Requires: python3-pbr >= 1.6 Requires: python3-PyYAML >= 3.10.0 Requires: python3-yaql >= 1.1.0 Requires: python3-six >= 1.9.0 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 %prep %autosetup -n %{pypi_name}-%{version} -S git # Remove bundled egg-info rm -rf %{pypi_name}.egg-info # Let's handle requirements from the RPM side rm -rf {test-,}requirements.txt tools/{pip,test}-requires %build %py2_build %if 0%{?with_python3} %py3_build %endif # generate html docs %{__python2} setup.py build_sphinx # remove the sphinx-build leftovers rm -rf 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} %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} %endif %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 %endif %check %{__python2} setup.py test %if 0%{?with_python3} rm -rf .testrepository %{__python3} setup.py test %endif %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 %files -n python-%{pypi_name}-doc %license LICENSE %doc doc/build/html %if 0%{?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 %{python3_sitelib}/%{library} %exclude %{python3_sitelib}/%{library}/tests %{python3_sitelib}/murano_pkg_check-*.egg-info %endif %changelog * Mon Feb 13 2017 Javier Peña - 0.3.0-1 - Updated to upstream 0.3.0 - Fixed License tag - Added manpage for murano-pkg-check-3 * Mon Nov 14 2016 jpena - 0.2.0-1 - Initial package.