Blob Blame History Raw
%global pkgname fedora-messaging
%global srcname fedora_messaging
%global desc \
Tools and APIs to make working with AMQP in Fedora easier.

Name:           %{pkgname}
Version:        1.0.0
Release:        1%{?dist}
Summary:        Set of tools for using Fedora's messaging infrastructure

License:        GPLv2+
URL:            https://github.com/fedora-infra/fedora-messaging
Source0:        %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
Patch0:         Use-old-napoleon-module-for-EPEL-7.patch
BuildArch:      noarch

BuildRequires:  python-devel
BuildRequires:  python-blinker
BuildRequires:  python-click
BuildRequires:  python-jsonschema
BuildRequires:  python-mock
BuildRequires:  python-pika >= 0.12.0
BuildRequires:  pyOpenSSL
BuildRequires:  pytest
BuildRequires:  python-pytoml
BuildRequires:  python-pytz
BuildRequires:  python-six
BuildRequires:  python-sphinx
BuildRequires:  python-sphinxcontrib-napoleon
Requires:       python-%{pkgname} = %{version}-%{release}

%description %{desc}

%package     -n python2-%{pkgname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{pkgname}}
# Drop when https://github.com/fedora-infra/fedora-messaging/pull/51 is released
Requires:       python-blinker
Requires:       python-click
Requires:       python-jsonschema
Requires:       python-pika >= 0.12.0
Requires:       pyOpenSSL
Requires:       python-pytoml
Requires:       python-six
Requires:       python-pytz

%description -n python2-%{pkgname} %{desc}


%package doc
Summary:        Documentation for %{pkgname}
%description doc
Documentation for %{pkgname}.


%prep
%autosetup -p1 -n %{pkgname}-%{version}b1

# Twisted is too old in EPEL7 to bother supporting.
rm -f fedora_messaging/tests/unit/twisted/*.py

# Swathes of unit tests fail due to old versions of mock
rm -f fedora_messaging/tests/unit/test_config.py
rm -f fedora_messaging/tests/unit/test_cli.py

%build
%py2_build
# generate docs
PYTHONPATH=${PWD} sphinx-build -b man -d docs/_build/doctrees docs docs/_build/man
# remove the sphinx-build leftovers
rm -rf docs/_build/*/.buildinfo


%install
%py2_install
install -D -m 644 config.toml.example $RPM_BUILD_ROOT%{_sysconfdir}/fedora-messaging/config.toml
install -D -m 644 docs/_build/man/fedora-messaging.1 $RPM_BUILD_ROOT%{_mandir}/man1/fedora-messaging.1


%check
export PYTHONPATH=.
py.test -vv fedora_messaging/tests/unit/


%files
%license LICENSE
%doc README.rst
%config(noreplace) %{_sysconfdir}/fedora-messaging/config.toml
%{_mandir}/man1/%{name}.*
%{_bindir}/%{name}

%files -n python2-%{pkgname}
%license LICENSE
%{python2_sitelib}/%{srcname}
%{python2_sitelib}/%{srcname}-%{version}b1-py%{python2_version}.egg-info

%files doc
%license LICENSE
%doc README.rst docs/*.rst


%changelog
* Wed Oct 10 2018 Jeremy Cline <jeremy@jcline.org> - 1.0.0-1
- Update to v1.0.0

* Fri Sep 07 2018 Jeremy Cline <jeremy@jcline.org> - 1.0.0-0.2b1
- Move dependency generator macro to top of file
- Depend on version + release for the library
- Add python_provide macro

* Wed Aug 29 2018 Jeremy Cline <jeremy@jcline.org> - 1.0.0-0.1b1
- Update to 1.0.0b1
- Drop Python 2 package for Rawhide

* Wed Aug 15 2018 Aurelien Bompard <abompard@fedoraproject.org> - 1.0.0-0.1.a1
- Initial package