6 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
7 # to disable or enable specific features
10 %bcond_with monitoring
17 %bcond_with runautogen
22 %global gitver
%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
23 %global gittarver
%{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
26 Summary: The Corosync Cluster Engine and Application Programming Interfaces
28 Release: 1%{?gitver}%{?dist}
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
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
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
52 %if %{with monitoring}
53 BuildRequires
: libstatgrab
-devel
56 BuildRequires
: libibverbs
-devel librdmacm
-devel
59 BuildRequires
: net
-snmp
-devel
62 BuildRequires
: dbus
-devel
65 BuildRequires
: systemd
-units
66 Requires(post
): systemd
67 Requires(preun
): systemd
68 Requires(postun
): systemd
73 %if %{with qdevices} || %{with qnetd}
80 BuildRequires
: libcgroup
-devel
83 BuildRoot: %
(mktemp
-ud
%{_tmppath}/%{name}-%{version}-%{release}-XXXXXX
)
86 %setup -q
-n
%{name}-%{version}%{?gittarver}
89 %if %{with runautogen}
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 \
100 %if %{with testagents}
101 --enable-testagents \
106 %if %{with monitoring}
107 --enable-monitoring \
133 %if %{with libcgroup}
136 --with
-initddir
=%{_initrddir} \
137 --with
-systemddir
=%{_unitdir} \
138 --with
-upstartdir
=%{_sysconfdir}/init \
139 --with
-tmpfilesdir
=%{_tmpfilesdir}
146 make install DESTDIR
=%{buildroot}
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
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
168 # /etc/sysconfig/corosync-qdevice
169 install -m
644 init
/corosync
-qdevice.sysconfig.example \
170 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qdevice
174 # /etc/sysconfig/corosync-qnetd
175 install -m
644 init
/corosync
-qnetd.sysconfig.example \
176 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
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
183 sed
-i
-e 's
/^COROSYNC_QNETD_RUNAS
=""$
/COROSYNC_QNETD_RUNAS
="coroqnetd"
/' \
184 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
192 This package contains the Corosync Cluster Engine Executive
, several default
193 APIs and libraries
, default configuration files
, and an init script.
196 %if %{with systemd} && 0%{?systemd_post:1}
197 %systemd_post corosync.service
199 if [ $
1 -eq
1 ]; then
200 /sbin
/chkconfig
--add corosync ||
:
205 %if %{with systemd} && 0%{?systemd_preun:1}
206 %systemd_preun corosync.service
208 if [ $
1 -eq
0 ]; then
209 /sbin
/service corosync stop
&>/dev
/null ||
:
210 /sbin
/chkconfig
--del corosync ||
:
215 %if %{with systemd} && 0%{?systemd_postun:1}
220 %defattr(-,root
,root
,-)
221 %doc LICENSE SECURITY
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
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*
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
246 %{_sysconfdir}/dbus
-1/system.d
/corosync
-signals.conf
249 %{_datadir}/snmp
/mibs
/COROSYNC
-MIB.txt
252 %{_unitdir}/corosync.service
253 %{_unitdir}/corosync
-notifyd.service
254 %dir %{_datadir}/corosync
255 %{_datadir}/corosync
/corosync
256 %{_datadir}/corosync
/corosync
-notifyd
258 %{_initrddir}/corosync
259 %{_initrddir}/corosync
-notifyd
262 %{_sysconfdir}/init
/corosync.conf
263 %{_sysconfdir}/init
/corosync
-notifyd.conf
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*
280 # optional testagent rpm
282 %if %{with testagents}
284 %package -n corosync
-testagents
285 Summary: The Corosync Cluster Engine Test Agents
286 Group: Development
/Libraries
287 Requires: %{name} = %{version}-%{release}
289 %description -n corosync
-testagents
290 This package contains corosync
test agents.
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
306 %package -n corosynclib
307 Summary: The Corosync Cluster Engine Libraries
308 Group: System Environment
/Libraries
310 %description -n corosynclib
311 This package contains corosync libraries.
313 %files -n corosynclib
314 %defattr(-,root
,root
,-)
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.
*
325 %post -n corosynclib
-p
/sbin
/ldconfig
327 %postun -n corosynclib
-p
/sbin
/ldconfig
329 %package -n corosynclib
-devel
330 Summary: The Corosync Cluster Engine Development Kit
331 Group: Development
/Libraries
332 Requires: corosynclib
%{?_isa} = %{version}-%{release}
334 Provides: corosync
-devel
= %{version}
335 Obsoletes
: corosync
-devel
< 0.92-7
337 %description -n corosynclib
-devel
338 This package contains include files and man pages used to develop using
339 The Corosync Cluster Engine APIs.
341 %files -n corosynclib
-devel
342 %defattr(-,root
,root
,-)
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
360 %{_libdir}/libcmap.so
361 %{_libdir}/libtotem_pg.so
362 %{_libdir}/libquorum.so
363 %{_libdir}/libvotequorum.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*
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}
391 Requires(post
): systemd
392 Requires(preun
): systemd
393 Requires(postun
): systemd
396 %description -n corosync
-qdevice
397 This package contains the Corosync Cluster Engine Qdevice
, script
for creating
398 NSS certificates and an init script.
400 %post -n corosync
-qdevice
401 %if %{with systemd} && 0%{?systemd_post:1}
402 %systemd_post corosync
-qdevice.service
404 if [ $
1 -eq
1 ]; then
405 /sbin
/chkconfig
--add corosync
-qdevice ||
:
409 %preun -n corosync
-qdevice
410 %if %{with systemd} && 0%{?systemd_preun:1}
411 %systemd_preun corosync
-qdevice.service
413 if [ $
1 -eq
0 ]; then
414 /sbin
/service corosync
-qdevice stop
&>/dev
/null ||
:
415 /sbin
/chkconfig
--del corosync
-qdevice ||
:
419 %postun -n corosync
-qdevice
420 %if %{with systemd} && 0%{?systemd_postun:1}
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
434 %{_unitdir}/corosync
-qdevice.service
435 %dir %{_datadir}/corosync
436 %{_datadir}/corosync
/corosync
-qdevice
438 %{_initrddir}/corosync
-qdevice
440 %{_mandir}/man8
/corosync
-qdevice
-tool
.8*
441 %{_mandir}/man8
/corosync
-qdevice
-net
-certutil
.8*
442 %{_mandir}/man8
/corosync
-qdevice
.8*
449 %package -n corosync
-qnetd
450 Summary: The Corosync Cluster Engine Qdevice Network Daemon
451 Group: System Environment
/Base
453 Requires(pre
): shadow
-utils
456 Requires(post
): systemd
457 Requires(preun
): systemd
458 Requires(postun
): systemd
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.
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
471 %post -n corosync
-qnetd
472 %if %{with systemd} && 0%{?systemd_post:1}
473 %systemd_post corosync
-qnetd.service
475 if [ $
1 -eq
1 ]; then
476 /sbin
/chkconfig
--add corosync
-qnetd ||
:
480 %preun -n corosync
-qnetd
481 %if %{with systemd} && 0%{?systemd_preun:1}
482 %systemd_preun corosync
-qnetd.service
484 if [ $
1 -eq
0 ]; then
485 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
486 /sbin
/chkconfig
--del corosync
-qnetd ||
:
490 %postun -n corosync
-qnetd
491 %if %{with systemd} && 0%{?systemd_postun:1}
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
504 %{_unitdir}/corosync
-qnetd.service
505 %dir %{_datadir}/corosync
506 %{_datadir}/corosync
/corosync
-qnetd
507 %{_tmpfilesdir}/corosync
-qnetd.conf
509 %{_initrddir}/corosync
-qnetd
511 %{_mandir}/man8
/corosync
-qnetd
-tool
.8*
512 %{_mandir}/man8
/corosync
-qnetd
-certutil
.8*
513 %{_mandir}/man8
/corosync
-qnetd
.8*
517 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
518 - Autotools generated version