]> git.proxmox.com Git - mirror_corosync.git/blob - corosync.spec.in
Add qdevice into spec file
[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
20 %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
21 %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
22
23 Name: corosync
24 Summary: The Corosync Cluster Engine and Application Programming Interfaces
25 Version: @version@
26 Release: 1%{?gitver}%{?dist}
27 License: BSD
28 Group: System Environment/Base
29 URL: http://corosync.github.io/corosync/
30 Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
31
32 # Runtime bits
33 Requires: corosynclib = %{version}-%{release}
34 Requires(pre): /usr/sbin/useradd
35 Requires(post): /sbin/chkconfig
36 Requires(preun): /sbin/chkconfig
37 Conflicts: openais <= 0.89, openais-devel <= 0.89
38
39 # Build bits
40
41 BuildRequires: groff
42 BuildRequires: libqb-devel
43 BuildRequires: nss-devel
44 BuildRequires: zlib-devel
45 %if %{with runautogen}
46 BuildRequires: autoconf automake libtool
47 %endif
48 %if %{with monitoring}
49 BuildRequires: libstatgrab-devel
50 %endif
51 %if %{with rdma}
52 BuildRequires: libibverbs-devel librdmacm-devel
53 %endif
54 %if %{with snmp}
55 BuildRequires: net-snmp-devel
56 %endif
57 %if %{with dbus}
58 BuildRequires: dbus-devel
59 %endif
60 %if %{with systemd}
61 BuildRequires: systemd-units
62 Requires(post): systemd
63 Requires(preun): systemd
64 Requires(postun): systemd
65 %endif
66 %if %{with xmlconf}
67 Requires: libxslt
68 %endif
69 %if %{with qdevices}
70 Requires: nss-tools
71 %endif
72
73 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
74
75 %prep
76 %setup -q -n %{name}-%{version}%{?gittarver}
77
78 %build
79 %if %{with runautogen}
80 ./autogen.sh
81 %endif
82
83 %if %{with rdma}
84 export ibverbs_CFLAGS=-I/usr/include/infiniband \
85 export ibverbs_LIBS=-libverbs \
86 export rdmacm_CFLAGS=-I/usr/include/rdma \
87 export rdmacm_LIBS=-lrdmacm \
88 %endif
89 %{configure} \
90 %if %{with testagents}
91 --enable-testagents \
92 %endif
93 %if %{with watchdog}
94 --enable-watchdog \
95 %endif
96 %if %{with monitoring}
97 --enable-monitoring \
98 %endif
99 %if %{with snmp}
100 --enable-snmp \
101 %endif
102 %if %{with dbus}
103 --enable-dbus \
104 %endif
105 %if %{with rdma}
106 --enable-rdma \
107 %endif
108 %if %{with systemd}
109 --enable-systemd \
110 %endif
111 %if %{with upstart}
112 --enable-upstart \
113 %endif
114 %if %{with xmlconf}
115 --enable-xmlconf \
116 %endif
117 %if %{with qdevices}
118 --enable-qdevices \
119 %endif
120 --with-initddir=%{_initrddir} \
121 --with-systemddir=%{_unitdir} \
122 --with-upstartdir=%{_sysconfdir}/init
123
124 make %{_smp_mflags}
125
126 %install
127 rm -rf %{buildroot}
128
129 make install DESTDIR=%{buildroot}
130
131 %if %{with dbus}
132 mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
133 install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
134 %endif
135
136 ## tree fixup
137 # drop static libs
138 rm -f %{buildroot}%{_libdir}/*.a
139 rm -f %{buildroot}%{_libdir}/*.la
140 # drop docs and html docs for now
141 rm -rf %{buildroot}%{_docdir}/*
142 # /etc/sysconfig/corosync-notifyd
143 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
144 install -m 644 tools/corosync-notifyd.sysconfig.example \
145 %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
146 # /etc/sysconfig/corosync
147 install -m 644 init/corosync.sysconfig.example \
148 %{buildroot}%{_sysconfdir}/sysconfig/corosync
149
150 %clean
151 rm -rf %{buildroot}
152
153 %description
154 This package contains the Corosync Cluster Engine Executive, several default
155 APIs and libraries, default configuration files, and an init script.
156
157 %post
158 %if %{with systemd} && 0%{?systemd_post:1}
159 %systemd_post corosync.service
160 %else
161 if [ $1 -eq 1 ]; then
162 /sbin/chkconfig --add corosync || :
163 fi
164 %endif
165
166 %preun
167 %if %{with systemd} && 0%{?systemd_preun:1}
168 %systemd_preun corosync.service
169 %else
170 if [ $1 -eq 0 ]; then
171 /sbin/service corosync stop &>/dev/null || :
172 /sbin/chkconfig --del corosync || :
173 fi
174 %endif
175
176 %postun
177 %if %{with systemd} && 0%{?systemd_postun:1}
178 %systemd_postun
179 %endif
180
181 %files
182 %defattr(-,root,root,-)
183 %doc LICENSE SECURITY
184 %{_sbindir}/corosync
185 %{_sbindir}/corosync-keygen
186 %{_sbindir}/corosync-cmapctl
187 %{_sbindir}/corosync-cfgtool
188 %{_sbindir}/corosync-cpgtool
189 %{_sbindir}/corosync-quorumtool
190 %{_sbindir}/corosync-notifyd
191 %{_bindir}/corosync-blackbox
192 %if %{with xmlconf}
193 %{_bindir}/corosync-xmlproc
194 %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
195 %dir %{_datadir}/corosync
196 %{_datadir}/corosync/xml2conf.xsl
197 %{_mandir}/man8/corosync-xmlproc.8*
198 %{_mandir}/man5/corosync.xml.5*
199 %endif
200 %dir %{_sysconfdir}/corosync
201 %dir %{_sysconfdir}/corosync/uidgid.d
202 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
203 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
204 %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
205 %config(noreplace) %{_sysconfdir}/sysconfig/corosync
206 %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
207 %if %{with dbus}
208 %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
209 %endif
210 %if %{with snmp}
211 %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
212 %endif
213 %if %{with systemd}
214 %{_unitdir}/corosync.service
215 %{_unitdir}/corosync-notifyd.service
216 %dir %{_datadir}/corosync
217 %{_datadir}/corosync/corosync
218 %{_datadir}/corosync/corosync-notifyd
219 %else
220 %{_initrddir}/corosync
221 %{_initrddir}/corosync-notifyd
222 %endif
223 %if %{with upstart}
224 %{_sysconfdir}/init/corosync.conf
225 %{_sysconfdir}/init/corosync-notifyd.conf
226 %endif
227 %dir %{_localstatedir}/lib/corosync
228 %dir %{_localstatedir}/log/cluster
229 %{_mandir}/man8/corosync_overview.8*
230 %{_mandir}/man8/corosync.8*
231 %{_mandir}/man8/corosync-blackbox.8*
232 %{_mandir}/man8/corosync-cmapctl.8*
233 %{_mandir}/man8/corosync-keygen.8*
234 %{_mandir}/man8/corosync-cfgtool.8*
235 %{_mandir}/man8/corosync-cpgtool.8*
236 %{_mandir}/man8/corosync-notifyd.8*
237 %{_mandir}/man8/corosync-quorumtool.8*
238 %{_mandir}/man5/corosync.conf.5*
239 %{_mandir}/man5/votequorum.5*
240 %{_mandir}/man8/cmap_keys.8*
241
242 # optional testagent rpm
243 #
244 %if %{with testagents}
245
246 %package -n corosync-testagents
247 Summary: The Corosync Cluster Engine Test Agents
248 Group: Development/Libraries
249 Requires: %{name} = %{version}-%{release}
250
251 %description -n corosync-testagents
252 This package contains corosync test agents.
253
254 %files -n corosync-testagents
255 %defattr(755,root,root,-)
256 %{_datadir}/corosync/tests/mem_leak_test.sh
257 %{_datadir}/corosync/tests/net_breaker.sh
258 %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
259 %{_datadir}/corosync/tests/shm_leak_audit.sh
260 %{_bindir}/cpg_test_agent
261 %{_bindir}/sam_test_agent
262 %{_bindir}/votequorum_test_agent
263
264 %endif
265
266 # library
267 #
268 %package -n corosynclib
269 Summary: The Corosync Cluster Engine Libraries
270 Group: System Environment/Libraries
271 Requires: %{name} = %{version}-%{release}
272
273 %description -n corosynclib
274 This package contains corosync libraries.
275
276 %files -n corosynclib
277 %defattr(-,root,root,-)
278 %doc LICENSE
279 %{_libdir}/libcfg.so.*
280 %{_libdir}/libcpg.so.*
281 %{_libdir}/libcmap.so.*
282 %{_libdir}/libtotem_pg.so.*
283 %{_libdir}/libquorum.so.*
284 %{_libdir}/libvotequorum.so.*
285 %{_libdir}/libsam.so.*
286 %{_libdir}/libcorosync_common.so.*
287
288 %post -n corosynclib -p /sbin/ldconfig
289
290 %postun -n corosynclib -p /sbin/ldconfig
291
292 %package -n corosynclib-devel
293 Summary: The Corosync Cluster Engine Development Kit
294 Group: Development/Libraries
295 Requires: corosynclib = %{version}-%{release}
296 Requires: pkgconfig
297 Provides: corosync-devel = %{version}
298 Obsoletes: corosync-devel < 0.92-7
299
300 %description -n corosynclib-devel
301 This package contains include files and man pages used to develop using
302 The Corosync Cluster Engine APIs.
303
304 %files -n corosynclib-devel
305 %defattr(-,root,root,-)
306 %doc LICENSE
307 %dir %{_includedir}/corosync/
308 %{_includedir}/corosync/corodefs.h
309 %{_includedir}/corosync/cfg.h
310 %{_includedir}/corosync/cmap.h
311 %{_includedir}/corosync/corotypes.h
312 %{_includedir}/corosync/cpg.h
313 %{_includedir}/corosync/hdb.h
314 %{_includedir}/corosync/sam.h
315 %{_includedir}/corosync/quorum.h
316 %{_includedir}/corosync/votequorum.h
317 %dir %{_includedir}/corosync/totem/
318 %{_includedir}/corosync/totem/totem.h
319 %{_includedir}/corosync/totem/totemip.h
320 %{_includedir}/corosync/totem/totempg.h
321 %{_libdir}/libcfg.so
322 %{_libdir}/libcpg.so
323 %{_libdir}/libcmap.so
324 %{_libdir}/libtotem_pg.so
325 %{_libdir}/libquorum.so
326 %{_libdir}/libvotequorum.so
327 %{_libdir}/libsam.so
328 %{_libdir}/libcorosync_common.so
329 %{_libdir}/pkgconfig/*.pc
330 %{_mandir}/man3/cpg_*3*
331 %{_mandir}/man3/quorum_*3*
332 %{_mandir}/man3/votequorum_*3*
333 %{_mandir}/man3/sam_*3*
334 %{_mandir}/man8/cpg_overview.8*
335 %{_mandir}/man8/votequorum_overview.8*
336 %{_mandir}/man8/sam_overview.8*
337 %{_mandir}/man3/cmap_*3*
338 %{_mandir}/man8/cmap_overview.8*
339 %{_mandir}/man8/quorum_overview.8*
340
341 # optional qdevices
342 #
343 %if %{with qdevices}
344
345 %package -n corosync-qdevice
346 Summary: The Corosync Cluster Engine Qdevice
347 Group: System Environment/Base
348 Requires: corosync
349 Requires: nss-tools
350
351 %if %{with systemd}
352 Requires(post): systemd
353 Requires(preun): systemd
354 Requires(postun): systemd
355 %endif
356
357 %description -n corosync-qdevice
358 This package contains the Corosync Cluster Engine Qdevice, script for creating
359 NSS certificates and an init script.
360
361 %post -n corosync-qdevice
362 %if %{with systemd} && 0%{?systemd_post:1}
363 %systemd_post corosync-qdevice.service
364 %else
365 if [ $1 -eq 1 ]; then
366 /sbin/chkconfig --add corosync-qdevice || :
367 fi
368 %endif
369
370 %preun -n corosync-qdevice
371 %if %{with systemd} && 0%{?systemd_preun:1}
372 %systemd_preun corosync-qdevice.service
373 %else
374 if [ $1 -eq 0 ]; then
375 /sbin/service corosync-qdevice stop &>/dev/null || :
376 /sbin/chkconfig --del corosync-qdevice || :
377 fi
378 %endif
379
380 %postun -n corosync-qdevice
381 %if %{with systemd} && 0%{?systemd_postun:1}
382 %systemd_postun
383 %endif
384
385 %files -n corosync-qdevice
386 %defattr(-,root,root,-)
387 %{_sbindir}/corosync-qdevice
388 %{_sbindir}/corosync-qdevice-net-certutil
389 %if %{with systemd}
390 %{_unitdir}/corosync-qdevice.service
391 %dir %{_datadir}/corosync
392 %{_datadir}/corosync/corosync-qdevice
393 %else
394 %{_initrddir}/corosync-qdevice
395 %endif
396
397 %package -n corosync-qnetd
398 Summary: The Corosync Cluster Engine Qdevice Network Daemon
399 Group: System Environment/Base
400 Requires: nss-tools
401
402 %if %{with systemd}
403 Requires(post): systemd
404 Requires(preun): systemd
405 Requires(postun): systemd
406 %endif
407
408 %description -n corosync-qnetd
409 This package contains the Corosync Cluster Engine Qdevice Network Daemon, script for creating
410 NSS certificates and an init script.
411
412 %post -n corosync-qnetd
413 %if %{with systemd} && 0%{?systemd_post:1}
414 %systemd_post corosync-qnetd.service
415 %else
416 if [ $1 -eq 1 ]; then
417 /sbin/chkconfig --add corosync-qnetd || :
418 fi
419 %endif
420
421 %preun -n corosync-qnetd
422 %if %{with systemd} && 0%{?systemd_preun:1}
423 %systemd_preun corosync-qnetd.service
424 %else
425 if [ $1 -eq 0 ]; then
426 /sbin/service corosync-qnetd stop &>/dev/null || :
427 /sbin/chkconfig --del corosync-qnetd || :
428 fi
429 %endif
430
431 %postun -n corosync-qnetd
432 %if %{with systemd} && 0%{?systemd_postun:1}
433 %systemd_postun
434 %endif
435
436 %files -n corosync-qnetd
437 %defattr(-,root,root,-)
438 %{_sbindir}/corosync-qnetd
439 %{_sbindir}/corosync-qnetd-certutil
440 %if %{with systemd}
441 %{_unitdir}/corosync-qnetd.service
442 %dir %{_datadir}/corosync
443 %{_datadir}/corosync/corosync-qnetd
444 %else
445 %{_initrddir}/corosync-qnetd
446 %endif
447
448 %endif
449
450 %changelog
451 * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
452 - Autotools generated version