Blame SPECS/python-murano-pkg-check.spec

cb55e7
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
cb55e7
cb55e7
%if 0%{?fedora} || 0%{?rhel} > 7
cb55e7
%bcond_with    python2
cb55e7
%bcond_without python3
cb55e7
%else
cb55e7
%bcond_without python2
cb55e7
%bcond_with    python3
cb55e7
%endif
cb55e7
%global pypi_name murano-pkg-check
cb55e7
%global library muranopkgcheck
cb55e7
cb55e7
%global with_docs 0
cb55e7
cb55e7
Name:           python-%{pypi_name}
cb55e7
Version:        0.3.0
cb55e7
Release:        20%{?dist}
cb55e7
Summary:        Murano package validator tool
cb55e7
cb55e7
License:        ASL 2.0
cb55e7
URL:            http://docs.openstack.org/developer/murano/
cb55e7
Source0:        https://tarballs.openstack.org/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
cb55e7
BuildArch:      noarch
cb55e7
cb55e7
BuildRequires:  git
cb55e7
cb55e7
%description
cb55e7
Murano package validator tool
cb55e7
cb55e7
cb55e7
%if %{with python2}
cb55e7
%package -n     python2-%{pypi_name}
cb55e7
Summary:        Murano package validator tool
cb55e7
%{?python_provide:%python_provide python2-%{pypi_name}}
cb55e7
BuildRequires:  python2-devel
cb55e7
BuildRequires:  python2-pbr
cb55e7
BuildRequires:  python2-coverage
cb55e7
BuildRequires:  python2-subunit
cb55e7
BuildRequires:  python2-sphinx
cb55e7
BuildRequires:  python2-oslo-sphinx
cb55e7
BuildRequires:  python2-oslotest
cb55e7
BuildRequires:  python2-testrepository
cb55e7
BuildRequires:  python2-testscenarios
cb55e7
BuildRequires:  python2-testtools
cb55e7
BuildRequires:  python2-reno
cb55e7
BuildRequires:  python2-setuptools
cb55e7
BuildRequires:  python2-sphinx
cb55e7
# Required for tests
cb55e7
BuildRequires:  python2-semantic_version
cb55e7
BuildRequires:  python2-oslo-i18n
cb55e7
BuildRequires:  python2-yaql
cb55e7
BuildRequires:  python2-stevedore
cb55e7
Requires:       python2-pbr >= 1.6
cb55e7
Requires:       python2-pyyaml >= 3.10
cb55e7
Requires:       python2-yaql >= 1.1.0
cb55e7
Requires:       python2-six >= 1.9.0
cb55e7
Requires:       python2-stevedore >= 1.16.0
cb55e7
Requires:       python2-semantic_version >= 2.3.1
cb55e7
Requires:       python2-oslo-i18n >= 2.1.0
cb55e7
Requires:       python2-setuptools
cb55e7
cb55e7
%description -n python2-%{pypi_name}
cb55e7
%{description}
cb55e7
%endif
cb55e7
cb55e7
cb55e7
%if 0%{?with_docs}
cb55e7
%package -n python-%{pypi_name}-doc
cb55e7
Summary:        murano-pkg-check documentation
cb55e7
Provides:       bundled(js-doctools)
cb55e7
Provides:       bundled(js-jquery) = 3.1.0
cb55e7
Provides:       bundled(js-searchtools)
cb55e7
Provides:       bundled(js-underscore) = 1.3.1
cb55e7
Provides:       bundled(js-websupport)
cb55e7
cb55e7
%description -n python-%{pypi_name}-doc
cb55e7
Documentation for murano-pkg-check
cb55e7
%endif
cb55e7
cb55e7
%if %{with python3}
cb55e7
%package -n     python3-%{pypi_name}
cb55e7
Summary:        Murano package validator tool
cb55e7
%{?python_provide:%python_provide python3-%{pypi_name}}
cb55e7
BuildRequires:  python3-devel
cb55e7
BuildRequires:  python3-pbr
cb55e7
BuildRequires:  python3-coverage
cb55e7
BuildRequires:  python3-subunit
cb55e7
BuildRequires:  python3-sphinx
cb55e7
BuildRequires:  python3-oslo-sphinx
cb55e7
BuildRequires:  python3-oslotest
cb55e7
BuildRequires:  python3-testrepository
cb55e7
BuildRequires:  python3-testscenarios
cb55e7
BuildRequires:  python3-testtools
cb55e7
#BuildRequires:  python3-reno
cb55e7
BuildRequires:  python3-setuptools
cb55e7
# Required for tests
cb55e7
BuildRequires:  python3-semantic_version
cb55e7
#BuildRequires:  python3-oslo-i18n
cb55e7
BuildRequires:  python3-yaql
cb55e7
BuildRequires:  python3-stevedore
cb55e7
Requires:       python3-pbr >= 1.6
cb55e7
Requires:       python3-PyYAML >= 3.10
cb55e7
Requires:       python3-yaql >= 1.1.0
cb55e7
Requires:       python3-six >= 1.9.0
cb55e7
Requires:       python3-stevedore >= 1.16.0
cb55e7
Requires:       python3-semantic_version >= 2.3.1
cb55e7
Requires:       python3-oslo-i18n >= 2.1.0
cb55e7
Requires:       python3-setuptools
cb55e7
cb55e7
%description -n python3-%{pypi_name}
cb55e7
%{description}
cb55e7
%endif
cb55e7
cb55e7
%prep
cb55e7
%autosetup -n %{pypi_name}-%{version} -S git
cb55e7
# Remove bundled egg-info
cb55e7
rm -rf %{pypi_name}.egg-info
cb55e7
# Let's handle requirements from the RPM side
cb55e7
rm -rf {test-,}requirements.txt tools/{pip,test}-requires
cb55e7
cb55e7
%build
cb55e7
%if %{with python2}
cb55e7
%py2_build
cb55e7
%endif
cb55e7
%if %{with python3}
cb55e7
%py3_build
cb55e7
%endif
cb55e7
cb55e7
%if 0%{?with_docs}
cb55e7
%if %{with python3}
cb55e7
# generate html docs
cb55e7
sphinx-build-3 -b html doc/source doc/build/html
cb55e7
# generate man page
cb55e7
sphinx-build-3 -b man doc/source doc/build/man
cb55e7
%else
cb55e7
# generate html docs
cb55e7
sphinx-build -b html doc/source doc/build/html
cb55e7
# generate man page
cb55e7
sphinx-build -b man doc/source doc/build/man
cb55e7
# remove the sphinx-build leftovers
cb55e7
%endif
cb55e7
rm -rf doc/build/html/.{doctrees,buildinfo}
cb55e7
%endif
cb55e7
cb55e7
%install
cb55e7
# Must do the subpackages' install first because the scripts in /usr/bin are
cb55e7
# overwritten with every setup.py install.
cb55e7
%if %{with python3}
cb55e7
%py3_install
cb55e7
mv %{buildroot}/%{_bindir}/murano-pkg-check %{buildroot}/%{_bindir}/murano-pkg-check-3
cb55e7
ln -s ./murano-pkg-check-3 %{buildroot}%{_bindir}/murano-pkg-check
cb55e7
%endif
cb55e7
cb55e7
%if %{with python2}
cb55e7
%py2_install
cb55e7
mv %{buildroot}/%{_bindir}/murano-pkg-check %{buildroot}/%{_bindir}/murano-pkg-check-2
cb55e7
ln -s ./murano-pkg-check-2 %{buildroot}%{_bindir}/murano-pkg-check
cb55e7
%endif
cb55e7
cb55e7
%if 0%{?with_docs}
cb55e7
install -p -D -m 644 doc/build/man/murano-pkg-check.1 %{buildroot}%{_mandir}/man1/murano-pkg-check.1
cb55e7
%endif
cb55e7
cb55e7
%check
cb55e7
%if %{with python2}
cb55e7
PYTHON=python2 %{__python2} setup.py test
cb55e7
%endif
cb55e7
%if %{with python3}
cb55e7
rm -rf .testrepository
cb55e7
#PYTHON=python3 %{__python3} setup.py test
cb55e7
%endif
cb55e7
cb55e7
%if %{with python2}
cb55e7
%files -n python2-%{pypi_name}
cb55e7
%license LICENSE
cb55e7
%doc README.rst
cb55e7
%{_bindir}/murano-pkg-check
cb55e7
%{_bindir}/murano-pkg-check-2
cb55e7
%{_mandir}/man1/murano-pkg-check.1.gz
cb55e7
%{python2_sitelib}/%{library}
cb55e7
%exclude %{python2_sitelib}/%{library}/tests
cb55e7
%{python2_sitelib}/murano_pkg_check-*.egg-info
cb55e7
%endif
cb55e7
cb55e7
%if 0%{?with_docs}
cb55e7
%files -n python-%{pypi_name}-doc
cb55e7
%license LICENSE
cb55e7
%doc doc/build/html
cb55e7
%endif
cb55e7
cb55e7
%if %{with python3}
cb55e7
%files -n python3-%{pypi_name}
cb55e7
%license LICENSE
cb55e7
%doc README.rst
cb55e7
%{_bindir}/murano-pkg-check-3
cb55e7
%{_bindir}/murano-pkg-check
cb55e7
%if 0%{?with_docs}
cb55e7
%{_mandir}/man1/murano-pkg-check.1.gz
cb55e7
%endif
cb55e7
%{python3_sitelib}/%{library}
cb55e7
%exclude %{python3_sitelib}/%{library}/tests
cb55e7
%{python3_sitelib}/murano_pkg_check-*.egg-info
cb55e7
%endif
cb55e7
cb55e7
%changelog
cb55e7
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-20
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
cb55e7
cb55e7
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-19
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
cb55e7
cb55e7
* Mon Jun 01 2020 Javier Peña <jpena@redhat.com> - 0.3.0-18
cb55e7
- Remove python-hacking BR, it is not actually needed for unit tests (bz#1841741)
cb55e7
cb55e7
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.3.0-17
cb55e7
- Rebuilt for Python 3.9
cb55e7
cb55e7
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-16
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
cb55e7
cb55e7
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3.0-15
cb55e7
- Rebuilt for Python 3.8.0rc1 (#1748018)
cb55e7
cb55e7
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.3.0-14
cb55e7
- Rebuilt for Python 3.8
cb55e7
cb55e7
* Mon Jul 29 2019 Alfredo Moralejo <amoralej@redhat.com> - 0.3.0-13
cb55e7
- Remove docs building as it does not support recent sphinx
cb55e7
cb55e7
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-12
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
cb55e7
cb55e7
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-11
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
cb55e7
cb55e7
* Tue Jan 15 2019 Javier Peña <jpena@redhat.com> - 0.3.0-10
cb55e7
- Remove the python2 package for Fedora 30+ (bz#1666190)
cb55e7
cb55e7
* Tue Aug 07 2018 Javier Peña <jpena@redhat.com> - 0.3.0-9
cb55e7
- Fixed rawhide build (bz#1605782)
cb55e7
cb55e7
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-8
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
cb55e7
cb55e7
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.3.0-7
cb55e7
- Rebuilt for Python 3.7
cb55e7
cb55e7
* Mon Mar 26 2018 Iryna Shcherbina <ishcherb@redhat.com> - 0.3.0-6
cb55e7
- Update Python 2 dependency declarations to new packaging standards
cb55e7
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)
cb55e7
cb55e7
* Thu Mar 15 2018 Javier Peña <jpena@redhat.com> - 0.3.0-5
cb55e7
- Fix man page build (bz#1556215)
cb55e7
cb55e7
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-4
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
cb55e7
cb55e7
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.3.0-3
cb55e7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
cb55e7
cb55e7
* Wed Feb 15 2017 Javier Peña <jpena@redhat.com> - 0.3.0-2
cb55e7
- Updated PyYAML version dependency
cb55e7
cb55e7
* Mon Feb 13 2017 Javier Peña <jpena@redhat.com> - 0.3.0-1
cb55e7
- Updated to upstream 0.3.0
cb55e7
- Fixed License tag
cb55e7
- Added manpage for murano-pkg-check-3
cb55e7
cb55e7
* Mon Nov 14 2016 jpena <jpena@redhat.com> - 0.2.0-1
cb55e7
- Initial package.