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 BuildRequires
: systemd
-devel
67 Requires(post
): systemd
68 Requires(preun
): systemd
69 Requires(postun
): systemd
74 %if %{with qdevices} || %{with qnetd}
81 BuildRequires
: libcgroup
-devel
84 BuildRoot: %
(mktemp
-ud
%{_tmppath}/%{name}-%{version}-%{release}-XXXXXX
)
87 %setup -q
-n
%{name}-%{version}%{?gittarver}
90 %if %{with runautogen}
95 export ibverbs_CFLAGS
=-I
/usr
/include
/infiniband \
96 export ibverbs_LIBS
=-libverbs \
97 export rdmacm_CFLAGS
=-I
/usr
/include
/rdma \
98 export rdmacm_LIBS
=-lrdmacm \
101 %if %{with testagents}
102 --enable-testagents \
107 %if %{with monitoring}
108 --enable-monitoring \
134 %if %{with libcgroup}
137 --with
-initddir
=%{_initrddir} \
138 --with
-systemddir
=%{_unitdir} \
139 --with
-upstartdir
=%{_sysconfdir}/init
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
181 sed
-i
-e 's
/^COROSYNC_QNETD_RUNAS
=""$
/COROSYNC_QNETD_RUNAS
="coroqnetd"
/' \
182 %{buildroot}%{_sysconfdir}/sysconfig
/corosync
-qnetd
190 This package contains the Corosync Cluster Engine Executive
, several default
191 APIs and libraries
, default configuration files
, and an init script.
194 %if %{with systemd} && 0%{?systemd_post:1}
195 %systemd_post corosync.service
197 if [ $
1 -eq
1 ]; then
198 /sbin
/chkconfig
--add corosync ||
:
203 %if %{with systemd} && 0%{?systemd_preun:1}
204 %systemd_preun corosync.service
206 if [ $
1 -eq
0 ]; then
207 /sbin
/service corosync stop
&>/dev
/null ||
:
208 /sbin
/chkconfig
--del corosync ||
:
213 %if %{with systemd} && 0%{?systemd_postun:1}
218 %defattr(-,root
,root
,-)
219 %doc LICENSE SECURITY
221 %{_sbindir}/corosync
-keygen
222 %{_sbindir}/corosync
-cmapctl
223 %{_sbindir}/corosync
-cfgtool
224 %{_sbindir}/corosync
-cpgtool
225 %{_sbindir}/corosync
-quorumtool
226 %{_sbindir}/corosync
-notifyd
227 %{_bindir}/corosync
-blackbox
229 %{_bindir}/corosync
-xmlproc
230 %config(noreplace
) %{_sysconfdir}/corosync
/corosync.xml.example
231 %dir %{_datadir}/corosync
232 %{_datadir}/corosync
/xml2conf.xsl
233 %{_mandir}/man8
/corosync
-xmlproc
.8*
234 %{_mandir}/man5
/corosync.xml
.5*
236 %dir %{_sysconfdir}/corosync
237 %dir %{_sysconfdir}/corosync
/uidgid.d
238 %config(noreplace
) %{_sysconfdir}/corosync
/corosync.conf.example
239 %config(noreplace
) %{_sysconfdir}/corosync
/corosync.conf.example.udpu
240 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-notifyd
241 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
242 %config(noreplace
) %{_sysconfdir}/logrotate.d
/corosync
244 %{_sysconfdir}/dbus
-1/system.d
/corosync
-signals.conf
247 %{_datadir}/snmp
/mibs
/COROSYNC
-MIB.txt
250 %{_unitdir}/corosync.service
251 %{_unitdir}/corosync
-notifyd.service
253 %{_initrddir}/corosync
254 %{_initrddir}/corosync
-notifyd
257 %{_sysconfdir}/init
/corosync.conf
258 %{_sysconfdir}/init
/corosync
-notifyd.conf
260 %dir %{_localstatedir}/lib
/corosync
261 %dir %{_localstatedir}/log
/cluster
262 %{_mandir}/man8
/corosync_overview
.8*
263 %{_mandir}/man8
/corosync
.8*
264 %{_mandir}/man8
/corosync
-blackbox
.8*
265 %{_mandir}/man8
/corosync
-cmapctl
.8*
266 %{_mandir}/man8
/corosync
-keygen
.8*
267 %{_mandir}/man8
/corosync
-cfgtool
.8*
268 %{_mandir}/man8
/corosync
-cpgtool
.8*
269 %{_mandir}/man8
/corosync
-notifyd
.8*
270 %{_mandir}/man8
/corosync
-quorumtool
.8*
271 %{_mandir}/man5
/corosync.conf
.5*
272 %{_mandir}/man5
/votequorum
.5*
273 %{_mandir}/man8
/cmap_keys
.8*
275 # optional testagent rpm
277 %if %{with testagents}
279 %package -n corosync
-testagents
280 Summary: The Corosync Cluster Engine Test Agents
281 Group: Development
/Libraries
282 Requires: %{name} = %{version}-%{release}
284 %description -n corosync
-testagents
285 This package contains corosync
test agents.
287 %files -n corosync
-testagents
288 %defattr(755,root
,root
,-)
289 %{_datadir}/corosync
/tests
/mem_leak_test.sh
290 %{_datadir}/corosync
/tests
/net_breaker.sh
291 %{_datadir}/corosync
/tests
/cmap
-dispatch
-deadlock.sh
292 %{_datadir}/corosync
/tests
/shm_leak_audit.sh
293 %{_bindir}/cpg_test_agent
294 %{_bindir}/sam_test_agent
295 %{_bindir}/votequorum_test_agent
301 %package -n corosynclib
302 Summary: The Corosync Cluster Engine Libraries
303 Group: System Environment
/Libraries
305 %description -n corosynclib
306 This package contains corosync libraries.
308 %files -n corosynclib
309 %defattr(-,root
,root
,-)
311 %{_libdir}/libcfg.so.
*
312 %{_libdir}/libcpg.so.
*
313 %{_libdir}/libcmap.so.
*
314 %{_libdir}/libtotem_pg.so.
*
315 %{_libdir}/libquorum.so.
*
316 %{_libdir}/libvotequorum.so.
*
317 %{_libdir}/libsam.so.
*
318 %{_libdir}/libcorosync_common.so.
*
320 %post -n corosynclib
-p
/sbin
/ldconfig
322 %postun -n corosynclib
-p
/sbin
/ldconfig
324 %package -n corosynclib
-devel
325 Summary: The Corosync Cluster Engine Development Kit
326 Group: Development
/Libraries
327 Requires: corosynclib
%{?_isa} = %{version}-%{release}
329 Provides: corosync
-devel
= %{version}
330 Obsoletes
: corosync
-devel
< 0.92-7
332 %description -n corosynclib
-devel
333 This package contains include files and man pages used to develop using
334 The Corosync Cluster Engine APIs.
336 %files -n corosynclib
-devel
337 %defattr(-,root
,root
,-)
339 %dir %{_includedir}/corosync
/
340 %{_includedir}/corosync
/corodefs.h
341 %{_includedir}/corosync
/cfg.h
342 %{_includedir}/corosync
/cmap.h
343 %{_includedir}/corosync
/corotypes.h
344 %{_includedir}/corosync
/cpg.h
345 %{_includedir}/corosync
/hdb.h
346 %{_includedir}/corosync
/sam.h
347 %{_includedir}/corosync
/quorum.h
348 %{_includedir}/corosync
/votequorum.h
349 %dir %{_includedir}/corosync
/totem
/
350 %{_includedir}/corosync
/totem
/totem.h
351 %{_includedir}/corosync
/totem
/totemip.h
352 %{_includedir}/corosync
/totem
/totempg.h
353 %{_includedir}/corosync
/totem
/totemstats.h
356 %{_libdir}/libcmap.so
357 %{_libdir}/libtotem_pg.so
358 %{_libdir}/libquorum.so
359 %{_libdir}/libvotequorum.so
361 %{_libdir}/libcorosync_common.so
362 %{_libdir}/pkgconfig
/*.pc
363 %{_mandir}/man3
/cpg_
*3*
364 %{_mandir}/man3
/quorum_
*3*
365 %{_mandir}/man3
/votequorum_
*3*
366 %{_mandir}/man3
/sam_
*3*
367 %{_mandir}/man8
/cpg_overview
.8*
368 %{_mandir}/man8
/votequorum_overview
.8*
369 %{_mandir}/man8
/sam_overview
.8*
370 %{_mandir}/man3
/cmap_
*3*
371 %{_mandir}/man8
/cmap_overview
.8*
372 %{_mandir}/man8
/quorum_overview
.8*
378 %package -n corosync
-qdevice
379 Summary: The Corosync Cluster Engine Qdevice
380 Group: System Environment
/Base
381 Requires: %{name} = %{version}-%{release}
382 # The automatic dependency overridden in favor of explicit version lock
383 Requires: corosynclib
%{?_isa} = %{version}-%{release}
387 Requires(post
): systemd
388 Requires(preun
): systemd
389 Requires(postun
): systemd
392 %description -n corosync
-qdevice
393 This package contains the Corosync Cluster Engine Qdevice
, script
for creating
394 NSS certificates and an init script.
396 %post -n corosync
-qdevice
397 %if %{with systemd} && 0%{?systemd_post:1}
398 %systemd_post corosync
-qdevice.service
400 if [ $
1 -eq
1 ]; then
401 /sbin
/chkconfig
--add corosync
-qdevice ||
:
405 %preun -n corosync
-qdevice
406 %if %{with systemd} && 0%{?systemd_preun:1}
407 %systemd_preun corosync
-qdevice.service
409 if [ $
1 -eq
0 ]; then
410 /sbin
/service corosync
-qdevice stop
&>/dev
/null ||
:
411 /sbin
/chkconfig
--del corosync
-qdevice ||
:
415 %postun -n corosync
-qdevice
416 %if %{with systemd} && 0%{?systemd_postun:1}
420 %files -n corosync
-qdevice
421 %defattr(-,root
,root
,-)
422 %dir %{_sysconfdir}/corosync
/qdevice
423 %dir %config(noreplace
) %{_sysconfdir}/corosync
/qdevice
/net
424 %dir %{_localstatedir}/run
/corosync
-qdevice
425 %{_sbindir}/corosync
-qdevice
426 %{_sbindir}/corosync
-qdevice
-net
-certutil
427 %{_sbindir}/corosync
-qdevice
-tool
428 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qdevice
430 %{_unitdir}/corosync
-qdevice.service
432 %{_initrddir}/corosync
-qdevice
434 %{_mandir}/man8
/corosync
-qdevice
-tool
.8*
435 %{_mandir}/man8
/corosync
-qdevice
-net
-certutil
.8*
436 %{_mandir}/man8
/corosync
-qdevice
.8*
443 %package -n corosync
-qnetd
444 Summary: The Corosync Cluster Engine Qdevice Network Daemon
445 Group: System Environment
/Base
447 Requires(pre
): shadow
-utils
450 Requires(post
): systemd
451 Requires(preun
): systemd
452 Requires(postun
): systemd
455 %description -n corosync
-qnetd
456 This package contains the Corosync Cluster Engine Qdevice Network Daemon
, script
for creating
457 NSS certificates and an init script.
459 %pre -n corosync
-qnetd
460 getent group coroqnetd
>/dev
/null || groupadd
-r coroqnetd
461 getent passwd coroqnetd
>/dev
/null || \
462 useradd
-r
-g coroqnetd
-d
/ -s
/sbin
/nologin
-c "User
for corosync
-qnetd" coroqnetd
465 %post -n corosync
-qnetd
466 %if %{with systemd} && 0%{?systemd_post:1}
467 %systemd_post corosync
-qnetd.service
469 if [ $
1 -eq
1 ]; then
470 /sbin
/chkconfig
--add corosync
-qnetd ||
:
474 %preun -n corosync
-qnetd
475 %if %{with systemd} && 0%{?systemd_preun:1}
476 %systemd_preun corosync
-qnetd.service
478 if [ $
1 -eq
0 ]; then
479 /sbin
/service corosync
-qnetd stop
&>/dev
/null ||
:
480 /sbin
/chkconfig
--del corosync
-qnetd ||
:
484 %postun -n corosync
-qnetd
485 %if %{with systemd} && 0%{?systemd_postun:1}
489 %files -n corosync
-qnetd
490 %defattr(-,root
,root
,-)
491 %dir %config(noreplace
) %attr(770, coroqnetd
, coroqnetd
) %{_sysconfdir}/corosync
/qnetd
492 %dir %attr(770, coroqnetd
, coroqnetd
) %{_localstatedir}/run
/corosync
-qnetd
493 %{_bindir}/corosync
-qnetd
494 %{_bindir}/corosync
-qnetd
-certutil
495 %{_bindir}/corosync
-qnetd
-tool
496 %config(noreplace
) %{_sysconfdir}/sysconfig
/corosync
-qnetd
498 %{_unitdir}/corosync
-qnetd.service
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