Blob Blame History Raw
%{!?_licensedir: %global license %%doc}

%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2:        %global __python2 /usr/bin/python2}
%{!?python2_sitelib:  %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif

%global modname gilmsg

Name:               gilmsg
Version:            0.1.2
Release:            1%{?dist}
Summary:            A reliability layer on top of fedmsg

Group:              Development/Libraries
License:            LGPLv2+
URL:                http://pypi.python.org/pypi/gilmsg
Source0:            https://pypi.python.org/packages/source/g/%{modname}/%{modname}-%{version}.tar.gz

BuildArch:          noarch

BuildRequires:      python2-devel
BuildRequires:      python-setuptools
BuildRequires:      fedmsg

# We need the "pre_fire_hook" feature added in fedmsg-0.16.0
Requires:           fedmsg >= 0.16.0

%description
gilmsg layers a reliability check in-band on top of the existing PUB-SUB fedmsg
framework.

Here's how it works, broadly:

- When ``gilmsg.publish(...)`` is invoked, you must declare a list of required
  recipients.
- A background thread is started that listens for ACK messages on
  the whole bus.
- If an ACK is not received from all ``recipients`` within a given timeout,
  then a ``Timeout`` exception is raised.

%prep
%setup -q -n %{modname}-%{version}

# Remove bundled egg-info in case it exists
rm -rf %{modname}.egg-info

%build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build


%install
%{__python2} setup.py install -O1 --skip-build --root=%{buildroot}

# gilmsg does not have a test suite of its own
#%%check
#%%{__python2} setup.py test

%files
%doc README.rst
%license LICENSE
%{python2_sitelib}/gilmsg.py*
%{python2_sitelib}/%{modname}-%{version}*

%{_bindir}/gilmsg-logger

%changelog
* Wed Sep 09 2015 Ralph Bean <rbean@redhat.com> - 0.1.2-1
- Initial package for Fedora