]> git.proxmox.com Git - mirror_corosync.git/blob - corosync.spec.in
Spec: Qdevice require same version of corosync
[mirror_corosync.git] / corosync.spec.in
1 @ALPHATAG@
2 @NUMCOMM@
3 @DIRTY@
4
5 # Conditionals
6 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
7 # to disable or enable specific features
8 %bcond_with testagents
9 %bcond_with watchdog
10 %bcond_with monitoring
11 %bcond_with snmp
12 %bcond_with dbus
13 %bcond_with rdma
14 %bcond_with systemd
15 %bcond_with upstart
16 %bcond_with xmlconf
17 %bcond_with runautogen
18 %bcond_with qdevices
19 %bcond_with qnetd
20
21 %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
22 %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
23
24 Name: corosync
25 Summary: The Corosync Cluster Engine and Application Programming Interfaces
26 Version: @version@
27 Release: 1%{?gitver}%{?dist}
28 License: BSD
29 Group: System Environment/Base
30 URL: http://corosync.github.io/corosync/
31 Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
32
33 # Runtime bits
34 Requires: corosynclib = %{version}-%{release}
35 Requires(pre): /usr/sbin/useradd
36 Requires(post): /sbin/chkconfig
37 Requires(preun): /sbin/chkconfig
38 Conflicts: openais <= 0.89, openais-devel <= 0.89
39
40 # Build bits
41
42 BuildRequires: groff
43 BuildRequires: libqb-devel
44 BuildRequires: nss-devel
45 BuildRequires: zlib-devel
46 %if %{with runautogen}
47 BuildRequires: autoconf automake libtool
48 %endif
49 %if %{with monitoring}
50 BuildRequires: libstatgrab-devel
51 %endif
52 %if %{with rdma}
53 BuildRequires: libibverbs-devel librdmacm-devel
54 %endif
55 %if %{with snmp}
56 BuildRequires: net-snmp-devel
57 %endif
58 %if %{with dbus}
59 BuildRequires: dbus-devel
60 %endif
61 %if %{with systemd}
62 BuildRequires: systemd-units
63 Requires(post): systemd
64 Requires(preun): systemd
65 Requires(postun): systemd
66 %endif
67 %if %{with xmlconf}
68 Requires: libxslt
69 %endif
70 %if %{with qdevices} || %{with qnetd}
71 Requires: nss-tools
72 %endif
73 %if %{with qnetd}
74 BuildRequires: sed
75 %endif
76
77 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
78
79 %prep
80 %setup -q -n %{name}-%{version}%{?gittarver}
81
82 %build
83 %if %{with runautogen}
84 ./autogen.sh
85 %endif
86
87 %if %{with rdma}
88 export ibverbs_CFLAGS=-I/usr/include/infiniband \
89 export ibverbs_LIBS=-libverbs \
90 export rdmacm_CFLAGS=-I/usr/include/rdma \
91 export rdmacm_LIBS=-lrdmacm \
92 %endif
93 %{configure} \
94 %if %{with testagents}
95 --enable-testagents \
96 %endif
97 %if %{with watchdog}
98 --enable-watchdog \
99 %endif
100 %if %{with monitoring}
101 --enable-monitoring \
102 %endif
103 %if %{with snmp}
104 --enable-snmp \
105 %endif
106 %if %{with dbus}
107 --enable-dbus \
108 %endif
109 %if %{with rdma}
110 --enable-rdma \
111 %endif
112 %if %{with systemd}
113 --enable-systemd \
114 %endif
115 %if %{with upstart}
116 --enable-upstart \
117 %endif
118 %if %{with xmlconf}
119 --enable-xmlconf \
120 %endif
121 %if %{with qdevices}
122 --enable-qdevices \
123 %endif
124 %if %{with qnetd}
125 --enable-qnetd \
126 %endif
127 --with-initddir=%{_initrddir} \
128 --with-systemddir=%{_unitdir} \
129 --with-upstartdir=%{_sysconfdir}/init \
130 --with-tmpfilesdir=%{_tmpfilesdir}
131
132 make %{_smp_mflags}
133
134 %install
135 rm -rf %{buildroot}
136
137 make install DESTDIR=%{buildroot}
138
139 %if %{with dbus}
140 mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
141 install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
142 %endif
143
144 ## tree fixup
145 # drop static libs
146 rm -f %{buildroot}%{_libdir}/*.a
147 rm -f %{buildroot}%{_libdir}/*.la
148 # drop docs and html docs for now
149 rm -rf %{buildroot}%{_docdir}/*
150 # /etc/sysconfig/corosync-notifyd
151 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
152 install -m 644 tools/corosync-notifyd.sysconfig.example \
153 %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
154 # /etc/sysconfig/corosync
155 install -m 644 init/corosync.sysconfig.example \
156 %{buildroot}%{_sysconfdir}/sysconfig/corosync
157
158 %if %{with qdevices}
159 # /etc/sysconfig/corosync-qdevice
160 install -m 644 init/corosync-qdevice.sysconfig.example \
161 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice
162 %endif
163
164 %if %{with qnetd}
165 # /etc/sysconfig/corosync-qnetd
166 install -m 644 init/corosync-qnetd.sysconfig.example \
167 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
168 %if %{with systemd}
169 sed -i -e 's/^#User=/User=/' \
170 %{buildroot}%{_unitdir}/corosync-qnetd.service
171 sed -i -e 's/root/coroqnetd/g' \
172 %{buildroot}%{_tmpfilesdir}/corosync-qnetd.conf
173 %else
174 sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
175 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
176 %endif
177 %endif
178
179 %clean
180 rm -rf %{buildroot}
181
182 %description
183 This package contains the Corosync Cluster Engine Executive, several default
184 APIs and libraries, default configuration files, and an init script.
185
186 %post
187 %if %{with systemd} && 0%{?systemd_post:1}
188 %systemd_post corosync.service
189 %else
190 if [ $1 -eq 1 ]; then
191 /sbin/chkconfig --add corosync || :
192 fi
193 %endif
194
195 %preun
196 %if %{with systemd} && 0%{?systemd_preun:1}
197 %systemd_preun corosync.service
198 %else
199 if [ $1 -eq 0 ]; then
200 /sbin/service corosync stop &>/dev/null || :
201 /sbin/chkconfig --del corosync || :
202 fi
203 %endif
204
205 %postun
206 %if %{with systemd} && 0%{?systemd_postun:1}
207 %systemd_postun
208 %endif
209
210 %files
211 %defattr(-,root,root,-)
212 %doc LICENSE SECURITY
213 %{_sbindir}/corosync
214 %{_sbindir}/corosync-keygen
215 %{_sbindir}/corosync-cmapctl
216 %{_sbindir}/corosync-cfgtool
217 %{_sbindir}/corosync-cpgtool
218 %{_sbindir}/corosync-quorumtool
219 %{_sbindir}/corosync-notifyd
220 %{_bindir}/corosync-blackbox
221 %if %{with xmlconf}
222 %{_bindir}/corosync-xmlproc
223 %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
224 %dir %{_datadir}/corosync
225 %{_datadir}/corosync/xml2conf.xsl
226 %{_mandir}/man8/corosync-xmlproc.8*
227 %{_mandir}/man5/corosync.xml.5*
228 %endif
229 %dir %{_sysconfdir}/corosync
230 %dir %{_sysconfdir}/corosync/uidgid.d
231 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
232 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
233 %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
234 %config(noreplace) %{_sysconfdir}/sysconfig/corosync
235 %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
236 %if %{with dbus}
237 %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
238 %endif
239 %if %{with snmp}
240 %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
241 %endif
242 %if %{with systemd}
243 %{_unitdir}/corosync.service
244 %{_unitdir}/corosync-notifyd.service
245 %dir %{_datadir}/corosync
246 %{_datadir}/corosync/corosync
247 %{_datadir}/corosync/corosync-notifyd
248 %else
249 %{_initrddir}/corosync
250 %{_initrddir}/corosync-notifyd
251 %endif
252 %if %{with upstart}
253 %{_sysconfdir}/init/corosync.conf
254 %{_sysconfdir}/init/corosync-notifyd.conf
255 %endif
256 %dir %{_localstatedir}/lib/corosync
257 %dir %{_localstatedir}/log/cluster
258 %{_mandir}/man8/corosync_overview.8*
259 %{_mandir}/man8/corosync.8*
260 %{_mandir}/man8/corosync-blackbox.8*
261 %{_mandir}/man8/corosync-cmapctl.8*
262 %{_mandir}/man8/corosync-keygen.8*
263 %{_mandir}/man8/corosync-cfgtool.8*
264 %{_mandir}/man8/corosync-cpgtool.8*
265 %{_mandir}/man8/corosync-notifyd.8*
266 %{_mandir}/man8/corosync-quorumtool.8*
267 %{_mandir}/man5/corosync.conf.5*
268 %{_mandir}/man5/votequorum.5*
269 %{_mandir}/man8/cmap_keys.8*
270
271 # optional testagent rpm
272 #
273 %if %{with testagents}
274
275 %package -n corosync-testagents
276 Summary: The Corosync Cluster Engine Test Agents
277 Group: Development/Libraries
278 Requires: %{name} = %{version}-%{release}
279
280 %description -n corosync-testagents
281 This package contains corosync test agents.
282
283 %files -n corosync-testagents
284 %defattr(755,root,root,-)
285 %{_datadir}/corosync/tests/mem_leak_test.sh
286 %{_datadir}/corosync/tests/net_breaker.sh
287 %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
288 %{_datadir}/corosync/tests/shm_leak_audit.sh
289 %{_bindir}/cpg_test_agent
290 %{_bindir}/sam_test_agent
291 %{_bindir}/votequorum_test_agent
292
293 %endif
294
295 # library
296 #
297 %package -n corosynclib
298 Summary: The Corosync Cluster Engine Libraries
299 Group: System Environment/Libraries
300 Requires: %{name} = %{version}-%{release}
301
302 %description -n corosynclib
303 This package contains corosync libraries.
304
305 %files -n corosynclib
306 %defattr(-,root,root,-)
307 %doc LICENSE
308 %{_libdir}/libcfg.so.*
309 %{_libdir}/libcpg.so.*
310 %{_libdir}/libcmap.so.*
311 %{_libdir}/libtotem_pg.so.*
312 %{_libdir}/libquorum.so.*
313 %{_libdir}/libvotequorum.so.*
314 %{_libdir}/libsam.so.*
315 %{_libdir}/libcorosync_common.so.*
316
317 %post -n corosynclib -p /sbin/ldconfig
318
319 %postun -n corosynclib -p /sbin/ldconfig
320
321 %package -n corosynclib-devel
322 Summary: The Corosync Cluster Engine Development Kit
323 Group: Development/Libraries
324 Requires: corosynclib = %{version}-%{release}
325 Requires: pkgconfig
326 Provides: corosync-devel = %{version}
327 Obsoletes: corosync-devel < 0.92-7
328
329 %description -n corosynclib-devel
330 This package contains include files and man pages used to develop using
331 The Corosync Cluster Engine APIs.
332
333 %files -n corosynclib-devel
334 %defattr(-,root,root,-)
335 %doc LICENSE
336 %dir %{_includedir}/corosync/
337 %{_includedir}/corosync/corodefs.h
338 %{_includedir}/corosync/cfg.h
339 %{_includedir}/corosync/cmap.h
340 %{_includedir}/corosync/corotypes.h
341 %{_includedir}/corosync/cpg.h
342 %{_includedir}/corosync/hdb.h
343 %{_includedir}/corosync/sam.h
344 %{_includedir}/corosync/quorum.h
345 %{_includedir}/corosync/votequorum.h
346 %dir %{_includedir}/corosync/totem/
347 %{_includedir}/corosync/totem/totem.h
348 %{_includedir}/corosync/totem/totemip.h
349 %{_includedir}/corosync/totem/totempg.h
350 %{_libdir}/libcfg.so
351 %{_libdir}/libcpg.so
352 %{_libdir}/libcmap.so
353 %{_libdir}/libtotem_pg.so
354 %{_libdir}/libquorum.so
355 %{_libdir}/libvotequorum.so
356 %{_libdir}/libsam.so
357 %{_libdir}/libcorosync_common.so
358 %{_libdir}/pkgconfig/*.pc
359 %{_mandir}/man3/cpg_*3*
360 %{_mandir}/man3/quorum_*3*
361 %{_mandir}/man3/votequorum_*3*
362 %{_mandir}/man3/sam_*3*
363 %{_mandir}/man8/cpg_overview.8*
364 %{_mandir}/man8/votequorum_overview.8*
365 %{_mandir}/man8/sam_overview.8*
366 %{_mandir}/man3/cmap_*3*
367 %{_mandir}/man8/cmap_overview.8*
368 %{_mandir}/man8/quorum_overview.8*
369
370 # optional qdevices
371 #
372 %if %{with qdevices}
373
374 %package -n corosync-qdevice
375 Summary: The Corosync Cluster Engine Qdevice
376 Group: System Environment/Base
377 Requires: %{name} = %{version}-%{release}
378 Requires: corosynclib = %{version}-%{release}
379 Requires: nss-tools
380
381 %if %{with systemd}
382 Requires(post): systemd
383 Requires(preun): systemd
384 Requires(postun): systemd
385 %endif
386
387 %description -n corosync-qdevice
388 This package contains the Corosync Cluster Engine Qdevice, script for creating
389 NSS certificates and an init script.
390
391 %post -n corosync-qdevice
392 %if %{with systemd} && 0%{?systemd_post:1}
393 %systemd_post corosync-qdevice.service
394 %else
395 if [ $1 -eq 1 ]; then
396 /sbin/chkconfig --add corosync-qdevice || :
397 fi
398 %endif
399
400 %preun -n corosync-qdevice
401 %if %{with systemd} && 0%{?systemd_preun:1}
402 %systemd_preun corosync-qdevice.service
403 %else
404 if [ $1 -eq 0 ]; then
405 /sbin/service corosync-qdevice stop &>/dev/null || :
406 /sbin/chkconfig --del corosync-qdevice || :
407 fi
408 %endif
409
410 %postun -n corosync-qdevice
411 %if %{with systemd} && 0%{?systemd_postun:1}
412 %systemd_postun
413 %endif
414
415 %files -n corosync-qdevice
416 %defattr(-,root,root,-)
417 %dir %{_sysconfdir}/corosync/qdevice
418 %dir %config(noreplace) %{_sysconfdir}/corosync/qdevice/net
419 %dir %{_localstatedir}/run/corosync-qdevice
420 %{_sbindir}/corosync-qdevice
421 %{_sbindir}/corosync-qdevice-net-certutil
422 %{_sbindir}/corosync-qdevice-tool
423 %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qdevice
424 %if %{with systemd}
425 %{_unitdir}/corosync-qdevice.service
426 %dir %{_datadir}/corosync
427 %{_datadir}/corosync/corosync-qdevice
428 %else
429 %{_initrddir}/corosync-qdevice
430 %endif
431 %{_mandir}/man8/corosync-qdevice-tool.8*
432 %{_mandir}/man8/corosync-qdevice-net-certutil.8*
433 %{_mandir}/man8/corosync-qdevice.8*
434 %endif
435
436 # optional qnetd
437 #
438 %if %{with qnetd}
439
440 %package -n corosync-qnetd
441 Summary: The Corosync Cluster Engine Qdevice Network Daemon
442 Group: System Environment/Base
443 Requires: nss-tools
444 Requires(pre): shadow-utils
445
446 %if %{with systemd}
447 Requires(post): systemd
448 Requires(preun): systemd
449 Requires(postun): systemd
450 %endif
451
452 %description -n corosync-qnetd
453 This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating
454 NSS certificates and an init script.
455
456 %pre -n corosync-qnetd
457 getent group coroqnetd >/dev/null || groupadd -r coroqnetd
458 getent passwd coroqnetd >/dev/null || \
459 useradd -r -g coroqnetd -d / -s /sbin/nologin -c "User for corosync-qnetd" coroqnetd
460 exit 0
461
462 %post -n corosync-qnetd
463 %if %{with systemd} && 0%{?systemd_post:1}
464 %systemd_post corosync-qnetd.service
465 %else
466 if [ $1 -eq 1 ]; then
467 /sbin/chkconfig --add corosync-qnetd || :
468 fi
469 %endif
470
471 %preun -n corosync-qnetd
472 %if %{with systemd} && 0%{?systemd_preun:1}
473 %systemd_preun corosync-qnetd.service
474 %else
475 if [ $1 -eq 0 ]; then
476 /sbin/service corosync-qnetd stop &>/dev/null || :
477 /sbin/chkconfig --del corosync-qnetd || :
478 fi
479 %endif
480
481 %postun -n corosync-qnetd
482 %if %{with systemd} && 0%{?systemd_postun:1}
483 %systemd_postun
484 %endif
485
486 %files -n corosync-qnetd
487 %defattr(-,root,root,-)
488 %dir %config(noreplace) %attr(770, coroqnetd, coroqnetd) %{_sysconfdir}/corosync/qnetd
489 %dir %attr(770, coroqnetd, coroqnetd) %{_localstatedir}/run/corosync-qnetd
490 %{_bindir}/corosync-qnetd
491 %{_bindir}/corosync-qnetd-certutil
492 %{_bindir}/corosync-qnetd-tool
493 %config(noreplace) %{_sysconfdir}/sysconfig/corosync-qnetd
494 %if %{with systemd}
495 %{_unitdir}/corosync-qnetd.service
496 %dir %{_datadir}/corosync
497 %{_datadir}/corosync/corosync-qnetd
498 %{_tmpfilesdir}/corosync-qnetd.conf
499 %else
500 %{_initrddir}/corosync-qnetd
501 %endif
502 %{_mandir}/man8/corosync-qnetd-tool.8*
503 %{_mandir}/man8/corosync-qnetd-certutil.8*
504 %{_mandir}/man8/corosync-qnetd.8*
505 %endif
506
507 %changelog
508 * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
509 - Autotools generated version