File koan.spec of Package koan
139
1
#
2
# spec file for package koan
3
#
4
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via http://bugs.opensuse.org/
16
#
17
18
19
%if 0%{?fedora} || 0%{?suse_version} > 1320
20
%global use_python3 1
21
%global use_python2 0
22
%global pythonbin %{__python3}
23
%global python_sitelib %{python3_sitelib}
24
%else
25
%global use_python3 0
26
%global use_python2 1
27
%if 0%{?__python2:1}
28
%global pythonbin %{__python2}
29
%else
30
%global pythonbin %{__python}
31
%endif
32
%endif
33
34
%{!?python_sitelib: %global python_sitelib %(%{pythonbin} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
35
%{!?python_sitearch: %global python_sitearch %(%{pythonbin} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
36
37
%global debug_package %{nil}
38
%define _binaries_in_noarch_packages_terminate_build 1
39
%define _unpackaged_files_terminate_build 1
40
41
%define unmangled_version 2.9.0
42
43
Summary: Libraries and tools to manage device registration in Zenoss
44
License: GPL-2.0
45
Group: Development/Libraries/Python
46
Name: koan
47
Version: 2.9.0
48
Release: 1
49
Source0: %{name}-%{unmangled_version}.tar.gz
50
Patch0: koan_old_cobbler_compat.diff
51
Patch1: koan-no-xend.dif
52
Patch2: koan-detect-os_version.dif
53
Patch3: koan-use-kvm-acceleration-if-available.dif
54
Patch4: fix-exception.dif
55
Patch5: fix-koan-missing-args-and-location.patch
56
Patch6: virt-install-without-generic26.patch
57
Patch7: use_grub2_on_suse.diff
58
Patch8: sles15.patch
59
Patch9: add-missing-Koan-default-members.diff
60
Patch10: decode-subprocess_get_response-results.diff
61
Patch11: fix-imports-in-qcreate.diff
62
Patch12: virt-setup-suse.diff
63
Patch13: support-cobbler-2.X-kickstart-profile-data.diff
64
Patch14: fix-grub2-entry-paths.diff
65
66
67
BuildRoot: %{_tmppath}/%{name}-%{version}-build
68
Prefix: %{_prefix}
69
Url: http://github.com/cobbler/koan
70
71
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
72
BuildArch: noarch
73
%endif
74
75
%if %{use_python3}
76
BuildRequires: python3
77
Requires: python3
78
Requires: python3-netifaces
79
Requires: python3-simplejson
80
%else
81
BuildRequires: python >= 2.3
82
Requires: python >= 2.3
83
Requires: python-ethtool
84
Requires: python-simplejson
85
86
%if 0%{?suse_version} == 1010
87
BuildRequires: python-devel
88
%endif
89
%endif
90
%if 0%{?rhel_version} && 0%{?rhel_version} < 800
91
Requires: virt-install
92
%else
93
Recommends: virt-install
94
%endif
95
96
%description
97
Koan stands for kickstart-over-a-network and allows for both
98
network installation of new virtualized guests and reinstallation
99
of an existing system. For use with a boot-server configured with Cobbler.
100
101
%prep
102
%setup -n %{name}-%{unmangled_version}
103
%patch0 -p0
104
%patch1 -p1
105
%patch2 -p1
106
%patch3 -p1
107
%patch4 -p1
108
%patch5 -p1
109
%patch6 -p1
110
%patch7 -p1
111
%patch8 -p1
112
%patch9 -p1
113
%patch10 -p1
114
%patch11 -p1
115
%patch12 -p1
116
%patch13 -p1
117
%patch14 -p1
118
119
%build
120
%{pythonbin} setup.py build
121
122
%install
123
%{pythonbin} setup.py install -O1 --prefix=%{_prefix} --root=%{buildroot} --record=INSTALLED_FILES
124
125
%clean
126
rm -rf $RPM_BUILD_ROOT
127
128
%files
129
%defattr(-,root,root)
130
%{python_sitelib}/koan/
131
%{python_sitelib}/koan-*.egg-info
132
%{_bindir}/cobbler-register
133
%{_bindir}/koan
134
%doc README AUTHORS COPYING
135
136
# EOF
137
138
%changelog
139