forked from lago-project/lago
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lago.spec.in
161 lines (137 loc) · 4.27 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
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/
%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-lockfile
BuildRequires: python-yaml
BuildRequires: pyxdg
BuildRequires: python-xmltodict
BuildRequires: python-lxml
BuildRequires: libvirt-python
BuildRequires: python-enum34
BuildRequires: python-scp
BuildRequires: python2-rpm-macros
BuildRequires: python-wrapt
BuildRequires: python2-future
%if 0%{?fedora} >= 24
BuildRequires: python2-configparser
BuildRequires: python2-paramiko >= 2.1.1
BuildRequires: python2-jinja2
%else
BuildRequires: python-jinja2
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: git
BuildRequires: python-netaddr
Requires: python
Requires: libguestfs-tools >= 1.30
Requires: libguestfs-devel >= 1.30
Requires: libvirt >= 1.2.8
Requires: libvirt-python
Requires: python-libguestfs >= 1.30
Requires: python-lxml
Requires: python-lockfile
Requires: python-pbr
Requires: python-xmltodict
Requires: python-scp
Requires: python-setuptools
Requires: python-stevedore
Requires: python-yaml
Requires: python-enum34
Requires: pyxdg
Requires: python-wrapt
Requires: python-netaddr
Requires: python2-future
%if 0%{?fedora} >= 24
Requires: python2-jinja2
Requires: python2-configparser
Requires: python2-paramiko >= 2.1.1
%else
Requires: python-jinja2
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}/templates/*.j2
%{python2_sitelib}/%{name}/providers/*.py*
%{python2_sitelib}/%{name}/providers/libvirt/*.py*
%{python2_sitelib}/%{name}/providers/libvirt/templates/*.xml
%{python2_sitelib}/%{name}/providers/libvirt/templates/*.j2
%{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 -f lago
fi
%postun -n python-%{name}
if [[ "$1" -eq 0 ]]; then
groupdel lago
fi
%changelog