forked from oVirt/Node
-
Notifications
You must be signed in to change notification settings - Fork 3
/
ovirt-node.spec.in
450 lines (377 loc) · 13.9 KB
/
ovirt-node.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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
%global product_family oVirt Node
%global product_release %{version} (0)
%global mgmt_scripts_dir %{_sysconfdir}/node.d
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%define is_f16 %(test "0%{?fedora}" == "016" && echo 1 || echo 0)
%define is_fedora_systemd %(test 0%{?fedora} -ne 0 && test %{?fedora} -ge 16 && echo 1 || echo 0)
%define is_rhel_systemd %(test 0%{?rhel} -ne 0 && test %{?rhel} -ge 7 && echo 1 || echo 0)
%define is_centos_systemd %(test 0%{?centos} -ne 0 && test %{?centos} -ge 7 && echo 1 || echo 0)
%define is_systemd %( test %{is_rhel_systemd} -eq 1 || test %{is_centos_systemd} = 1 || test %{is_fedora_systemd} = 1 && echo 1 || echo 0)
%define dracutdir %(test -e /usr/share/dracut && echo "/usr/share/dracut/modules.d" || echo "/usr/lib/dracut/modules.d")
Summary: The %{product_family} daemons/scripts
Name: ovirt-node
Version: @VERSION@
Release: 999%{?BUILD_NUMBER}%{?extra_release}%{?dist}
Source0: %{name}-%{version}.tar.gz
License: GPLv2+
Group: Applications/System
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
URL: http://www.ovirt.org/
BuildRequires: python-setuptools python-devel dracut
BuildRequires: automake autoconf
%if %{is_systemd}
BuildRequires: systemd-units
%endif
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig
%if %{is_systemd}
Requires: systemd-units
Requires(post): systemd-units
Requires(preun): systemd-units
#Requires: python-augeas
Requires: glusterfs-client >= 2.0.1
Requires: python-IPy
Requires: grub2
Requires: system-release
%endif
Requires: libvirt >= 0.9.2
Requires: augeas >= 0.3.5
Requires: udev >= 147-2.34
Requires: wget
Requires: cyrus-sasl-gssapi cyrus-sasl >= 2.1.22
Requires: iscsi-initiator-utils
Requires: ntp
Requires: nfs-utils
Requires: bash
Requires: chkconfig
Requires: bind-utils
Requires: qemu-img
Requires: nc
Requires: /usr/sbin/crond
Requires: newt-python
Requires: libuser-python >= 0.56.9
Requires: dbus-python
Requires: python-gudev
Requires: PyPAM
Requires: ethtool
Requires: cracklib-python
Requires: dracut
Requires: /bin/hostname
%if ! %{is_systemd}
Requires: grub
# for applying patches in %post
Requires(post): patch
%endif
%if 0%{?rhel} && ! 0%{?centos}
Requires: system-release
%endif
BuildArch: noarch
%define app_root %{_datadir}/%{name}
%description
Provides a series of daemons and support utilities for hypervisor distribution.
%package recipe
Summary: Recipes for building and running %{product_family} image
Group: Applications/System
Requires: pykickstart >= 1.54
Requires: livecd-tools >= 1:16.0
Obsoletes: ovirt-node-tools <= 2.3.0-999
%define recipe_root %{_datadir}/ovirt-node-recipe
%description recipe
This package provides recipe (Kickstart files), client tools,
documentation for building and running an %{product_family} image.
This package is not to be installed on the %{product_family},
however on a development machine to help to build the image.
%package tools
Summary: Recipes for building and running %{product_family} image
Group: Applications/System
Requires: livecd-tools >= 1:16.0
Requires: appliance-tools-minimizer
%define tools_root %{_datadir}/ovirt-node-tools
%description tools
This package provides plugin tools for modifying and working with the
%{product_family} image.
This package is not to be installed on the %{product_family},
however on a development machine to work with the image.
%package plugin-snmp
Summary: SNMP plugin for %{product_family} image
Group: Applications/System
Requires: net-snmp
Requires: perl-libs
%define snmp_root %{_datadir}/%{name}
%description plugin-snmp
This package provides an snmp plugin tools for use with%{product_family} image.
%post plugin-snmp
systemctl enable snmpd.service
cat > /etc/snmp/snmpd.conf << \EOF_snmpd
master agentx
dontLogTCPWrappersConnects yes
rwuser root auth .1
EOF_snmpd
%package plugin-cim
Summary: CIM plugin for %{product_family} image
Group: Applications/System
Requires: libvirt-cim
Requires: sblim-sfcb
%description plugin-cim
This package provides a cim plugin for use with%{product_family} image.
%post plugin-cim
groupadd cim
useradd -g cim -G sfcb -s /sbin/nologin cim
%if ! %{is_systemd}
/sbin/chkconfig --add ovirt-cim
%else
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%endif
#CIM related changes
# set read-only
echo "readonly = true;" > /etc/libvirt-cim.conf
%prep
%setup -q
%build
aclocal && autoheader && automake --add-missing && autoconf
%configure --with-image-minimizer @ARCHIPEL_FLAGS@
make
%install
%{__rm} -rf %{buildroot}
make install DESTDIR=%{buildroot}
%if %{is_f16}
# install libvirtd systemd service
%{__install} -p -m0644 libvirtd.service %{buildroot}%{_unitdir}
%endif
%if ! %{is_systemd}
# install libvirtd upstart job
%{__install} -d -m0755 %{buildroot}%{_sysconfdir}/init
%{__install} -p -m0644 libvirtd.upstart %{buildroot}%{_sysconfdir}/init/libvirtd.conf
%endif
# dracut patches for rhel6
%if ! %{is_systemd}
%{__install} -p -m0644 dracut/dracut-3d88d27810acc7782618d67a03ff5c0e41494ca4.patch %{buildroot}%{app_root}
%{__install} -p -m0644 dracut/dracut-93724aa28fc20c8b7f0167201d1759b7118ba890.patch %{buildroot}%{app_root}
%endif
# python-augeas is not in RHEL-6
# specific version of python-augeas is not available in Fedora yet
%{__install} -p -m0644 scripts/augeas.py %{buildroot}%{python_sitelib}
# Build and install the new TUI
pushd .
cd scripts/tui/
make -f makefile.legacy install python=%{__python} prefix=%{_prefix} root=%{buildroot}
# Remove some extra data
rm -rf %{buildroot}/usr/extra
popd .
%clean
%{__rm} -rf %{buildroot}
%post
/sbin/chkconfig --level 35 netconsole on
%if ! %{is_systemd}
/sbin/chkconfig --add ovirt-awake
/sbin/chkconfig --add ovirt-early
/sbin/chkconfig --add ovirt-firstboot
/sbin/chkconfig --add ovirt
/sbin/chkconfig --add ovirt-post
%else
if [ $1 -eq 1 ] ; then
# Initial installation
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
fi
%endif
# workaround for imgcreate/live.py __copy_efi_files
if [ ! -e /boot/grub/splash.xpm.gz ]; then
cp %{app_root}/grub-splash.xpm.gz /boot/grub/splash.xpm.gz
fi
%if ! %{is_systemd}
# apply dracut fixes not in rhel6
# rhbz#683330
# dracut.git commits rediffed for dracut-004-53.el6
patch -d /usr/share/dracut/ -p0 < %{app_root}/dracut-3d88d27810acc7782618d67a03ff5c0e41494ca4.patch
patch -d /usr/share/dracut/ -p0 < %{app_root}/dracut-93724aa28fc20c8b7f0167201d1759b7118ba890.patch
%endif
#use all hard-coded defaults for multipath
# except for getuid_callout where we need replace-whitespace
cat > /etc/multipath.conf << \EOF_multipath_conf
defaults {
getuid_callout "/lib/udev/scsi_id --replace-whitespace --whitelisted --device=/dev/%n"
}
EOF_multipath_conf
#release info for dracut to pick it up into initramfs
# remove symlink to keep original redhat-release
rm -f /etc/system-release
echo "%{product_family} release %{product_release}" > /etc/system-release
%preun
/sbin/chkconfig --level 35 netconsole off
%if ! %{is_systemd}
if [ $1 = 0 ] ; then
/sbin/service ovirt-early stop >/dev/null 2>&1
/sbin/service ovirt-firstboot stop >/dev/null 2>&1
/sbin/service ovirt stop >/dev/null 2>&1
/sbin/service ovirt-post stop >/dev/null 2>&1
/sbin/chkconfig --del ovirt-awake
/sbin/chkconfig --del ovirt-early
/sbin/chkconfig --del ovirt-firstboot
/sbin/chkconfig --del ovirt
/sbin/chkconfig --del ovirt-post
fi
%else
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable ovirt-firstboot.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable ovirt.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable ovirt-post.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable ovirt-early.service > /dev/null 2>&1 || :
/bin/systemctl stop ovirt.service > /dev/null
/bin/systemctl stop ovirt-post.service > /dev/null
/bin/systemctl stop ovirt-early.service > /dev/null
fi
%endif
%preun plugin-cim
%if ! %{is_systemd}
if [ $1 = 0 ] ; then
/sbin/service ovirt-cim stop >/dev/null 2>&1
/sbin/chkconfig --del ovirt-cim
fi
%else
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable ovirt-cim.service > /dev/null 2>&1 || :
/bin/systemctl stop ovirt-cim.service > /dev/null
fi
%endif
%files recipe
%defattr(0644,root,root,0755)
%doc README COPYING
%{recipe_root}/*.ks
%defattr(0755,root,root,0755)
%{_mandir}/man8/node-creator.8.gz
%{_sbindir}/node-creator
%files tools
%{_sbindir}/edit-node
%{_mandir}/man8/edit-node.8.gz
%files plugin-snmp
%{python_sitelib}/ovirt_config_setup/snmp.py
%{_sysconfdir}/ovirt-plugins.d/snmp.minimize
%{_sysconfdir}/ovirt-config-boot.d/snmp_autoinstall.py
%files plugin-cim
%{python_sitelib}/ovirt_config_setup/cim.py
%{_sysconfdir}/ovirt-plugins.d/cim.minimize
%if %{is_systemd}
%{_unitdir}/ovirt-cim.service
%else
%{_initrddir}/ovirt-cim
%endif
%files
%defattr(-,root,root)
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/default/ovirt
%config(noreplace) %{_sysconfdir}/logrotate.d/ovirt-node
%config(noreplace) %{_sysconfdir}/cron.d/ovirt-logrotate
%{mgmt_scripts_dir}
%{_sysconfdir}/ovirt-config-boot.d
%exclude %{_sysconfdir}/ovirt-config-boot.d/snmp_autoinstall.py*
%config(noreplace) %{_sysconfdir}/sysconfig/node-config
%if %{is_f16}
%{_unitdir}/libvirtd.service
%endif
%if ! %{is_systemd}
%{_sysconfdir}/init/libvirtd.conf
%endif
%{_sysconfdir}/sysconfig/modules/vlan.modules
%{_sysconfdir}/modprobe.d/ovirt-qla4xxx.conf
%doc COPYING
# should be ifarch i386
%{app_root}/grub-splash.xpm.gz
# end i386 bits
%{app_root}/syslinux-vesa-splash.jpg
%if ! %{is_systemd}
%{app_root}/dracut-3d88d27810acc7782618d67a03ff5c0e41494ca4.patch
%{app_root}/dracut-93724aa28fc20c8b7f0167201d1759b7118ba890.patch
%endif
%{dracutdir}/91ovirtnode/module-setup.sh
%{dracutdir}/91ovirtnode/ovirt-boot-functions
%{dracutdir}/91ovirtnode/ovirt-cleanup.sh
%{_sysconfdir}/dracut.conf.d/ovirt-dracut.conf
%{_libexecdir}/ovirt-auto-install
%{_libexecdir}/ovirt-config-password
%{_libexecdir}/ovirt-config-uninstall
%{_libexecdir}/ovirt-functions
%{_libexecdir}/ovirt-rpmquery
%{_libexecdir}/ovirt-config-installer
%{_libexecdir}/ovirt-config-setup
%{_libexecdir}/ovirt-admin-shell
%{_libexecdir}/ovirt-init-functions.sh
%{_sbindir}/persist
%{_sbindir}/unpersist
%{python_sitelib}/ovirt_config_setup
%exclude %{python_sitelib}/ovirt_config_setup/cim.py*
%exclude %{python_sitelib}/ovirt_config_setup/snmp.py*
%{python_sitelib}/ovirtnode
%{python_sitelib}/augeas*
%{_sysconfdir}/ovirt-early.d
%{_sysconfdir}/ovirt-commandline.d
%if %{is_systemd}
%{_unitdir}/ovirt.service
%{_unitdir}/ovirt-awake.service
%{_unitdir}/ovirt-firstboot.service
%{_unitdir}/ovirt-post.service
%{_unitdir}/ovirt-early.service
%else
%{_initrddir}/ovirt-awake
%{_initrddir}/ovirt-early
%{_initrddir}/ovirt-firstboot
%{_initrddir}/ovirt
%{_initrddir}/ovirt-post
%endif
# Files related to the new TUI
%{python_sitelib}/ovirt_node_molch*.egg-info
%{python_sitelib}/ovirt/__init__.*
%{python_sitelib}/ovirt/node/*
%{_bindir}/ovirt-config-setup
%{_bindir}/ovirt-node-installer
%{_bindir}/ovirt-node-doc
%changelog
* Mon Jun 20 2011 Alan Pevec <[email protected]> 2.0.0-1
- split kickstarts per distro, currently ovirt15 and rhevh6
- new installation and configuration text UI for standalone mode
- drop gptsync, make it noarch
* Tue Apr 04 2010 Darryl L. Pierce <[email protected]> - 1.9.2-1
- Updated autoconf environment.
- Allow persistence of empty configuration files.
* Wed Mar 24 2010 Darryl L. Pierce <[email protected]> - 1.9.1-1
- Update ovirt-process-config to fail configs that are missing the field name or value.
- Updated build system will use Fedora 13 as the rawhide repo.
- Fixed ovirt-config-networking to not report success when network start fails.
- Reboot hangs on /etc [FIXED].
- Multipath translation performance improvements.
- Cleanup ROOTDRIVE when partitioning.
- Fix hang when cleaning dirty storage.
- The order of the oVirt SysVInit scripts has been changed.
- ovirt-early -> ovirt-awake -> ovirt -> ovirt-post
- Fixes to the SysVINit scripts to name lifecycle methods propery.
- Added psmisc package.
- Added default KEYTAB_FILE name to /etc/sysconfig/node-config.
- Fixes to the persist and unpersist commands to handle already persisted files and directories.
- Duplicate NTP/DNS entries are rejected during network setup.
* Wed Oct 07 2009 David Huff <[email protected]> - 1.0.3-4
- Added ovirt-node-tools subpackage
* Thu Jun 23 2009 David Huff <[email protected]> - 1.0.3
- Clean up spec for inclusion in Fedora
- Removed subpackages, stateful, stateless, logos, and selinux
* Thu Dec 11 2008 Perry Myers <[email protected]> - 0.96
- Subpackage stateful/stateless to separate out functionality for
embedded Node and Node running as part of already installed OS
- ovirt-config-* setup scripts for standalone mode
* Thu Sep 11 2008 Chris Lalancette <[email protected]> - 0.92 0.7
- Add the ovirt-install- and ovirt-uninstall-node scripts, and refactor
post to accomodate
* Mon Sep 8 2008 Jim Meyering <[email protected]> - 0.92 0.6
- Update ovirt-identify-node's build rule.
* Fri Aug 22 2008 Chris Lalancette <[email protected]> - 0.92 0.5
- Add the ovirt-listen-awake daemon to the RPM
* Fri Aug 22 2008 Chris Lalancette <[email protected]> - 0.92 0.4
- Re-arrange the directory layout, in preparation for ovirt-listen-awake
* Tue Jul 29 2008 Perry Myers <[email protected]> - 0.92 0.2
- Added /etc/ovirt-release and merged ovirt-setup into spec file
* Wed Jul 02 2008 Darryl Pierce <[email protected]> - 0.92 0.2
- Added log rotation to limit file system writes.
* Mon Jun 30 2008 Perry Myers <[email protected]> - 0.92 0.1
- Add in sections of kickstart post, general cleanup