From 1db34a2767b87bcdc576d2579da1297f9074c248 Mon Sep 17 00:00:00 2001 From: zhangy1317 Date: Fri, 15 Jan 2021 14:40:53 +0800 Subject: [PATCH] change spec --- python-oslo-privsep.spec | 137 +++++++++++++++++++++++++++++++++++++++ python-oslo.privsep.spec | 78 ---------------------- 2 files changed, 137 insertions(+), 78 deletions(-) create mode 100644 python-oslo-privsep.spec delete mode 100644 python-oslo.privsep.spec diff --git a/python-oslo-privsep.spec b/python-oslo-privsep.spec new file mode 100644 index 0000000..e5f9fc6 --- /dev/null +++ b/python-oslo-privsep.spec @@ -0,0 +1,137 @@ +%{!?upstream_version: %global upstream_version %{version}%{?milestone}} +%global with_doc 1 + +Name: python-oslo-privsep +Version: 2.4.0 +Release: 2 +Summary: OpenStack library for privilege separation +License: ASL 2.0 +URL: https://opendev.org/openstack/oslo.privsep +Source0: https://tarballs.openstack.org/oslo.privsep/oslo.privsep-2.4.0.tar.gz +BuildArch: noarch + +BuildRequires: git + + +%description +OpenStack library for privilege separation + +%package -n python3-oslo-privsep +Summary: OpenStack library for privilege separation +%{?python_provide:%python_provide python3-oslo-privsep} +Obsoletes: python2-oslo-privsep < %{version}-%{release} + +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pbr >= 1.8 +BuildRequires: python3-babel >= 1.3 +BuildRequires: python3-oslo-log >= 3.36.0 +BuildRequires: python3-oslo-i18n >= 3.15.3 +BuildRequires: python3-oslo-config >= 2:5.2.0 +BuildRequires: python3-oslotest +BuildRequires: python3-oslo-utils >= 3.33.0 +BuildRequires: python3-eventlet +BuildRequires: python3-greenlet +BuildRequires: python3-cffi +BuildRequires: python3-msgpack >= 0.5.0 +Requires: python3-eventlet >= 0.21.0 +Requires: python3-greenlet >= 0.4.13 +Requires: python3-oslo-log >= 3.36.0 +Requires: python3-oslo-i18n >= 3.15.3 +Requires: python3-oslo-config >= 2:5.2.0 +Requires: python3-oslo-utils >= 3.33.0 +Requires: python3-cffi +Requires: python3-msgpack >= 0.6.0 +Requires: python-oslo-privsep-lang = %{version}-%{release} + + +%description -n python3-oslo-privsep +OpenStack library for privilege separation + +%package -n python3-oslo-privsep-tests +Summary: OpenStack library for privilege separation tests +Requires: python3-oslo-privsep + +%description -n python3-oslo-privsep-tests +OpenStack library for privilege separation +This package contains the test files. + +%if 0%{?with_doc} +%package -n python-oslo-privsep-doc +Summary: oslo.privsep documentation +BuildRequires: python3-sphinx +BuildRequires: python3-sphinxcontrib-apidoc +BuildRequires: python3-openstackdocstheme + +%description -n python-oslo-privsep-doc +Documentation for oslo.privsep +%endif + + +%package -n python-oslo-privsep-lang +Summary: Translation files for Oslo privsep library + +%description -n python-oslo-privsep-lang +Translation files for Oslo privsep library + + +%prep + +%autosetup -n oslo.privsep-%{upstream_version} -S git +# Remove bundled egg-info +rm -rf oslo.privsep.egg-info +rm -rf {,test-}requirements.txt + +%build +%{py3_build} + +%if 0%{?with_doc} +# generate html docs +export PYTHONPATH=. +sphinx-build -W -b html doc/source doc/build/html +# remove the sphinx-build leftovers +rm -rf doc/build/html/.{doctrees,buildinfo} +%endif + +# Generate i18n files +%{__python3} setup.py compile_catalog -d build/lib/oslo_privsep/locale --domain oslo_privsep + +%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_privsep/locale/*/LC_*/oslo_privsep*po +rm -f %{buildroot}%{python3_sitelib}/oslo_privsep/locale/*pot +mv %{buildroot}%{python3_sitelib}/oslo_privsep/locale %{buildroot}%{_datadir}/locale + +# Find language files +%find_lang oslo_privsep --all-name + +%check +%{__python3} setup.py test ||: + + +%files -n python3-oslo-privsep +%doc README.rst +%{python3_sitelib}/oslo_privsep +%{python3_sitelib}/oslo.privsep-*-py%{python3_version}.egg-info +%exclude %{python3_sitelib}/oslo_privsep/tests +%{_bindir}/privsep-helper + + +%files -n python3-oslo-privsep-tests +%{python3_sitelib}/oslo_privsep/tests + +%if 0%{?with_doc} +%files -n python-oslo-privsep-doc +%license LICENSE +%doc doc/build/html +%endif + +%files -n python-oslo-privsep-lang -f oslo_privsep.lang +%license LICENSE + +%changelog +* Tue Jan 15 2021 zhangy 2021.1.15 +- Update to 2021.1.15 diff --git a/python-oslo.privsep.spec b/python-oslo.privsep.spec deleted file mode 100644 index 51844c5..0000000 --- a/python-oslo.privsep.spec +++ /dev/null @@ -1,78 +0,0 @@ -%global _empty_manifest_terminate_build 0 -Name: python-oslo-privsep -Version: 2.4.0 -Release: 1 -Summary: OpenStack library for privilege separation -License: Apache-2.0 -URL: https://opendev.org/openstack/oslo.privsep -Source0: https://files.pythonhosted.org/packages/97/c5/491c2701dc693dd6b6f2f9c319f5ddb3f52d37a0af9e11f598bfb1e643aa/oslo.privsep-2.4.0.tar.gz -BuildArch: noarch - -Requires: python3-cffi -Requires: python3-eventlet -Requires: python3-greenlet -Requires: python3-msgpack - -%description -OpenStack library for privilege separation - - -%package -n python3-oslo-privsep -Summary: OpenStack library for privilege separation -Provides: python-oslo-privsep -BuildRequires: python3-devel -BuildRequires: python3-setuptools -%description -n python3-oslo-privsep -OpenStack library for privilege separation - - -%package help -Summary: Development documents and examples for oslo.privsep -Provides: python3-oslo-privsep-doc -%description help -OpenStack library for privilege separation - - -%prep -%autosetup -n oslo.privsep-2.4.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-privsep -f filelist.lst -%dir %{python3_sitelib}/* - -%files help -f doclist.lst -%{_docdir}/* - -%changelog -* Fri Jan 08 2021 Python_Bot -- Package Spec generated -- Gitee