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