forked from cobbler/koan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
koan.spec
107 lines (87 loc) · 2.42 KB
/
koan.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
97
98
99
100
101
102
103
104
105
106
107
#
# RPM spec file for Koan
#
# Supported/tested build targets:
# - Fedora: 20, 19, 18
# - RHEL: 6, 5, 4
# - CentOS: 6, 5
# - SLES: 11sp3, 11sp2, 10
# - OpenSuSE: Factory, 13.1, 12.3, 12.2
#
# If it doesn't build on the Open Build Service (OBS) it's a bug.
# https://build.opensuse.org/project/subprojects/home:libertas-ict
#
%if 0%{?fedora}
%global use_python3 1
%global use_python2 0
%global pythonbin %{__python3}
%global python_sitelib %{python3_sitelib}
%else
%global use_python3 0
%global use_python2 1
%if 0%{?__python2:1}
%global pythonbin %{__python2}
%global python_sitelib %{python2_sitelib}
%else
%global pythonbin %{__python}
%global python_sitelib %{python_sitelib}
%endif
%endif
%{!?python_sitelib: %global python_sitelib %(%{pythonbin} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{pythonbin} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%global debug_package %{nil}
%define _binaries_in_noarch_packages_terminate_build 1
%define _unpackaged_files_terminate_build 1
%define name koan
%define version 2.9.0
%define unmangled_version 2.9.0
%define release 1
Summary: Libraries and tools to manage device registration in Zenoss
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{unmangled_version}.tar.gz
License: GPLv2
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
Vendor: Jorgen Maas <jorgen.maas@gmail.com>
Url: http://github.com/cobbler/koan
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArchitectures: noarch
%endif
%if %{use_python3}
BuildRequires: python3
Requires: python3
Requires: python3-netifaces
Requires: python3-simplejson
%else
BuildRequires: python >= 2.3
Requires: python >= 2.3
Requires: python-ethtool
Requires: python-simplejson
%if 0%{?suse_version} == 1010
BuildRequires: python-devel
%endif
%endif
%description
bla
bla bla
bla
%prep
%setup -n %{name}-%{unmangled_version}
%build
%{pythonbin} setup.py build
%install
test "x$RPM_BUILD_ROOT" != "x" && rm -rf $RPM_BUILD_ROOT
%{pythonbin} setup.py install -O1 --prefix=%{_prefix} --root=%{buildroot} --record=INSTALLED_FILES
%clean
rm -rf $RPM_BUILD_ROOT
%files -f INSTALLED_FILES
%defattr(-,root,root)
%{python_sitelib}/*
%doc README AUTHORS COPYING
%changelog
* Wed Apr 09 2015 Jörgen Maas <jorgen.maas@gmail.com>
- 2.9.0 - Initial release
# EOF