Skip to content

Commit e92a16a

Browse files
author
Sam Clements
committed
Merge branch 'feature/rpm'
2 parents d33b8ca + 6579e59 commit e92a16a

File tree

8 files changed

+88
-22
lines changed

8 files changed

+88
-22
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include LICENSE

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version=$(shell python setup.py --version)
2+
release=$(shell grep Release python-riemann-client.spec | awk '{ print $$2 }')
3+
4+
package=python-riemann-client-${version}-${release}.noarch.rpm
5+
tarball=${HOME}/rpmbuild/SOURCES/python-riemann-client-${version}.tar.gz
6+
7+
dist/${package}: python-riemann-client.spec ${tarball}
8+
rpmbuild -ba python-riemann-client.spec
9+
rsync -a ${HOME}/rpmbuild/RPMS/noarch/${package} dist/${package}
10+
11+
${tarball}: $(shell find riemann_client)
12+
tar -zcf ${tarball} . --exclude-vcs --transform='s/./python-riemann-client-${version}/'

README.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ As a library::
3131
Installation
3232
------------
3333

34-
``riemann-client`` requires Python 2.6 or 2.7, and can be installed with ``pip install riemann-client``. Python 3 is not supported due to the dependency on the Google `protobuf <https://pypi.python.org/pypi/protobuf>`_ package.
34+
``riemann-client`` requires Python 2.6 or 2.7, and can be installed with ``pip install riemann-client``. Python 3 is not supported due to the dependency on the Google `protobuf <https://pypi.python.org/pypi/protobuf>`_ package. RPMs can be built using `rpmbuild` - run `make` to build an RPM and copy it to `dist/`.
3535

3636
Requirements
3737
^^^^^^^^^^^^
@@ -44,6 +44,12 @@ Changelog
4444

4545
Version numbers use the `semver <http://semver.org/>`_ specification. A new major version indicates breaking changes.
4646

47+
Version 3.1.0
48+
^^^^^^^^^^^^^
49+
50+
* Relaxed version requirements to fit CentOS 6 packages
51+
* Added Makefile and specfile for building RPMs with rpmbuild
52+
4753
Version 3.0.0
4854
^^^^^^^^^^^^^
4955

python-riemann-client.spec

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
%define version %(python setup.py --version)
2+
3+
Name: python-riemann-client
4+
Version: %{version}
5+
Release: 1
6+
7+
Group: Development/Libraries
8+
Url: https://github.com/borntyping/python-riemann-client
9+
Summary: A Riemann client and command line tool
10+
Vendor: Sam Clements <[email protected]>
11+
License: MIT
12+
13+
Source0: %{name}-%{version}.tar.gz
14+
15+
Requires: python
16+
Requires: python-argparse
17+
Requires: protobuf-python
18+
BuildRequires: python-setuptools
19+
20+
BuildArch: noarch
21+
22+
23+
%description
24+
A Riemann client library and command line tool for Python.
25+
26+
https://github.com/borntyping/python-riemann-client
27+
28+
%prep
29+
%setup -q -n %{name}-%{version}
30+
31+
%build
32+
python setup.py build
33+
34+
%install
35+
rm -rf $RPM_BUILD_ROOT
36+
python setup.py install --no-compile --skip-build --root=$RPM_BUILD_ROOT
37+
38+
%clean
39+
rm -rf $RPM_BUILD_ROOT
40+
41+
%files
42+
%defattr(-,root,root)
43+
%doc README.rst LICENSE
44+
%{_bindir}/riemann-client
45+
%{python_sitelib}/*

riemann_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""A Python Riemann client and command line tool"""
22

3-
__version__ = '3.0.3'
3+
__version__ = '4.0.0'
44
__author__ = 'Sam Clements <[email protected]>'

riemann_client/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def create_event(data):
3737
def send_event(self, event):
3838
"""Wraps an event in a message and sends it to Riemann"""
3939
message = riemann_client.riemann_pb2.Msg()
40-
message.events.extend([event])
40+
message.events.add().MergeFrom(event)
4141
return self.transport.send(message)
4242

4343
def event(self, **data):
@@ -83,5 +83,5 @@ def flush(self):
8383
self.queue = riemann_client.riemann_pb2.Msg()
8484

8585
def send_event(self, event):
86-
self.queue.events.extend([event])
86+
self.queue.events.add().MergeFrom(event)
8787
return event

riemann_client/riemann_pb2.py

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

setup.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,38 @@
22

33
import setuptools
44

5+
DESCRIPTION = """
6+
A Riemann client library and command line tool for Python.
7+
8+
https://github.com/borntyping/python-riemann-client
9+
"""
10+
511
setuptools.setup(
6-
name = "riemann-client",
7-
version = '3.0.3',
12+
name='riemann-client',
13+
version='4.0.0',
814

9-
author = "Sam Clements",
10-
author_email = "[email protected]",
15+
author="Sam Clements",
16+
author_email="[email protected]",
1117

12-
url = "https://github.com/borntyping/python-riemann-client",
13-
description = "A Riemann client and command line tool",
14-
long_description = open('README.rst').read(),
18+
url="https://github.com/borntyping/python-riemann-client",
19+
description="A Riemann client and command line tool",
20+
long_description=DESCRIPTION.strip(),
21+
license="MIT",
1522

16-
packages = setuptools.find_packages(),
23+
packages=setuptools.find_packages(),
1724

18-
install_requires = [
19-
'argparse==1.1',
20-
'protobuf==2.5.0',
25+
install_requires=[
26+
'argparse>=1.1',
27+
'protobuf>=2.3.0',
2128
],
2229

23-
entry_points = {
30+
entry_points={
2431
'console_scripts': [
2532
'riemann-client = riemann_client.command:main',
2633
]
2734
},
2835

29-
classifiers = [
36+
classifiers=[
3037
'Development Status :: 5 - Production/Stable',
3138
'License :: OSI Approved',
3239
'License :: OSI Approved :: MIT License',

0 commit comments

Comments
 (0)