diff --git a/.gitignore b/.gitignore index e69de29..7c42bce 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/pyxs-0.4.1.tar.gz diff --git a/python-pyxs.spec b/python-pyxs.spec new file mode 100644 index 0000000..d2727e9 --- /dev/null +++ b/python-pyxs.spec @@ -0,0 +1,139 @@ +# what it's called on pypi +%global srcname pyxs +# what it's imported as +%global libname pyxs +# name of egg info directory +%global eggname pyxs +# package name fragment +%global pkgname pyxs + +%global _description \ +It's a pure Python XenStore client implementation, which covers all of the\ +libxs features and adds some nice Pythonic sugar on top. + +%if 0%{?fedora} >= 30 +%bcond_with python2 +%else +%bcond_without python2 +%endif +%bcond_without python3 + +%if 0%{?rhel} && 0%{?rhel} < 7 +%bcond_with tests +%else +%bcond_without tests +%endif + + +Name: python-%{pkgname} +Version: 0.4.1 +Release: 8%{?dist} +Summary: Pure Python bindings to XenStore +License: GPLv3 +URL: https://github.com/selectel/pyxs +# PyPI tarball doesn't have tests +Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz +Patch0: remove-pytest-runner-requirement.patch +BuildArch: noarch + + +%description %{_description} + + +%if %{with python2} +%package -n python2-%{pkgname} +Summary: %{summary} +BuildRequires: python2-devel +BuildRequires: python2-setuptools +%if %{with tests} +# Test use pytest's yield_fixture decorator, which was first added in 2.4. +# https://github.com/pytest-dev/pytest/blob/2.4.0/CHANGELOG#L26-L33 +BuildRequires: python2-pytest >= 2.4 +%endif +%{?python_provide:%python_provide python2-%{pkgname}} + + +%description -n python2-%{pkgname} %{_description} +%endif + + +%if %{with python3} +%package -n python%{python3_pkgversion}-%{pkgname} +Summary: %{summary} +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +%if %{with tests} +# Test use pytest's yield_fixture decorator, which was first added in 2.4. +# https://github.com/pytest-dev/pytest/blob/2.4.0/CHANGELOG#L26-L33 +BuildRequires: python%{python3_pkgversion}-pytest >= 2.4 +%endif +%{?python_provide:%python_provide python%{python3_pkgversion}-%{pkgname}} + + +%description -n python%{python3_pkgversion}-%{pkgname} %{_description} +%endif + + +%prep +%autosetup -n %{srcname}-%{version} -p 1 + + +%build +%{?with_python2:%py2_build} +%{?with_python3:%py3_build} + + +%install +%{?with_python2:%py2_install} +%{?with_python3:%py3_install} + + +%if %{with tests} +%check +%{?with_python2:%{__python2} -m pytest --verbose} +%{?with_python3:%{__python3} -m pytest --verbose} +%endif + + +%if %{with python2} +%files -n python2-%{pkgname} +%license LICENSE +%doc README +%{python2_sitelib}/%{libname} +%{python2_sitelib}/%{eggname}-%{version}-py%{python2_version}.egg-info +%endif + + +%if %{with python3} +%files -n python%{python3_pkgversion}-%{pkgname} +%license LICENSE +%doc README +%{python3_sitelib}/%{libname} +%{python3_sitelib}/%{eggname}-%{version}-py%{python3_version}.egg-info +%endif + + +%changelog +* Mon Aug 19 2019 Miro Hrončok - 0.4.1-8 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 0.4.1-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 0.4.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Tue Sep 18 2018 Carl George - 0.4.1-5 +- Disable python2 subpackage on F30+ rhbz#1630329 + +* Sat Jul 14 2018 Fedora Release Engineering - 0.4.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Tue Jun 19 2018 Miro Hrončok - 0.4.1-3 +- Rebuilt for Python 3.7 + +* Fri Feb 09 2018 Fedora Release Engineering - 0.4.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Tue Jul 25 2017 Carl George - 0.4.1-1 +- Initial package diff --git a/remove-pytest-runner-requirement.patch b/remove-pytest-runner-requirement.patch new file mode 100644 index 0000000..92e142c --- /dev/null +++ b/remove-pytest-runner-requirement.patch @@ -0,0 +1,11 @@ +diff -Nurp pyxs-0.4.1.orig/setup.py pyxs-0.4.1/setup.py +--- pyxs-0.4.1.orig/setup.py 2016-05-10 16:11:11.000000000 -0500 ++++ pyxs-0.4.1/setup.py 2017-07-25 16:26:30.265116680 -0500 +@@ -31,7 +31,6 @@ CLASSIFIERS = ( + setup(name="pyxs", + version="0.4.1", + packages=["pyxs"], +- setup_requires=["pytest-runner"], + tests_require=["pytest"], + platforms=["any"], + diff --git a/sources b/sources index e69de29..dfa25f9 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (pyxs-0.4.1.tar.gz) = 3f99388a55a519acb8667dd376de5f5a87ecee2dfacaac391e5c345f34076cca9ad2d12961841bae2ff9ebfd74be78dcce0a4447a91d442820c74f350ec2a8aa