change spec

This commit is contained in:
zhangy1317 2021-01-25 11:39:05 +08:00
parent 0c4be932b9
commit 8482ee0f02
2 changed files with 170 additions and 87 deletions

170
python-oslo-vmware.spec Normal file
View File

@ -0,0 +1,170 @@
%{!?upstream_version: %global upstream_version %{version}%{?milestone}}
%global with_doc 1
Name: python-oslo-vmware
Version: 3.7.0
Release: 3
Summary: Oslo VMware library for OpenStack projects
License: ASL 2.0
URL: https://opendev.org/openstack/oslo.vmware
Source0: https://tarballs.openstack.org/oslo.vmware/oslo.vmware-3.7.0.tar.gz
BuildArch: noarch
%description
Oslo VMware library for OpenStack projects
%package -n python3-oslo-vmware
Summary: Oslo VMware library for OpenStack projects
%{?python_provide:%python_provide python3-oslo-vmware}
BuildRequires: python3-devel
BuildRequires: python3-pbr
BuildRequires: python3-pip
BuildRequires: git
# test dependencies
BuildRequires: python3-ddt
BuildRequires: python3-fixtures
BuildRequires: python3-mock
BuildRequires: python3-stestr
BuildRequires: python3-subunit
BuildRequires: python3-testtools
BuildRequires: python3-suds
BuildRequires: python3-oslo-concurrency
BuildRequires: python3-oslo-context
BuildRequires: python3-oslo-utils
BuildRequires: python3-oslo-i18n
BuildRequires: python3-eventlet
BuildRequires: python3-oslo-i18n
BuildRequires: python3-oslo-utils
BuildRequires: python3-requests >= 2.14.2
BuildRequires: python3-suds
BuildRequires: python3-netaddr
# Required to compile translation files
BuildRequires: python3-testscenarios
BuildRequires: python3-babel
BuildRequires: python3-lxml
Requires: python3-pbr
Requires: python3-eventlet
Requires: python3-oslo-concurrency >= 3.26.0
Requires: python3-oslo-context >= 2.19.2
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-oslo-utils
Requires: python3-requests
Requires: python3-stevedore >= 1.20.0
Requires: python3-suds >= 0.6
Requires: python3-urllib3
Requires: python3-netaddr
Requires: python-oslo-vmware-lang = %{version}-%{release}
Requires: python3-lxml
Requires: python3-PyYAML
%description -n python3-oslo-vmware
Oslo VMware library for OpenStack projects
%if 0%{?with_doc}
%package -n python-oslo-vmware-doc
Summary: Documentation for OpenStack common VMware library
BuildRequires: python3-sphinx
BuildRequires: python3-sphinxcontrib-apidoc
BuildRequires: python3-openstackdocstheme
%description -n python-oslo-vmware-doc
Documentation for OpenStack common VMware library.
%endif
%package -n python3-oslo-vmware-tests
Summary: Test subpackage for OpenStack common VMware library
Requires: python3-oslo-vmware = %{version}-%{release}
Requires: python3-fixtures
Requires: python3-mock
Requires: python3-subunit
Requires: python3-testtools
Requires: python3-suds >= 0.6
Requires: python3-oslo-context
Requires: python3-oslo-utils
Requires: python3-oslo-i18n >= 3.15.3
Requires: python3-testscenarios
%description -n python3-oslo-vmware-tests
Tests for OpenStack common VMware library.
%package -n python-oslo-vmware-lang
Summary: Translation files for Oslo vmware library
%description -n python-oslo-vmware-lang
Translation files for Oslo vmware library
%prep
%autosetup -n oslo.vmware-3.7.0 -S git
# FIXME(hguemar): requirements blocks 0.20.1 due to lp#1696094
# but eventlet 0.20.1-2 package has backported the fix
sed -i '/eventlet/s/!=0.20.1,//' requirements.txt
# FIXME(hguemar): we use system lxml from EL7
sed -i '/lxml/s/,>=3.4.1//' requirements.txt
%build
%{py3_build}
%if 0%{?with_doc}
# generate html docs
sphinx-build-3 -b html doc/source doc/build/html
# remove the sphinx-build-3 leftovers
rm -rf doc/build/html/.{doctrees,buildinfo}
%endif
# Generate i18n files
python3 setup.py compile_catalog -d build/lib/oslo_vmware/locale --domain oslo_vmware
%install
%{py3_install}
# Install i18n .mo files (.po and .pot are not required)
install -d -m 755 %{buildroot}%{_datadir}
rm -f %{buildroot}%{python3_sitelib}/oslo_vmware/locale/*/LC_*/oslo_vmware*po
rm -f %{buildroot}%{python3_sitelib}/oslo_vmware/locale/*pot
mv %{buildroot}%{python3_sitelib}/oslo_vmware/locale %{buildroot}%{_datadir}/locale
# Find language files
%find_lang oslo_vmware --all-name
%check
rm -f ./oslo_vmware/tests/test_hacking.py
export OS_TEST_PATH="./oslo_vmware/tests"
PYTHON=python3 stestr-3 --test-path $OS_TEST_PATH run
%files -n python3-oslo-vmware
%doc README.rst
%license LICENSE
%{python3_sitelib}/oslo_vmware
%{python3_sitelib}/*.egg-info
%exclude %{python3_sitelib}/oslo_vmware/tests
%if 0%{?with_doc}
%files -n python-oslo-vmware-doc
%doc doc/build/html
%license LICENSE
%endif
%files -n python3-oslo-vmware-tests
%{python3_sitelib}/oslo_vmware/tests
%files -n python-oslo-vmware-lang -f oslo_vmware.lang
%license LICENSE
%changelog
* Mon Jan 25 2021 zhangy1317 <zhangy1317@foxmail.com>
- Add BuildRequires python3-pip
* Wed Oct 21 2020 Joel Capitao <jcapitao@redhat.com> 3.7.0-2
- Enable sources tarball validation using GPG signature.
* Fri Sep 18 2020 RDO <dev@lists.rdoproject.org> 3.7.0-1
- Update to 3.7.0

View File

@ -1,87 +0,0 @@
%global _empty_manifest_terminate_build 0
Name: python-oslo-vmware
Version: 3.7.0
Release: 2
Summary: Oslo VMware library
License: Apache-2.0
URL: https://opendev.org/openstack/oslo.vmware
Source0: https://files.pythonhosted.org/packages/3b/be/c0a53bf599b8dc5469d8dfac16a64d816e33918b97fb25e46e2d8a2fdfb2/oslo.vmware-3.7.0.tar.gz
BuildArch: noarch
Requires: python3-PyYAML
Requires: python3-eventlet
Requires: python3-lxml
Requires: python3-netaddr
Requires: python3-pbr
Requires: python3-requests
Requires: python3-stevedore
Requires: python3-suds-jurko
Requires: python3-urllib3
%description
Oslo VMware library for OpenStack projects
%package -n python3-oslo-vmware
Summary: Oslo VMware library
Provides: python-oslo-vmware
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
BuildRequires: python3-pbr
%description -n python3-oslo-vmware
Oslo VMware library for OpenStack projects
%package help
Summary: Development documents and examples for oslo.vmware
Provides: python3-oslo-vmware-doc
%description help
Oslo VMware library for OpenStack projects
%prep
%autosetup -n oslo.vmware-3.7.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-oslo-vmware -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri Jan 22 2021 zhangy1317 <zhangy1317@foxmail.com>
- Add BuildRequires python3-pbr and python3-pbr
* Fri Jan 08 2021 Python_Bot <Python_Bot@openeuler.org>
- Package Spec generated