forked from lago-project/lago
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lago.spec.in
213 lines (180 loc) · 5.83 KB
/
lago.spec.in
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
Version: @@VERSION@@
Release: 1%{?dist}
Name: lago
Summary: System testing framework
BuildArch: noarch
Group: System Environment/Libraries
License: GPLv2+
URL: https://github.com/lago-project/lago
Source0: https://resources.ovirt.org/repos/%{name}/0.0/src/%{name}/%{name}-%{version}.tar.gz
###################### lago package
Requires: python-%{name} = %{version}
%description
LAGO System testing framework.
Deploy and tear down environments of several virtual machines
%prep
%setup -q -n %{name}-%{version}
%build
LAGO_VERSION=%{version} %{py2_build}
%install
LAGO_VERSION=%{version} %{py2_install}
install -d -m 755 %{buildroot}/%{_sysconfdir}/lago
PYTHONPATH="$PYTHONPATH:%{buildroot}/%{python_sitelib}"\
%{buildroot}/usr/bin/lago --ignore-warnings generate-config > "%{buildroot}/%{_sysconfdir}/lago/lago.conf"
sed -i 's/^\([^#]\)\(.*\)/#\0/' "%{buildroot}/%{_sysconfdir}/lago/lago.conf"
chmod 0644 "%{buildroot}/%{_sysconfdir}/lago/lago.conf"
install -d %{buildroot}/var/lib/lago/subnets
install -d %{buildroot}/var/lib/lago/store
install -d %{buildroot}/var/lib/lago/repos
install -d -m 755 %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d
install -d -m 755 %{buildroot}%{_sysconfdir}/sudoers.d
install -p -D -m 644 etc/polkit/*.pkla %{buildroot}%{_sysconfdir}/polkit-1/localauthority/50-local.d/
install -p -D -m 644 etc/sudo/* %{buildroot}%{_sysconfdir}/sudoers.d/
# this is for python-lago-ovirt
install -d %{buildroot}/var/lib/lago/reposync
install -d -m 755 %{buildroot}%{_sysconfdir}/firewalld/services
install -p -D -m 644 etc/firewalld/services/* %{buildroot}%{_sysconfdir}/firewalld/services/
%files
###################### python-lago package
%package -n python-%{name}
Summary: Library to perform lago operations
BuildArch: noarch
BuildRequires: python2-devel
BuildRequires: python-stevedore
BuildRequires: python-setuptools
BuildRequires: python-magic
BuildRequires: python-lockfile
BuildRequires: python-yaml
BuildRequires: pyxdg
BuildRequires: python-xmltodict
BuildRequires: python-lxml
BuildRequires: libvirt-python
BuildRequires: python-enum
BuildRequires: python-scp
BuildRequires: python2-rpm-macros
%if 0%{?fedora} >= 24
BuildRequires: python2-configparser
BuildRequires: python2-paramiko >= 2.1.1
%else
BuildRequires: python-configparser
BuildRequires: python2-paramiko
%endif
%if 0%{?fedora} >= 23
BuildRequires: python2-dulwich
BuildRequires: python2-pbr
%else
BuildRequires: python-pbr
BuildRequires: python-dulwich
%endif
BuildRequires: python-flake8
BuildRequires: python-nose
BuildRequires: git
Requires: python
Requires: libguestfs-tools
Requires: libvirt >= 1.2.8
Requires: libvirt-python
Requires: python-libguestfs
Requires: python-lxml
Requires: python-lockfile
Requires: python-magic
Requires: python-pbr
Requires: python-xmltodict
Requires: python-scp
Requires: python-setuptools
Requires: python-stevedore
Requires: python-yaml
Requires: python-enum
Requires: pyxdg
%if 0%{?fedora} >= 24
Requires: python2-configparser
Requires: python2-paramiko >= 2.1.1
%else
Requires: python-configparser
Requires: python2-paramiko
%endif
%if 0%{?rhel}
Requires: qemu-img-rhev >= 2.1.2
Requires: qemu-kvm-rhev >= 2.1.2
%else
Requires: qemu-img >= 2.1.2
Requires: qemu-kvm >= 2.1.2
%endif
Requires: git
Requires: sudo
%{?python_provide:%python_provide python2-lago}
%description -n python-%{name}
%files -n python-%{name}
%doc AUTHORS COPYING README.rst
%{python2_sitelib}/%{name}/*.py*
%{python2_sitelib}/%{name}/plugins/*.py*
%{python2_sitelib}/%{name}_template_repo/*.py*
%{python2_sitelib}/%{name}/*.xml
%{python2_sitelib}/%{name}-%{version}-py*.egg-info
%{_bindir}/lagocli
%{_bindir}/lago
%config(noreplace) %{_sysconfdir}/lago/lago.conf
%config(noreplace) %{_sysconfdir}/polkit-1/localauthority/50-local.d/*
%config(noreplace) %{_sysconfdir}/sudoers.d/*
%dir %attr(2775, root, lago) /var/lib/lago/
%dir %attr(2775, root, lago) /var/lib/lago/subnets/
%dir %attr(2775, root, lago) /var/lib/lago/store/
%dir %attr(2775, root, lago) /var/lib/lago/repos/
%pre -n python-%{name}
if [[ "$1" -eq 1 ]]; then
groupadd lago
fi
%postun -n python-%{name}
if [[ "$1" -eq 0 ]]; then
groupdel lago
fi
###################### lago-ovirt package
%package -n %{name}-ovirt
Summary: oVirt extension for lagocli
BuildArch: noarch
BuildRequires: python2-devel
Requires: %{name} = %{version}
Requires: python-%{name}-ovirt = %{version}
%files -n %{name}-ovirt
%description -n %{name}-ovirt
###################### python-lago-ovirt package
%package -n python-%{name}-ovirt
Summary: Library for ovirt specific facitilies
BuildArch: noarch
BuildRequires: python2-devel
Requires: python
Requires: python-%{name} = %{version}
Requires: python-magic
Requires: python-nose
Requires: ovirt-engine-sdk-python
Requires: createrepo
Requires: repoman >= 2.0.12
Requires: yum-utils
Requires: rpm-build
Requires: xz
%{?python_provide:%python_provide python2-lago-ovirt}
%description -n python-%{name}-ovirt
%files -n python-%{name}-ovirt
%{python2_sitelib}/ovirt%{name}/*.py*
%config(noreplace) %{_sysconfdir}/firewalld/services/*
%dir %attr(2775, root, lago) /var/lib/lago/reposync/
%post -n python-%{name}-ovirt
if which firewall-cmd &>/dev/null; then
# don't touch if ovirtlago service is already enabled
if ! firewall-cmd --query-service=ovirtlago --zone=public &>/dev/null; then
firewall-cmd --reload &> /dev/null
firewall-cmd --permanent --zone=public --add-service=ovirtlago &> /dev/null
firewall-cmd --reload &> /dev/null
fi
fi
%preun -n python-%{name}-ovirt
if [[ "$1" == "0" ]]; then
# "0" indicates uninstallation
# "1" indicates upgrade - and then we do nothing
if which firewall-cmd &>/dev/null; then
if firewall-cmd --query-service=ovirtlago --zone=public &>/dev/null; then
firewall-cmd --permanent --zone=public --remove-service=ovirtlago &> /dev/null
firewall-cmd --reload &> /dev/null
fi
fi
fi
%changelog