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 -URL: http://pypi.python.org/pypi/pyngus/%{version} -Source0: http://pypi.python.org/packages/source/p/pyngus/pyngus-%{version}.tar.gz +URL: https://github.com/kgiusti/%{srcname} +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 -%description -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 -%prep -%setup -q -n pyngus-%{version} +%description -n python3-%{srcname} %{_description} +Python 3 version. +%prep +%autosetup -n %{srcname}-%{version} %build -# nothing to build - - +%py2_build +%py3_build %install -%{__python} setup.py install --root %{buildroot} - - - -%files -%{?python_sitelib}/pyngus -%if "%{python_version}" >= "2.6" -%{python_sitelib}/pyngus-*.egg-info -%doc PKG-INFO -%endif - - +%py2_install +%py3_install + +%check +# some number of tests doesn't work +pushd tests/ + PYTHONPATH=%{buildroot}%{python2_sitelib} %{__python2} test-runner || : + PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} test-runner || : +popd + +%files -n python2-%{srcname} +%license LICENSE +%doc README.md examples/ +%{python2_sitelib}/%{srcname}/ +%{python2_sitelib}/%{srcname}-*.egg-info/ + +%files -n python3-%{srcname} +%license LICENSE +%doc README.md examples/ +%{python3_sitelib}/%{srcname}/ +%{python3_sitelib}/%{srcname}-*.egg-info/ %changelog +* Mon May 16 2016 Philip Worrall - 2.0.3-4 +- Add python3 subpackage (http://fedora.portingdb.xyz/pkg/python-pyngus/) +- 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