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