diff options
authorIgor Gnatenko <>2016-05-17 14:36:22 +0200
committerIgor Gnatenko <>2016-05-17 14:36:22 +0200
commitb8ac74a26347f06b6be68dcbd8cdaa626435c1d0 (patch)
parentded1c4be7b4e381dd347cbf866f8cc22b8eaf89b (diff)
add python3 subpkg; modernize spec (RHBZ #1336572)
Signed-off-by: Igor Gnatenko <>
2 files changed, 63 insertions, 30 deletions
diff --git a/python-pyngus.spec b/python-pyngus.spec
index 553fc37..d6052bd 100644
--- a/python-pyngus.spec
+++ b/python-pyngus.spec
@@ -1,54 +1,87 @@
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_version: %global python_version %(%{__python} -c "from distutils.sysconfig import get_python_version; print get_python_version()")}
+%global srcname pyngus
-Name: python-pyngus
+# Don't duplicate the same documentation
+%global _docdir_fmt %{name}
+Name: python-%{srcname}
Version: 2.0.3
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Callback API implemented over Proton
License: ASL 2.0
+Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildArch: noarch
-BuildRequires: python-setuptools
-Requires: python-qpid-proton >= 0.12.1
-Requires: qpid-proton-c >= 0.12.1
+%global _description \
+A connection oriented messaging framework using QPID Proton.\
+It provides a callback-based API for message passing.
+%description %{_description}
+%package -n python2-%{srcname}
+Summary: %{summary}
+%{?python_provide:%python_provide python2-%{srcname}}
+BuildRequires: python2-devel
+BuildRequires: python2-setuptools
+BuildRequires: python-qpid-proton
+Requires: python-qpid-proton
-A connection oriented messaging framework using QPID Proton.
-It provides a callback-based API for message passing.
+%description -n python2-%{srcname} %{_description}
+Python 2 version.
+%package -n python3-%{srcname}
+Summary: %{summary}
+%{?python_provide:%python_provide python3-%{srcname}}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-qpid-proton
+Requires: python3-qpid-proton
-%setup -q -n pyngus-%{version}
+%description -n python3-%{srcname} %{_description}
+Python 3 version.
+%autosetup -n %{srcname}-%{version}
-# nothing to build
-%{__python} install --root %{buildroot}
-%if "%{python_version}" >= "2.6"
-%doc PKG-INFO
+# some number of tests doesn't work
+pushd tests/
+ PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} test-runner || :
+ PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} test-runner || :
+%files -n python2-%{srcname}
+%license LICENSE
+%doc examples/
+%files -n python3-%{srcname}
+%license LICENSE
+%doc examples/
+* Mon May 16 2016 Philip Worrall <> - 2.0.3-4
+- Add python3 subpackage (
+- Edit spec to use the python2/3 specific installation macros
+- Add global macros for package name and summary
+- Add calls to run the testsuite
+- Point the source url at the upstream github repository (for license files)
* Wed Mar 23 2016 Irina Boverman <> - 2.0.3-3
- Rebuilt against qpid-proton 0.12.1
diff --git a/sources b/sources
index 8b49291..368d8c1 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-a58065524f54dbaa9ed9efd84ae28f2f pyngus-2.0.3.tar.gz
+2cfd36e1f2bc69e1efe8c557f310ee25 pyngus-2.0.3.tar.gz