]> git.proxmox.com Git - mirror_corosync.git/blob - corosync.spec.in
Spec: make internal dependencies arch-qualified
[mirror_corosync.git] / corosync.spec.in
1 @ALPHATAG@
2 @NUMCOMM@
3 @DIRTY@
4
5 # Conditionals
6 # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>"
7 # to disable or enable specific features
8 %bcond_with testagents
9 %bcond_with watchdog
10 %bcond_with monitoring
11 %bcond_with snmp
12 %bcond_with dbus
13 %bcond_with rdma
14 %bcond_with systemd
15 %bcond_with upstart
16 %bcond_with xmlconf
17 %bcond_with runautogen
18 %bcond_with qdevices
19 %bcond_with qnetd
20
21 %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
22 %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
23
24 Name: corosync
25 Summary: The Corosync Cluster Engine and Application Programming Interfaces
26 Version: @version@
27 Release: 1%{?gitver}%{?dist}
28 License: BSD
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
32
33 # Runtime bits
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
40
41 # Build bits
42
43 BuildRequires: groff
44 BuildRequires: libqb-devel
45 BuildRequires: nss-devel
46 BuildRequires: zlib-devel
47 %if %{with runautogen}
48 BuildRequires: autoconf automake libtool
49 %endif
50 %if %{with monitoring}
51 BuildRequires: libstatgrab-devel
52 %endif
53 %if %{with rdma}
54 BuildRequires: libibverbs-devel librdmacm-devel
55 %endif
56 %if %{with snmp}
57 BuildRequires: net-snmp-devel
58 %endif
59 %if %{with dbus}
60 BuildRequires: dbus-devel
61 %endif
62 %if %{with systemd}
63 BuildRequires: systemd-units
64 Requires(post): systemd
65 Requires(preun): systemd
66 Requires(postun): systemd
67 %endif
68 %if %{with xmlconf}
69 Requires: libxslt
70 %endif
71 %if %{with qdevices} || %{with qnetd}
72 Requires: nss-tools
73 %endif
74 %if %{with qnetd}
75 BuildRequires: sed
76 %endif
77
78 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
79
80 %prep
81 %setup -q -n %{name}-%{version}%{?gittarver}
82
83 %build
84 %if %{with runautogen}
85 ./autogen.sh
86 %endif
87
88 %if %{with rdma}
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 \
93 %endif
94 %{configure} \
95 %if %{with testagents}
96 --enable-testagents \
97 %endif
98 %if %{with watchdog}
99 --enable-watchdog \
100 %endif
101 %if %{with monitoring}
102 --enable-monitoring \
103 %endif
104 %if %{with snmp}
105 --enable-snmp \
106 %endif
107 %if %{with dbus}
108 --enable-dbus \
109 %endif
110 %if %{with rdma}
111 --enable-rdma \
112 %endif
113 %if %{with systemd}
114 --enable-systemd \
115 %endif
116 %if %{with upstart}
117 --enable-upstart \
118 %endif
119 %if %{with xmlconf}
120 --enable-xmlconf \
121 %endif
122 %if %{with qdevices}
123 --enable-qdevices \
124 %endif
125 %if %{with qnetd}
126 --enable-qnetd \
127 %endif
128 --with-initddir=%{_initrddir} \
129 --with-systemddir=%{_unitdir} \
130 --with-upstartdir=%{_sysconfdir}/init \
131 --with-tmpfilesdir=%{_tmpfilesdir}
132
133 make %{_smp_mflags}
134
135 %install
136 rm -rf %{buildroot}
137
138 make install DESTDIR=%{buildroot}
139
140 %if %{with dbus}
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
143 %endif
144
145 ## tree fixup
146 # drop static libs
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
158
159 %if %{with qdevices}
160 # /etc/sysconfig/corosync-qdevice
161 install -m 644 init/corosync-qdevice.sysconfig.example \
162 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qdevice
163 %endif
164
165 %if %{with qnetd}
166 # /etc/sysconfig/corosync-qnetd
167 install -m 644 init/corosync-qnetd.sysconfig.example \
168 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
169 %if %{with systemd}
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
174 %else
175 sed -i -e 's/^COROSYNC_QNETD_RUNAS=""$/COROSYNC_QNETD_RUNAS="coroqnetd"/' \
176 %{buildroot}%{_sysconfdir}/sysconfig/corosync-qnetd
177 %endif
178 %endif
179
180 %clean
181 rm -rf %{buildroot}
182
183 %description
184 This package contains the Corosync Cluster Engine Executive, several default
185 APIs and libraries, default configuration files, and an init script.
186
187 %post
188 %if %{with systemd} && 0%{?systemd_post:1}
189 %systemd_post corosync.service
190 %else
191 if [ $1 -eq 1 ]; then
192 /sbin/chkconfig --add corosync || :
193 fi
194 %endif
195
196 %preun
197 %if %{with systemd} && 0%{?systemd_preun:1}
198 %systemd_preun corosync.service
199 %else
200 if [ $1 -eq 0 ]; then
201 /sbin/service corosync stop &>/dev/null || :
202 /sbin/chkconfig --del corosync || :
203 fi
204 %endif
205
206 %postun
207 %if %{with systemd} && 0%{?systemd_postun:1}
208 %systemd_postun
209 %endif
210
211 %files
212 %defattr(-,root,root,-)
213 %doc LICENSE SECURITY
214 %{_sbindir}/corosync
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
222 %if %{with xmlconf}
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*
229 %endif
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
237 %if %{with dbus}
238 %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
239 %endif
240 %if %{with snmp}
241 %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
242 %endif
243 %if %{with systemd}
244 %{_unitdir}/corosync.service
245 %{_unitdir}/corosync-notifyd.service
246 %dir %{_datadir}/corosync
247 %{_datadir}/corosync/corosync
248 %{_datadir}/corosync/corosync-notifyd
249 %else
250 %{_initrddir}/corosync
251 %{_initrddir}/corosync-notifyd
252 %endif
253 %if %{with upstart}
254 %{_sysconfdir}/init/corosync.conf
255 %{_sysconfdir}/init/corosync-notifyd.conf
256 %endif
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*
271
272 # optional testagent rpm
273 #
274 %if %{with testagents}
275
276 %package -n corosync-testagents
277 Summary: The Corosync Cluster Engine Test Agents
278 Group: Development/Libraries
279 Requires: %{name} = %{version}-%{release}
280
281 %description -n corosync-testagents
282 This package contains corosync test agents.
283
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
293
294 %endif
295
296 # library
297 #
298 %package -n corosynclib
299 Summary: The Corosync Cluster Engine Libraries
300 Group: System Environment/Libraries
301
302 %description -n corosynclib
303 This package contains corosync libraries.
304
305 %files -n corosynclib
306 %defattr(-,root,root,-)
307 %doc LICENSE
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.*
316
317 %post -n corosynclib -p /sbin/ldconfig
318
319 %postun -n corosynclib -p /sbin/ldconfig
320
321 %package -n corosynclib-devel
322 Summary: The Corosync Cluster Engine Development Kit
323 Group: Development/Libraries
324 Requires: corosynclib%{?_isa} = %{version}-%{release}
325 Requires: pkgconfig
326 Provides: corosync-devel = %{version}
327 Obsoletes: corosync-devel < 0.92-7
328
329 %description -n corosynclib-devel
330 This package contains include files and man pages used to develop using
331 The Corosync Cluster Engine APIs.
332
333 %files -n corosynclib-devel
334 %defattr(-,root,root,-)
335 %doc LICENSE
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
350 %{_libdir}/libcfg.so
351 %{_libdir}/libcpg.so
352 %{_libdir}/libcmap.so
353 %{_libdir}/libtotem_pg.so
354 %{_libdir}/libquorum.so
355 %{_libdir}/libvotequorum.so
356 %{_libdir}/libsam.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*
369
370 # optional qdevices
371 #
372 %if %{with qdevices}
373
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}
380 Requires: nss-tools
381
382 %if %{with systemd}
383 Requires(post): systemd
384 Requires(preun): systemd
385 Requires(postun): systemd
386 %endif
387
388 %description -n corosync-qdevice
389 This package contains the Corosync Cluster Engine Qdevice, script for creating
390 NSS certificates and an init script.
391
392 %post -n corosync-qdevice
393 %if %{with systemd} && 0%{?systemd_post:1}
394 %systemd_post corosync-qdevice.service
395 %else
396 if [ $1 -eq 1 ]; then
397 /sbin/chkconfig --add corosync-qdevice || :
398 fi
399 %endif
400
401 %preun -n corosync-qdevice
402 %if %{with systemd} && 0%{?systemd_preun:1}
403 %systemd_preun corosync-qdevice.service
404 %else
405 if [ $1 -eq 0 ]; then
406 /sbin/service corosync-qdevice stop &>/dev/null || :
407 /sbin/chkconfig --del corosync-qdevice || :
408 fi
409 %endif
410
411 %postun -n corosync-qdevice
412 %if %{with systemd} && 0%{?systemd_postun:1}
413 %systemd_postun
414 %endif
415
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
425 %if %{with systemd}
426 %{_unitdir}/corosync-qdevice.service
427 %dir %{_datadir}/corosync
428 %{_datadir}/corosync/corosync-qdevice
429 %else
430 %{_initrddir}/corosync-qdevice
431 %endif
432 %{_mandir}/man8/corosync-qdevice-tool.8*
433 %{_mandir}/man8/corosync-qdevice-net-certutil.8*
434 %{_mandir}/man8/corosync-qdevice.8*
435 %endif
436
437 # optional qnetd
438 #
439 %if %{with qnetd}
440
441 %package -n corosync-qnetd
442 Summary: The Corosync Cluster Engine Qdevice Network Daemon
443 Group: System Environment/Base
444 Requires: nss-tools
445 Requires(pre): shadow-utils
446
447 %if %{with systemd}
448 Requires(post): systemd
449 Requires(preun): systemd
450 Requires(postun): systemd
451 %endif
452
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.
456
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
461 exit 0
462
463 %post -n corosync-qnetd
464 %if %{with systemd} && 0%{?systemd_post:1}
465 %systemd_post corosync-qnetd.service
466 %else
467 if [ $1 -eq 1 ]; then
468 /sbin/chkconfig --add corosync-qnetd || :
469 fi
470 %endif
471
472 %preun -n corosync-qnetd
473 %if %{with systemd} && 0%{?systemd_preun:1}
474 %systemd_preun corosync-qnetd.service
475 %else
476 if [ $1 -eq 0 ]; then
477 /sbin/service corosync-qnetd stop &>/dev/null || :
478 /sbin/chkconfig --del corosync-qnetd || :
479 fi
480 %endif
481
482 %postun -n corosync-qnetd
483 %if %{with systemd} && 0%{?systemd_postun:1}
484 %systemd_postun
485 %endif
486
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
495 %if %{with systemd}
496 %{_unitdir}/corosync-qnetd.service
497 %dir %{_datadir}/corosync
498 %{_datadir}/corosync/corosync-qnetd
499 %{_tmpfilesdir}/corosync-qnetd.conf
500 %else
501 %{_initrddir}/corosync-qnetd
502 %endif
503 %{_mandir}/man8/corosync-qnetd-tool.8*
504 %{_mandir}/man8/corosync-qnetd-certutil.8*
505 %{_mandir}/man8/corosync-qnetd.8*
506 %endif
507
508 %changelog
509 * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
510 - Autotools generated version