Skip to content

Commit 976e7d7

Browse files
authored
Merge pull request #38 from zgalor/add_rpm_spec
Add rpm spec file
2 parents f4183a7 + a2747e8 commit 976e7d7

2 files changed

Lines changed: 105 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: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
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+
BuildRequires: python2-pypandoc
23+
## For tests
24+
#BuildRequires: python-mox
25+
#Requires: python-dateutil
26+
#Requires: python-gflags
27+
#Requires: pytz
28+
29+
%description
30+
Python client to access Hawkular-Metrics, an abstraction to invoke REST-methods
31+
on the server endpoint using urllib2. No external dependencies.
32+
33+
34+
%if %{with python3}
35+
%package -n python3-%{srcname}
36+
Summary: Python 3 client to communicate with Hawkular server over HTTP(S)
37+
BuildRequires: python3-devel
38+
BuildRequires: python3-setuptools
39+
BuildRequires: python-tools
40+
BuildRequires: python3-pypandoc
41+
# For tests
42+
# python-mox doesn't work with python3
43+
# https://bugzilla.redhat.com/show_bug.cgi?id=1209203
44+
#BuildRequires: python3-mox
45+
Requires: python3-dateutil
46+
Requires: python3-gflags
47+
Requires: python3-pytz
48+
49+
%description -n python3-%{srcname}
50+
Python client to access Hawkular-Metrics, an abstraction to invoke REST-methods
51+
on the server endpoint using urllib2. No external dependencies.
52+
%endif # with python3
53+
54+
%prep
55+
%setup -qc
56+
mv python-%{srcname}-%{version} python2
57+
%if %{with python3}
58+
cp -a python2 python3
59+
2to3 --write --nobackups python3
60+
%endif # with python3
61+
62+
63+
%build
64+
pushd python2
65+
%{__python2} setup.py build
66+
popd
67+
68+
%if %{with python3}
69+
pushd python3
70+
%{__python3} setup.py build
71+
popd
72+
%endif # with python3
73+
74+
75+
%install
76+
%if %{with python3}
77+
pushd python3
78+
%{__python3} setup.py install --skip-build --root %{buildroot}
79+
popd
80+
%endif # with python3
81+
82+
pushd python2
83+
%{__python2} setup.py install --skip-build --root %{buildroot}
84+
popd
85+
86+
87+
%files
88+
%doc python2/README.rst
89+
%{python2_sitelib}/*
90+
91+
%if %{with python3}
92+
%files -n python3-%{srcname}
93+
%doc python3/README.rst
94+
%{python3_sitelib}/*
95+
%endif # with python3
96+
97+
%changelog
98+
* Tue Jan 24 2017 Troy Dawson <tdawson@redhat.com> - 0.5.1-1
99+
- Update to 0.5.1
100+
101+
* Thu Jan 12 2017 Troy Dawson <tdawson@redhat.com> - 0.5.0-1
102+
- Update to 0.5.0
103+
104+
* Tue Sep 20 2016 Troy Dawson <tdawson@redhat.com> - 0.4.5-1
105+
- Initial package

0 commit comments

Comments
 (0)