- added logrotate config and config-backup script
[packages/ganeti.git] / ganeti.spec
1 Summary:        Cluster-based virtualization management software
2 Name:           ganeti
3 Version:        2.9.3
4 Release:        0.9
5 License:        GPL v2
6 Group:          Applications/System
7 Source0:        http://downloads.ganeti.org/releases/2.9/%{name}-%{version}.tar.gz
8 # Source0-md5:  0542ca872bf2d57284359fcc8dc565ef
9 Source1:        %{name}.tmpfiles
10 Source2:        %{name}-confd.init
11 Source3:        %{name}-masterd.init
12 Source4:        %{name}-noded.init
13 Source5:        %{name}-rapi.init
14 Source6:        %{name}-luxid.init
15 Source7:        %{name}-mond.init
16 Source8:        %{name}.sysconfig
17 Patch0:         fix-no-kvm.patch
18 Patch1:         systemd.patch
19 Patch2:         daemon-util-use-service.patch
20 Patch3:         mtl.patch
21 Patch4:         use-vm-openvswitch-link.patch
22 URL:            https://code.google.com/p/ganeti/
23 BuildRequires:  autoconf
24 BuildRequires:  automake
25 BuildRequires:  curl-devel
26 BuildRequires:  fakeroot
27 BuildRequires:  gawk
28 BuildRequires:  ghc
29 BuildRequires:  ghc-Crypto
30 BuildRequires:  ghc-QuickCheck
31 BuildRequires:  ghc-curl
32 BuildRequires:  ghc-haskell-platform
33 BuildRequires:  ghc-hinotify
34 BuildRequires:  ghc-hslogger >= 1.2.3
35 BuildRequires:  ghc-json
36 BuildRequires:  ghc-regex-pcre
37 BuildRequires:  ghc-snap-server
38 BuildRequires:  ghc-temporary
39 BuildRequires:  ghc-utf8-string
40 BuildRequires:  gmp-devel
41 BuildRequires:  hlint
42 BuildRequires:  hscolour
43 BuildRequires:  pandoc
44 BuildRequires:  python
45 BuildRequires:  python-affinity
46 BuildRequires:  python-bitarray
47 BuildRequires:  python-coverage
48 BuildRequires:  python-devel
49 BuildRequires:  python-distribute
50 BuildRequires:  python-ipaddr
51 BuildRequires:  python-mock >= 1.0.1
52 BuildRequires:  python-modules
53 BuildRequires:  python-paramiko
54 BuildRequires:  python-pep8
55 BuildRequires:  python-pyOpenSSL
56 BuildRequires:  python-pycurl
57 BuildRequires:  python-pyinotify
58 BuildRequires:  python-pyparsing
59 BuildRequires:  python-simplejson
60 BuildRequires:  rpm-pythonprov
61 BuildRequires:  rpmbuild(macros) >= 1.647
62 Requires(post,preun):   /sbin/chkconfig
63 Requires(post,preun,postun):    systemd-units >= 38
64 Requires:       bridge-utils
65 Requires:       drbdsetup >= 8.0.12
66 Requires:       iproute2
67 Requires:       iputils-arping
68 Requires:       lvm2
69 Requires:       openssh-clients
70 Requires:       openssh-server
71 Requires:       python
72 Requires:       python-affinity
73 Requires:       python-bitarray
74 Requires:       python-devel
75 Requires:       python-distribute
76 Requires:       python-ipaddr
77 Requires:       python-modules
78 Requires:       python-paramiko
79 Requires:       python-pycurl
80 Requires:       python-pyinotify
81 Requires:       python-pyOpenSSL
82 Requires:       python-pyparsing
83 Requires:       python-simplejson
84 Requires:       rc-scripts
85 Requires:       socat
86 Requires:       sudo
87 Requires:       systemd-units >= 0.38
88 #Suggests:      ganeti-instance-debootstrap
89 Suggests:       qemu
90 Suggests:       xen
91 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
92
93 %description
94 Ganeti is a cluster virtual server management software tool built on
95 top of existing virtualization technologies such as Xen or KVM and
96 other Open Source software.
97
98 %package htools
99 Summary:        Cluster allocation tools for Ganeti
100 Group:          Applications/System
101 Requires:       %{name} = %{version}-%{release}
102
103 %description htools
104 These are additional tools used for enhanced allocation and capacity
105 calculation on Ganeti clusters.
106
107 The tools provided are:
108  - hail, an iallocator script for ganeti
109  - hbal, used to redistribute instances on the cluster
110  - hspace, used for capacity calculation
111  - hscan, used to gather cluster files for offline use in hbal/hspace
112
113 %package -n bash-completion-ganeti
114 Summary:        bash-completion for ganeti
115 Group:          Applications/Shells
116 Requires:       %{name} = %{version}
117
118 %description -n bash-completion-ganeti
119 bash-completion for ganeti.
120
121 %prep
122 %setup -q
123 %patch0 -p1
124 %patch1 -p1
125 %patch2 -p1
126 %patch3 -p1
127 %patch4 -p1
128
129 %build
130 %{__aclocal} -I autotools
131 %{__autoconf}
132 %{__automake}
133 # DON'T use full path to xl binary, just 'xl' (see lib/hypervisor/hv_xen.py for a reason)
134 %configure \
135         IP_PATH=/sbin/ip \
136         DOT=/usr/bin/dot \
137         PYCOVERAGE=/usr/bin/coverage-%{py_ver} \
138         PYLINT=/usr/bin/pylint \
139         SOCAT=/usr/bin/socat \
140         QEMUIMG_PATH=/usr/bin/qemu-img \
141         --enable-syslog \
142         --enable-confd \
143         --enable-monitoring \
144         --enable-socat-escape \
145         --with-ssh-initscript=/etc/rc.d/init.d/sshd \
146         --with-ssh-config-dir=/etc/ssh \
147         --with-kvm-path=/usr/bin/qemu-kvm \
148         --enable-restricted-commands \
149         --with-user-prefix="gnt-" \
150         --with-group-prefix="gnt-" \
151         --with-export-dir=/var/lib/ganeti/export \
152         --with-iallocator-search-path=%{_libdir}/ganeti/iallocators \
153         --with-os-search-path=/srv/ganeti/os,%{_libdir}/ganeti/os,%{_datadir}/ganeti/os \
154         --with-extstorage-search-path=/srv/ganeti/extstorage,%{_libdir}/ganeti/extstorage,%{_datadir}/ganeti/extstorage
155
156 %{__make}
157
158 %install
159 rm -rf $RPM_BUILD_ROOT
160 install -d $RPM_BUILD_ROOT{%{systemdunitdir},%{systemdtmpfilesdir}} \
161         $RPM_BUILD_ROOT/etc/{ganeti,cron.d,bash_completion.d,sysconfig,rc.d/init.d,sudoers.d,logrotate.d}
162
163 %{__make} install \
164         DESTDIR=$RPM_BUILD_ROOT
165
166 install -d $RPM_BUILD_ROOT{%{_libdir},%{_datadir}}/ganeti/{os,extstorage}
167
168 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{systemdtmpfilesdir}/ganeti.conf
169 install -p %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-confd
170 install -p %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-masterd
171 install -p %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-noded
172 install -p %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-rapi
173 install -p %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-luxid
174 install -p %{SOURCE7} $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-mond
175
176 %{__sed} -i -e 's|@LIBDIR@|%{_libdir}|g' $RPM_BUILD_ROOT/etc/rc.d/init.d/ganeti-*
177
178 cp -p %{SOURCE8} $RPM_BUILD_ROOT/etc/sysconfig/ganeti
179
180 cp -p doc/examples/bash_completion $RPM_BUILD_ROOT/etc/bash_completion.d/ganeti
181 cp -p doc/examples/ganeti.cron $RPM_BUILD_ROOT/etc/cron.d/ganeti
182 cp -p doc/examples/ganeti.target $RPM_BUILD_ROOT%{systemdunitdir}
183 cp -p doc/examples/ganeti-{noded,masterd,rapi,confd,luxid,mond}.service $RPM_BUILD_ROOT%{systemdunitdir}
184 cp -p doc/examples/ganeti.sudoers $RPM_BUILD_ROOT/etc/sudoers.d/ganeti
185 cp -p doc/examples/ganeti.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/ganeti
186 cp -p doc/examples/gnt-config-backup $RPM_BUILD_ROOT%{_sbindir}
187
188 %py_postclean
189
190 %clean
191 rm -rf $RPM_BUILD_ROOT
192
193 %pre
194 %groupadd -g 300 gnt-masterd
195 %groupadd -g 301 gnt-confd
196 %groupadd -g 302 gnt-luxid
197 %groupadd -g 303 gnt-rapi
198 %groupadd -g 304 gnt-daemons
199 %groupadd -g 305 gnt-admin
200 %useradd -u 300 -d /var/lib/ganeti -g gnt-masterd -G gnt-daemons,gnt-confd,gnt-admin -c "Ganeti Masterd User" gnt-masterd
201 %useradd -u 301 -d /var/lib/ganeti -g gnt-confd -G gnt-daemons -c "Ganeti Confd User" gnt-confd
202 %useradd -u 302 -d /var/lib/ganeti -g gnt-luxid -G gnt-daemons,gnt-confd,gnt-masterd -c "Ganeti Luxid User" gnt-luxid
203 %useradd -u 303 -d /var/lib/ganeti -g gnt-rapi -G gnt-daemons,gnt-admin -c "Ganeti RAPI User" gnt-rapi
204
205 %post
206 /sbin/chkconfig --add ganeti-noded
207 %service ganeti-noded restart
208 /sbin/chkconfig --add ganeti-masterd
209 %service ganeti-masterd restart
210 /sbin/chkconfig --add ganeti-rapi
211 %service ganeti-rapi restart
212 /sbin/chkconfig --add ganeti-confd
213 %service ganeti-confd restart
214 /sbin/chkconfig --add ganeti-luxid
215 %service ganeti-luxid restart
216 /sbin/chkconfig --add ganeti-mond
217 %service ganeti-mond restart
218 %systemd_post ganeti.target ganeti-noded.service ganeti-masterd.service ganeti-rapi.service ganeti-confd.service ganeti-luxid.service ganeti-mond.service
219
220 %preun
221 if [ "$1" = "0" ]; then
222         %service -q ganeti-confd stop
223         /sbin/chkconfig --del ganeti-confd
224         %service -q ganeti-rapi stop
225         /sbin/chkconfig --del ganeti-rapi
226         %service -q ganeti-masterd stop
227         /sbin/chkconfig --del ganeti-masterd
228         %service -q ganeti-noded stop
229         /sbin/chkconfig --del ganeti-noded
230         %service -q ganeti-luxid stop
231         /sbin/chkconfig --del ganeti-luxid
232         %service -q ganeti-mond stop
233         /sbin/chkconfig --del ganeti-mond
234 fi
235 %systemd_preun ganeti.target ganeti-noded.service ganeti-masterd.service ganeti-rapi.service ganeti-confd.service ganeti-luxid.service ganeti-mond.service
236
237 %postun
238 if [ "$1" = "0" ]; then
239         %userremove gnt-rapi
240         %userremove gnt-luxid
241         %userremove gnt-confd
242         %userremove gnt-masterd
243         %groupremove gnt-admin
244         %groupremove gnt-masterd
245         %groupremove gnt-rapi
246         %groupremove gnt-luxid
247         %groupremove gnt-confd
248         %groupremove gnt-daemons
249 fi
250 %systemd_reload
251
252 %files
253 %defattr(644,root,root,755)
254 %doc NEWS README UPGRADE
255 %attr(754,root,root) /etc/rc.d/init.d/ganeti-confd
256 %attr(754,root,root) /etc/rc.d/init.d/ganeti-luxid
257 %attr(754,root,root) /etc/rc.d/init.d/ganeti-masterd
258 %attr(754,root,root) /etc/rc.d/init.d/ganeti-mond
259 %attr(754,root,root) /etc/rc.d/init.d/ganeti-noded
260 %attr(754,root,root) /etc/rc.d/init.d/ganeti-rapi
261 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/ganeti
262 %config(noreplace) %verify(not md5 mtime size) /etc/sudoers.d/ganeti
263 %dir %{_sysconfdir}/ganeti
264 %{systemdunitdir}/ganeti.target
265 %{systemdunitdir}/ganeti-confd.service
266 %{systemdunitdir}/ganeti-luxid.service
267 %{systemdunitdir}/ganeti-masterd.service
268 %{systemdunitdir}/ganeti-mond.service
269 %{systemdunitdir}/ganeti-noded.service
270 %{systemdunitdir}/ganeti-rapi.service
271 %{systemdtmpfilesdir}/ganeti.conf
272 /etc/cron.d/ganeti
273 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/ganeti
274 %dir %{_datadir}/ganeti
275 %dir %{_datadir}/ganeti/extstorage
276 %dir %{_datadir}/ganeti/os
277 %dir %{_libdir}/ganeti
278 %attr(755,root,root) %{_libdir}/ganeti/check-cert-expired
279 %attr(755,root,root) %{_libdir}/ganeti/daemon-util
280 %attr(755,root,root) %{_libdir}/ganeti/ensure-dirs
281 %attr(755,root,root) %{_libdir}/ganeti/import-export
282 %attr(755,root,root) %{_libdir}/ganeti/kvm-ifup
283 %attr(755,root,root) %{_libdir}/ganeti/mon-collector
284 %attr(755,root,root) %{_libdir}/ganeti/net-common
285 %attr(755,root,root) %{_libdir}/ganeti/node-daemon-setup
286 %attr(755,root,root) %{_libdir}/ganeti/prepare-node-join
287 %attr(755,root,root) %{_libdir}/ganeti/vif-ganeti
288 %dir %{_libdir}/ganeti/extstorage
289 %dir %{_libdir}/ganeti/iallocators
290 %dir %{_libdir}/ganeti/os
291 %dir %{_libdir}/ganeti/tools
292 %attr(755,root,root) %{_libdir}/ganeti/tools/burnin
293 %attr(755,root,root) %{_libdir}/ganeti/tools/cfgshell
294 %attr(755,root,root) %{_libdir}/ganeti/tools/cfgupgrade
295 %attr(755,root,root) %{_libdir}/ganeti/tools/cfgupgrade12
296 %attr(755,root,root) %{_libdir}/ganeti/tools/cluster-merge
297 %attr(755,root,root) %{_libdir}/ganeti/tools/confd-client
298 %attr(755,root,root) %{_libdir}/ganeti/tools/fmtjson
299 %attr(755,root,root) %{_libdir}/ganeti/tools/kvm-console-wrapper
300 %attr(755,root,root) %{_libdir}/ganeti/tools/lvmstrap
301 %attr(755,root,root) %{_libdir}/ganeti/tools/master-ip-setup
302 %attr(755,root,root) %{_libdir}/ganeti/tools/move-instance
303 %attr(755,root,root) %{_libdir}/ganeti/tools/node-cleanup
304 %attr(755,root,root) %{_libdir}/ganeti/tools/ovfconverter
305 %attr(755,root,root) %{_libdir}/ganeti/tools/sanitize-config
306 %attr(755,root,root) %{_libdir}/ganeti/tools/users-setup
307 %attr(755,root,root) %{_libdir}/ganeti/tools/vcluster-setup
308 %attr(755,root,root) %{_libdir}/ganeti/tools/xen-console-wrapper
309 %attr(755,root,root) %{_sbindir}/ganeti-cleaner
310 %attr(755,root,root) %{_sbindir}/ganeti-confd
311 %attr(755,root,root) %{_sbindir}/ganeti-listrunner
312 %attr(755,root,root) %{_sbindir}/ganeti-luxid
313 %attr(755,root,root) %{_sbindir}/ganeti-masterd
314 %attr(755,root,root) %{_sbindir}/ganeti-mond
315 %attr(755,root,root) %{_sbindir}/ganeti-noded
316 %attr(755,root,root) %{_sbindir}/ganeti-rapi
317 %attr(755,root,root) %{_sbindir}/ganeti-watcher
318 %attr(755,root,root) %{_sbindir}/gnt-backup
319 %attr(755,root,root) %{_sbindir}/gnt-cluster
320 %attr(755,root,root) %{_sbindir}/gnt-config-backup
321 %attr(755,root,root) %{_sbindir}/gnt-debug
322 %attr(755,root,root) %{_sbindir}/gnt-group
323 %attr(755,root,root) %{_sbindir}/gnt-instance
324 %attr(755,root,root) %{_sbindir}/gnt-job
325 %attr(755,root,root) %{_sbindir}/gnt-network
326 %attr(755,root,root) %{_sbindir}/gnt-node
327 %attr(755,root,root) %{_sbindir}/gnt-os
328 %attr(755,root,root) %{_sbindir}/gnt-storage
329 %{_mandir}/man7/ganeti.7*
330 %{_mandir}/man7/ganeti-extstorage-interface.7*
331 %{_mandir}/man7/ganeti-os-interface.7*
332 %{_mandir}/man7/mon-collector.7*
333 %{_mandir}/man8/ganeti-cleaner.8*
334 %{_mandir}/man8/ganeti-confd.8*
335 %{_mandir}/man8/ganeti-listrunner.8*
336 %{_mandir}/man8/ganeti-luxid.8*
337 %{_mandir}/man8/ganeti-masterd.8*
338 %{_mandir}/man8/ganeti-mond.8*
339 %{_mandir}/man8/ganeti-noded.8*
340 %{_mandir}/man8/ganeti-rapi.8*
341 %{_mandir}/man8/ganeti-watcher.8*
342 %{_mandir}/man8/gnt-backup.8*
343 %{_mandir}/man8/gnt-cluster.8*
344 %{_mandir}/man8/gnt-debug.8*
345 %{_mandir}/man8/gnt-group.8*
346 %{_mandir}/man8/gnt-instance.8*
347 %{_mandir}/man8/gnt-job.8*
348 %{_mandir}/man8/gnt-network.8*
349 %{_mandir}/man8/gnt-node.8*
350 %{_mandir}/man8/gnt-os.8*
351 %{_mandir}/man8/gnt-storage.8*
352 %dir %{py_sitescriptdir}/ganeti
353 %{py_sitescriptdir}/ganeti/*.py*
354 %dir %{py_sitescriptdir}/ganeti/client
355 %{py_sitescriptdir}/ganeti/client/*.py*
356 %dir %{py_sitescriptdir}/ganeti/cmdlib
357 %{py_sitescriptdir}/ganeti/cmdlib/*.py*
358 %dir %{py_sitescriptdir}/ganeti/confd
359 %{py_sitescriptdir}/ganeti/confd/*.py*
360 %dir %{py_sitescriptdir}/ganeti/http
361 %{py_sitescriptdir}/ganeti/http/*.py*
362 %dir %{py_sitescriptdir}/ganeti/hypervisor
363 %{py_sitescriptdir}/ganeti/hypervisor/*.py*
364 %dir %{py_sitescriptdir}/ganeti/impexpd
365 %{py_sitescriptdir}/ganeti/impexpd/*.py*
366 %dir %{py_sitescriptdir}/ganeti/masterd
367 %{py_sitescriptdir}/ganeti/masterd/*.py*
368 %dir %{py_sitescriptdir}/ganeti/rapi
369 %{py_sitescriptdir}/ganeti/rapi/*.py*
370 %dir %{py_sitescriptdir}/ganeti/server
371 %{py_sitescriptdir}/ganeti/server/*.py*
372 %dir %{py_sitescriptdir}/ganeti/storage
373 %{py_sitescriptdir}/ganeti/storage/*.py*
374 %dir %{py_sitescriptdir}/ganeti/tools
375 %{py_sitescriptdir}/ganeti/tools/*.py*
376 %dir %{py_sitescriptdir}/ganeti/utils
377 %{py_sitescriptdir}/ganeti/utils/*.py*
378 %dir %{py_sitescriptdir}/ganeti/watcher
379 %{py_sitescriptdir}/ganeti/watcher/*.py*
380 %dir %attr(755,gnt-masterd,gnt-masterd) /var/lib/ganeti
381 %dir %attr(770,gnt-masterd,gnt-daemons) /var/log/ganeti
382 %dir %attr(775,gnt-masterd,gnt-daemons) /var/run/ganeti
383
384 %files htools
385 %defattr(644,root,root,755)
386 %attr(755,root,root) %{_bindir}/harep
387 %attr(755,root,root) %{_bindir}/hbal
388 %attr(755,root,root) %{_bindir}/hcheck
389 %attr(755,root,root) %{_bindir}/hinfo
390 %attr(755,root,root) %{_bindir}/hroller
391 %attr(755,root,root) %{_bindir}/hscan
392 %attr(755,root,root) %{_bindir}/hspace
393 %attr(755,root,root) %{_bindir}/htools
394 %attr(755,root,root) %{_libdir}/ganeti/iallocators/hail
395 %{_mandir}/man1/hail.1*
396 %{_mandir}/man1/harep.1*
397 %{_mandir}/man1/hbal.1*
398 %{_mandir}/man1/hcheck.1*
399 %{_mandir}/man1/hinfo.1*
400 %{_mandir}/man1/hroller.1*
401 %{_mandir}/man1/hscan.1*
402 %{_mandir}/man1/hspace.1*
403 %{_mandir}/man1/htools.1*
404
405 %files -n bash-completion-ganeti
406 %defattr(644,root,root,755)
407 /etc/bash_completion.d/ganeti
This page took 0.102736 seconds and 3 git commands to generate.