6 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
7 # to disable or enable specific features
10 %bcond_with monitoring
17 %bcond_with runautogen
21 %global gitver
%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
22 %global gittarver
%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
25 Summary: The Corosync Cluster Engine and Application Programming Interfaces
27 Release: 1%{?gitver}%{?dist}
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
34 # The automatic dependency overridden in favor of explicit version lock
35 Requires: corosynclib
{?_isa
} = %{version}-%{release}
36 Requires(pre
): /usr
/sbin
/useradd
37 Requires(post
): /sbin
/chkconfig
38 Requires(preun
): /sbin
/chkconfig
39 Conflicts: openais
<= 0.89, openais
-devel
<= 0.89
44 BuildRequires
: libqb
-devel
45 BuildRequires
: nss
-devel
46 BuildRequires
: zlib
-devel
47 %if %{with runautogen}
48 BuildRequires
: autoconf automake libtool
50 %if %{with monitoring}
51 BuildRequires
: libstatgrab
-devel
54 BuildRequires
: libibverbs
-devel librdmacm
-devel
57 BuildRequires
: net
-snmp
-devel
60 BuildRequires
: dbus
-devel
63 BuildRequires
: systemd
-units
64 Requires(post
): systemd
65 Requires(preun
): systemd
66 Requires(postun
): systemd
71 %if %{with qdevices} || %{with qnetd}
78 BuildRoot: %
(mktemp
-ud
%{_tmppath}/%{name}-%{version}-%{release}-XXXXXX
)
81 %setup -q
-n
%{name}-%{version}%{?gittarver}
84 %if %{with runautogen}
89 export ibverbs_CFLAGS
=-I
/usr
/include
/infiniband \
90 export ibverbs_LIBS
=-libverbs \
91 export rdmacm_CFLAGS
=-I
/usr
/include
/rdma \
92 export rdmacm_LIBS
=-lrdmacm \
95 %if %{with testagents}
101 %if %{with monitoring}
102 --enable-monitoring \
128 --with
-initddir
=%{_initrddir} \
129 --with
-systemddir
=%{_unitdir} \
130 --with
-upstartdir
=%{_sysconfdir}/init \
131 --with
-tmpfilesdir
=%{_tmpfilesdir}
138 make install DESTDIR
=%{buildroot}
141 mkdir -p
-m
0700 %{buildroot}/%{_sysconfdir}/dbus
-1/system.d
142 install -m
644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus
-1/system.d
/corosync
-signals.conf
147 rm -f
%{buildroot}%{_libdir}/*.a
148 rm -f
%{buildroot}%{_libdir}/*.la
149 # drop docs and html docs for now
150 rm -rf
%{buildroot}%{_docdir}/*
151 # /etc/sysconfig/corosync-notifyd
152 mkdir -p
%{buildroot}%{_sysconfdir}/sysconfig
153 install -m
644 tools
/corosync
-notifyd.sysconfig.example \
154 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-notifyd
155 # /etc/sysconfig/corosync
156 install -m
644 init
/corosync.sysconfig.example \
157 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
160 # /etc/sysconfig/corosync-qdevice
161 install -m
644 init
/corosync
-qdevice.sysconfig.example \
162 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qdevice
166 # /etc/sysconfig/corosync-qnetd
167 install -m
644 init
/corosync
-qnetd.sysconfig.example \
168 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
170 sed
-i
-e 's
/^
#User=/User=/' \
171 %{buildroot}%{_unitdir}/corosync
-qnetd.service
172 sed
-i
-e 's
/root
/coroqnetd
/g' \
173 %{buildroot}%{_tmpfilesdir}/corosync
-qnetd.conf
175 sed
-i
-e 's
/^COROSYNC_QNETD_RUNAS
=""$
/COROSYNC_QNETD_RUNAS
="coroqnetd"
/' \
176 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
184 This package contains the Corosync Cluster Engine Executive
, several default
185 APIs and libraries
, default configuration files
, and an init script.
188 %if %{with systemd} && 0%{?systemd_post:1}
189 %systemd_post corosync.service
191 if [ $
1 -eq
1 ]; then
192 /sbin
/chkconfig
--add corosync ||
:
197 %if %{with systemd} && 0%{?systemd_preun:1}
198 %systemd_preun corosync.service
200 if [ $
1 -eq
0 ]; then
201 /sbin
/service corosync stop
&>/dev
/null ||
:
202 /sbin
/chkconfig
--del corosync ||
:
207 %if %{with systemd} && 0%{?systemd_postun:1}
212 %defattr(-,root
,root
,-)
213 %doc LICENSE SECURITY
215 %{_sbindir}/corosync
-keygen
216 %{_sbindir}/corosync
-cmapctl
217 %{_sbindir}/corosync
-cfgtool
218 %{_sbindir}/corosync
-cpgtool
219 %{_sbindir}/corosync
-quorumtool
220 %{_sbindir}/corosync
-notifyd
221 %{_bindir}/corosync
-blackbox
223 %{_bindir}/corosync
-xmlproc
224 %config(noreplace
) %{_sysconfdir}/corosync
/corosync.xml.example
225 %dir %{_datadir}/corosync
226 %{_datadir}/corosync
/xml2conf.xsl
227 %{_mandir}/man8
/corosync
-xmlproc
.8*
228 %{_mandir}/man5
/corosync.xml
.5*
230 %dir %{_sysconfdir}/corosync
231 %dir %{_sysconfdir}/corosync
/uidgid.d
232 %config(noreplace
) %{_sysconfdir}/corosync
/corosync.conf.example
233 %config(noreplace
) %{_sysconfdir}/corosync
/corosync.conf.example.udpu
234 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-notifyd
235 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
236 %config(noreplace
) %{_sysconfdir}/logrotate.d
/corosync
238 %{_sysconfdir}/dbus
-1/system.d
/corosync
-signals.conf
241 %{_datadir}/snmp
/mibs
/COROSYNC
-MIB.txt
244 %{_unitdir}/corosync.service
245 %{_unitdir}/corosync
-notifyd.service
246 %dir %{_datadir}/corosync
247 %{_datadir}/corosync
/corosync
248 %{_datadir}/corosync
/corosync
-notifyd
250 %{_initrddir}/corosync
251 %{_initrddir}/corosync
-notifyd
254 %{_sysconfdir}/init
/corosync.conf
255 %{_sysconfdir}/init
/corosync
-notifyd.conf
257 %dir %{_localstatedir}/lib
/corosync
258 %dir %{_localstatedir}/log
/cluster
259 %{_mandir}/man8
/corosync_overview
.8*
260 %{_mandir}/man8
/corosync
.8*
261 %{_mandir}/man8
/corosync
-blackbox
.8*
262 %{_mandir}/man8
/corosync
-cmapctl
.8*
263 %{_mandir}/man8
/corosync
-keygen
.8*
264 %{_mandir}/man8
/corosync
-cfgtool
.8*
265 %{_mandir}/man8
/corosync
-cpgtool
.8*
266 %{_mandir}/man8
/corosync
-notifyd
.8*
267 %{_mandir}/man8
/corosync
-quorumtool
.8*
268 %{_mandir}/man5
/corosync.conf
.5*
269 %{_mandir}/man5
/votequorum
.5*
270 %{_mandir}/man8
/cmap_keys
.8*
272 # optional testagent rpm
274 %if %{with testagents}
276 %package -n corosync
-testagents
277 Summary: The Corosync Cluster Engine Test Agents
278 Group: Development
/Libraries
279 Requires: %{name} = %{version}-%{release}
281 %description -n corosync
-testagents
282 This package contains corosync
test agents.
284 %files -n corosync
-testagents
285 %defattr(755,root
,root
,-)
286 %{_datadir}/corosync
/tests
/mem_leak_test.sh
287 %{_datadir}/corosync
/tests
/net_breaker.sh
288 %{_datadir}/corosync
/tests
/cmap
-dispatch
-deadlock.sh
289 %{_datadir}/corosync
/tests
/shm_leak_audit.sh
290 %{_bindir}/cpg_test_agent
291 %{_bindir}/sam_test_agent
292 %{_bindir}/votequorum_test_agent
298 %package -n corosynclib
299 Summary: The Corosync Cluster Engine Libraries
300 Group: System Environment
/Libraries
302 %description -n corosynclib
303 This package contains corosync libraries.
305 %files -n corosynclib
306 %defattr(-,root
,root
,-)
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.
*
317 %post -n corosynclib
-p
/sbin
/ldconfig
319 %postun -n corosynclib
-p
/sbin
/ldconfig
321 %package -n corosynclib
-devel
322 Summary: The Corosync Cluster Engine Development Kit
323 Group: Development
/Libraries
324 Requires: corosynclib
%{?_isa} = %{version}-%{release}
326 Provides: corosync
-devel
= %{version}
327 Obsoletes
: corosync
-devel
< 0.92-7
329 %description -n corosynclib
-devel
330 This package contains include files and man pages used to develop using
331 The Corosync Cluster Engine APIs.
333 %files -n corosynclib
-devel
334 %defattr(-,root
,root
,-)
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
352 %{_libdir}/libcmap.so
353 %{_libdir}/libtotem_pg.so
354 %{_libdir}/libquorum.so
355 %{_libdir}/libvotequorum.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*
374 %package -n corosync
-qdevice
375 Summary: The Corosync Cluster Engine Qdevice
376 Group: System Environment
/Base
377 Requires: %{name} = %{version}-%{release}
378 # The automatic dependency overridden in favor of explicit version lock
379 Requires: corosynclib
{?_isa
} = %{version}-%{release}
383 Requires(post
): systemd
384 Requires(preun
): systemd
385 Requires(postun
): systemd
388 %description -n corosync
-qdevice
389 This package contains the Corosync Cluster Engine Qdevice
, script
for creating
390 NSS certificates and an init script.
392 %post -n corosync
-qdevice
393 %if %{with systemd} && 0%{?systemd_post:1}
394 %systemd_post corosync
-qdevice.service
396 if [ $
1 -eq
1 ]; then
397 /sbin
/chkconfig
--add corosync
-qdevice ||
:
401 %preun -n corosync
-qdevice
402 %if %{with systemd} && 0%{?systemd_preun:1}
403 %systemd_preun corosync
-qdevice.service
405 if [ $
1 -eq
0 ]; then
406 /sbin
/service corosync
-qdevice stop
&>/dev
/null ||
:
407 /sbin
/chkconfig
--del corosync
-qdevice ||
:
411 %postun -n corosync
-qdevice
412 %if %{with systemd} && 0%{?systemd_postun:1}
416 %files -n corosync
-qdevice
417 %defattr(-,root
,root
,-)
418 %dir %{_sysconfdir}/corosync
/qdevice
419 %dir %config(noreplace
) %{_sysconfdir}/corosync
/qdevice
/net
420 %dir %{_localstatedir}/run
/corosync
-qdevice
421 %{_sbindir}/corosync
-qdevice
422 %{_sbindir}/corosync
-qdevice
-net
-certutil
423 %{_sbindir}/corosync
-qdevice
-tool
424 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qdevice
426 %{_unitdir}/corosync
-qdevice.service
427 %dir %{_datadir}/corosync
428 %{_datadir}/corosync
/corosync
-qdevice
430 %{_initrddir}/corosync
-qdevice
432 %{_mandir}/man8
/corosync
-qdevice
-tool
.8*
433 %{_mandir}/man8
/corosync
-qdevice
-net
-certutil
.8*
434 %{_mandir}/man8
/corosync
-qdevice
.8*
441 %package -n corosync
-qnetd
442 Summary: The Corosync Cluster Engine Qdevice Network Daemon
443 Group: System Environment
/Base
445 Requires(pre
): shadow
-utils
448 Requires(post
): systemd
449 Requires(preun
): systemd
450 Requires(postun
): systemd
453 %description -n corosync
-qnetd
454 This package contains the Corosync Cluster Engine Qdevice Network Daemon
, script
for creating
455 NSS certificates and an init script.
457 %pre -n corosync
-qnetd
458 getent group coroqnetd
>/dev
/null || groupadd
-r coroqnetd
459 getent passwd coroqnetd
>/dev
/null || \
460 useradd
-r
-g coroqnetd
-d
/ -s
/sbin
/nologin
-c "User
for corosync
-qnetd" coroqnetd
463 %post -n corosync
-qnetd
464 %if %{with systemd} && 0%{?systemd_post:1}
465 %systemd_post corosync
-qnetd.service
467 if [ $
1 -eq
1 ]; then
468 /sbin
/chkconfig
--add corosync
-qnetd ||
:
472 %preun -n corosync
-qnetd
473 %if %{with systemd} && 0%{?systemd_preun:1}
474 %systemd_preun corosync
-qnetd.service
476 if [ $
1 -eq
0 ]; then
477 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
478 /sbin
/chkconfig
--del corosync
-qnetd ||
:
482 %postun -n corosync
-qnetd
483 %if %{with systemd} && 0%{?systemd_postun:1}
487 %files -n corosync
-qnetd
488 %defattr(-,root
,root
,-)
489 %dir %config(noreplace
) %attr(770, coroqnetd
, coroqnetd
) %{_sysconfdir}/corosync
/qnetd
490 %dir %attr(770, coroqnetd
, coroqnetd
) %{_localstatedir}/run
/corosync
-qnetd
491 %{_bindir}/corosync
-qnetd
492 %{_bindir}/corosync
-qnetd
-certutil
493 %{_bindir}/corosync
-qnetd
-tool
494 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qnetd
496 %{_unitdir}/corosync
-qnetd.service
497 %dir %{_datadir}/corosync
498 %{_datadir}/corosync
/corosync
-qnetd
499 %{_tmpfilesdir}/corosync
-qnetd.conf
501 %{_initrddir}/corosync
-qnetd
503 %{_mandir}/man8
/corosync
-qnetd
-tool
.8*
504 %{_mandir}/man8
/corosync
-qnetd
-certutil
.8*
505 %{_mandir}/man8
/corosync
-qnetd
.8*
509 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
510 - Autotools generated version