This repository has been archived by the owner on Aug 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkaraage-cluster-tools.spec
96 lines (77 loc) · 2.42 KB
/
karaage-cluster-tools.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
%if 0%{?fedora} > 12
%global with_python3 1
%else
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
%endif
%global srcname karaage-cluster-tools
Name: karaage-cluster-tools
Version: 1.2.3
Release: 1%{?dist}
Summary: Karaage cluster management tools
Group: Development/Libraries
License: GPLv3+
Url: https://github.com/Karaage-Cluster/karaage-cluster-tools
Source: %{name}_%{version}.tar.gz
BuildArch: noarch
%{?el6:Requires: python-argparse}
%if 0%{?with_python3}
BuildRequires: python3-devel, python3-setuptools, python3-six, python3-alogger
%if 0%{?fedora} > 20
BuildRequires: python-flake8, python3-flake8
%endif # if fedora > 20
%else
BuildRequires: python2-devel, python-setuptools, python-six, python-alogger
%if 0%{?fedora} > 20
BuildRequires: python-flake8
%endif # fedora > 20
%endif # if with_python2
%description
This package contains programs to be installed on a cluster for management of
the cluster.
At the present time it will automatically upload usage data to karaage for
processing with the karaage-usage plugin.
%changelog │
* Wed Apr 1 2015 Brian May <brian@microcomaustralia.com.au> 1.2.3-1 │
- Fix RPM packaging.
%prep
%setup -q
%build
%if 0%{?with_python3}
%{__python3} setup.py build
%else
%{__python2} setup.py build
%endif # with_python3
%install
rm -rf %{buildroot}
%if 0%{?with_python3}
%if 0%{?fedora} > 20
%{__python3} /usr/bin/flake8 .
%endif # fedora > 20
%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
%else
%if 0%{?fedora} > 20
%{__python2} /usr/bin/flake8 .
%endif # fedora > 20
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
%endif # with_python3
mkdir -p $RPM_BUILD_ROOT/etc/cron.d
cp debian/karaage-cluster-tools.cron.d $RPM_BUILD_ROOT/etc/cron.d/karaage-cluster-tools
%check
%if 0%{?with_python3}
%{__python3} setup.py test
%else
%{__python2} setup.py test
%endif # with_python3
%clean
rm -rf $RPM_BUILD_ROOT
%files
%doc AUTHORS.txt COPYING.txt README.rst
%config(noreplace) /etc/cron.d/*
%config(noreplace) /etc/karaage3/*
/usr/bin/*
%if 0%{?with_python3}
%{python3_sitelib}/*
%else
%{python2_sitelib}/*
%endif # with_python3