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 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
43 BuildRequires
: libqb
-devel
44 BuildRequires
: nss
-devel
45 BuildRequires
: zlib
-devel
46 %if %{with runautogen}
47 BuildRequires
: autoconf automake libtool
49 %if %{with monitoring}
50 BuildRequires
: libstatgrab
-devel
53 BuildRequires
: libibverbs
-devel librdmacm
-devel
56 BuildRequires
: net
-snmp
-devel
59 BuildRequires
: dbus
-devel
62 BuildRequires
: systemd
-units
63 Requires(post
): systemd
64 Requires(preun
): systemd
65 Requires(postun
): systemd
70 %if %{with qdevices} || %{with qnetd}
77 BuildRoot: %
(mktemp
-ud
%{_tmppath}/%{name}-%{version}-%{release}-XXXXXX
)
80 %setup -q
-n
%{name}-%{version}%{?gittarver}
83 %if %{with runautogen}
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 \
94 %if %{with testagents}
100 %if %{with monitoring}
101 --enable-monitoring \
127 --with
-initddir
=%{_initrddir} \
128 --with
-systemddir
=%{_unitdir} \
129 --with
-upstartdir
=%{_sysconfdir}/init \
130 --with
-tmpfilesdir
=%{_tmpfilesdir}
137 make install DESTDIR
=%{buildroot}
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
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
159 # /etc/sysconfig/corosync-qdevice
160 install -m
644 init
/corosync
-qdevice.sysconfig.example \
161 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qdevice
165 # /etc/sysconfig/corosync-qnetd
166 install -m
644 init
/corosync
-qnetd.sysconfig.example \
167 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
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
174 sed
-i
-e 's
/^COROSYNC_QNETD_RUNAS
=""$
/COROSYNC_QNETD_RUNAS
="coroqnetd"
/' \
175 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
183 This package contains the Corosync Cluster Engine Executive
, several default
184 APIs and libraries
, default configuration files
, and an init script.
187 %if %{with systemd} && 0%{?systemd_post:1}
188 %systemd_post corosync.service
190 if [ $
1 -eq
1 ]; then
191 /sbin
/chkconfig
--add corosync ||
:
196 %if %{with systemd} && 0%{?systemd_preun:1}
197 %systemd_preun corosync.service
199 if [ $
1 -eq
0 ]; then
200 /sbin
/service corosync stop
&>/dev
/null ||
:
201 /sbin
/chkconfig
--del corosync ||
:
206 %if %{with systemd} && 0%{?systemd_postun:1}
211 %defattr(-,root
,root
,-)
212 %doc LICENSE SECURITY
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
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*
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
237 %{_sysconfdir}/dbus
-1/system.d
/corosync
-signals.conf
240 %{_datadir}/snmp
/mibs
/COROSYNC
-MIB.txt
243 %{_unitdir}/corosync.service
244 %{_unitdir}/corosync
-notifyd.service
245 %dir %{_datadir}/corosync
246 %{_datadir}/corosync
/corosync
247 %{_datadir}/corosync
/corosync
-notifyd
249 %{_initrddir}/corosync
250 %{_initrddir}/corosync
-notifyd
253 %{_sysconfdir}/init
/corosync.conf
254 %{_sysconfdir}/init
/corosync
-notifyd.conf
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*
271 # optional testagent rpm
273 %if %{with testagents}
275 %package -n corosync
-testagents
276 Summary: The Corosync Cluster Engine Test Agents
277 Group: Development
/Libraries
278 Requires: %{name} = %{version}-%{release}
280 %description -n corosync
-testagents
281 This package contains corosync
test agents.
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
297 %package -n corosynclib
298 Summary: The Corosync Cluster Engine Libraries
299 Group: System Environment
/Libraries
300 Requires: %{name} = %{version}-%{release}
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
= %{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 Requires: corosynclib
= %{version}-%{release}
382 Requires(post
): systemd
383 Requires(preun
): systemd
384 Requires(postun
): systemd
387 %description -n corosync
-qdevice
388 This package contains the Corosync Cluster Engine Qdevice
, script
for creating
389 NSS certificates and an init script.
391 %post -n corosync
-qdevice
392 %if %{with systemd} && 0%{?systemd_post:1}
393 %systemd_post corosync
-qdevice.service
395 if [ $
1 -eq
1 ]; then
396 /sbin
/chkconfig
--add corosync
-qdevice ||
:
400 %preun -n corosync
-qdevice
401 %if %{with systemd} && 0%{?systemd_preun:1}
402 %systemd_preun corosync
-qdevice.service
404 if [ $
1 -eq
0 ]; then
405 /sbin
/service corosync
-qdevice stop
&>/dev
/null ||
:
406 /sbin
/chkconfig
--del corosync
-qdevice ||
:
410 %postun -n corosync
-qdevice
411 %if %{with systemd} && 0%{?systemd_postun:1}
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
425 %{_unitdir}/corosync
-qdevice.service
426 %dir %{_datadir}/corosync
427 %{_datadir}/corosync
/corosync
-qdevice
429 %{_initrddir}/corosync
-qdevice
431 %{_mandir}/man8
/corosync
-qdevice
-tool
.8*
432 %{_mandir}/man8
/corosync
-qdevice
-net
-certutil
.8*
433 %{_mandir}/man8
/corosync
-qdevice
.8*
440 %package -n corosync
-qnetd
441 Summary: The Corosync Cluster Engine Qdevice Network Daemon
442 Group: System Environment
/Base
444 Requires(pre
): shadow
-utils
447 Requires(post
): systemd
448 Requires(preun
): systemd
449 Requires(postun
): systemd
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.
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
462 %post -n corosync
-qnetd
463 %if %{with systemd} && 0%{?systemd_post:1}
464 %systemd_post corosync
-qnetd.service
466 if [ $
1 -eq
1 ]; then
467 /sbin
/chkconfig
--add corosync
-qnetd ||
:
471 %preun -n corosync
-qnetd
472 %if %{with systemd} && 0%{?systemd_preun:1}
473 %systemd_preun corosync
-qnetd.service
475 if [ $
1 -eq
0 ]; then
476 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
477 /sbin
/chkconfig
--del corosync
-qnetd ||
:
481 %postun -n corosync
-qnetd
482 %if %{with systemd} && 0%{?systemd_postun:1}
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
495 %{_unitdir}/corosync
-qnetd.service
496 %dir %{_datadir}/corosync
497 %{_datadir}/corosync
/corosync
-qnetd
498 %{_tmpfilesdir}/corosync
-qnetd.conf
500 %{_initrddir}/corosync
-qnetd
502 %{_mandir}/man8
/corosync
-qnetd
-tool
.8*
503 %{_mandir}/man8
/corosync
-qnetd
-certutil
.8*
504 %{_mandir}/man8
/corosync
-qnetd
.8*
508 * @date@ Autotools generated version
<nobody@nowhere.org
> - @version@
-1-@numcomm@.@alphatag@.@dirty@
509 - Autotools generated version