Skip to content

Commit 094e18e

Browse files
committed
Add rpm spec file
1 parent f4183a7 commit 094e18e

2 files changed

Lines changed: 114 additions & 1 deletion

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ var/
2323
# Usually these files are written by a python script from a template
2424
# before PyInstaller builds the exe, so as to inject date/other infos into it.
2525
*.manifest
26-
*.spec
2726
# Installer logs
2827
pip-log.txt
2928
pip-delete-this-directory.txt

python-hawkular-client.spec

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
%global srcname hawkular-client
2+
%global _docdir_fmt %{name}
3+
4+
%if 0%{?fedora}
5+
%bcond_without python3
6+
%else
7+
%bcond_with python3
8+
%endif
9+
10+
Name: python-%{srcname}
11+
Version: 0.5.1
12+
Release: 1%{?dist}
13+
Summary: Python client to communicate with Hawkular server over HTTP(S)
14+
15+
License: ASL 2.0
16+
URL: https://github.com/google/%{srcname}
17+
Source0: https://pypi.python.org/packages/source/h/%{srcname}/%{srcname}-%{version}.tar.gz
18+
19+
BuildArch: noarch
20+
BuildRequires: python2-devel
21+
BuildRequires: python-setuptools
22+
## For tests
23+
#BuildRequires: python-mox
24+
#Requires: python-dateutil
25+
#Requires: python-gflags
26+
#Requires: pytz
27+
28+
%description
29+
Python client to access Hawkular-Metrics, an abstraction to invoke REST-methods
30+
on the server endpoint using urllib2. No external dependencies.
31+
32+
33+
%if %{with python3}
34+
%package -n python3-%{srcname}
35+
Summary: Python 3 client to communicate with Hawkular server over HTTP(S)
36+
BuildRequires: python3-devel
37+
BuildRequires: python3-setuptools
38+
BuildRequires: python-tools
39+
# For tests
40+
# python-mox doesn't work with python3
41+
# https://bugzilla.redhat.com/show_bug.cgi?id=1209203
42+
#BuildRequires: python3-mox
43+
Requires: python3-dateutil
44+
Requires: python3-gflags
45+
Requires: python3-pytz
46+
47+
%description -n python3-%{srcname}
48+
Python client to access Hawkular-Metrics, an abstraction to invoke REST-methods
49+
on the server endpoint using urllib2. No external dependencies.
50+
%endif # with python3
51+
52+
%prep
53+
%setup -qc
54+
mv %{srcname}-%{version} python2
55+
%if %{with python3}
56+
cp -a python2 python3
57+
2to3 --write --nobackups python3
58+
%endif # with python3
59+
60+
61+
%build
62+
pushd python2
63+
%{__python2} setup.py build
64+
popd
65+
66+
%if %{with python3}
67+
pushd python3
68+
%{__python3} setup.py build
69+
popd
70+
%endif # with python3
71+
72+
73+
%install
74+
%if %{with python3}
75+
pushd python3
76+
%{__python3} setup.py install --skip-build --root %{buildroot}
77+
popd
78+
%endif # with python3
79+
80+
pushd python2
81+
%{__python2} setup.py install --skip-build --root %{buildroot}
82+
popd
83+
84+
85+
%check
86+
pushd python2
87+
%{__python2} setup.py test
88+
popd
89+
%if %{with python3}
90+
pushd python3
91+
%{__python3} setup.py test
92+
popd
93+
%endif # with python3
94+
95+
96+
%files
97+
%doc python2/README.rst
98+
%{python2_sitelib}/*
99+
100+
%if %{with python3}
101+
%files -n python3-%{srcname}
102+
%doc python3/README.rst
103+
%{python3_sitelib}/*
104+
%endif # with python3
105+
106+
%changelog
107+
* Tue Jan 24 2017 Troy Dawson <tdawson@redhat.com> - 0.5.1-1
108+
- Update to 0.5.1
109+
110+
* Thu Jan 12 2017 Troy Dawson <tdawson@redhat.com> - 0.5.0-1
111+
- Update to 0.5.0
112+
113+
* Tue Sep 20 2016 Troy Dawson <tdawson@redhat.com> - 0.4.5-1
114+
- Initial package

0 commit comments

Comments
 (0)