]>
Commit | Line | Data |
---|---|---|
ae96f61a FDN |
1 | @ALPHATAG@ |
2 | @NUMCOMM@ | |
3 | @DIRTY@ | |
85fb6472 AS |
4 | |
5 | # Conditionals | |
6 | # Invoke "rpmbuild --without <feature>" or "rpmbuild --with <feature>" | |
7 | # to disable or enable specific features | |
8 | %bcond_with testagents | |
07d06c0c AS |
9 | %bcond_with watchdog |
10 | %bcond_with monitoring | |
2a568d6e AS |
11 | %bcond_with snmp |
12 | %bcond_with dbus | |
051bca82 | 13 | %bcond_with rdma |
6fa114ac | 14 | %bcond_with systemd |
ca389c3c | 15 | %bcond_with upstart |
cdff97a0 | 16 | %bcond_with xmlconf |
5da3fe9f | 17 | %bcond_with runautogen |
85fb6472 | 18 | |
8f766dd7 FDN |
19 | %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}} |
20 | %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}} | |
21 | ||
b5fc4494 FDN |
22 | Name: corosync |
23 | Summary: The Corosync Cluster Engine and Application Programming Interfaces | |
24 | Version: @version@ | |
8f766dd7 | 25 | Release: 1%{?gitver}%{?dist} |
b5fc4494 FDN |
26 | License: BSD |
27 | Group: System Environment/Base | |
dc700219 JF |
28 | URL: http://www.corosync.org/ |
29 | Source0: https://github.com/downloads/corosync/corosync/%{name}-%{version}%{?gittarver}.tar.gz | |
b5fc4494 FDN |
30 | |
31 | # Runtime bits | |
32 | Requires: corosynclib = %{version}-%{release} | |
33 | Requires(pre): /usr/sbin/useradd | |
34 | Requires(post): /sbin/chkconfig | |
35 | Requires(preun): /sbin/chkconfig | |
36 | Conflicts: openais <= 0.89, openais-devel <= 0.89 | |
37 | ||
47b9e296 FDN |
38 | # Build bits |
39 | ||
e3ff3e2a | 40 | BuildRequires: groff |
c505993e | 41 | BuildRequires: libqb-devel |
8cdd2fc4 | 42 | BuildRequires: nss-devel |
5da3fe9f JF |
43 | %if %{with runautogen} |
44 | BuildRequires: autoconf automake libtool | |
8c3680d1 | 45 | %endif |
5c5db34e FDN |
46 | %if %{with monitoring} |
47 | BuildRequires: libstatgrab-devel | |
48 | %endif | |
17fb819a | 49 | %if %{with rdma} |
15f3bc84 | 50 | BuildRequires: libibverbs-devel librdmacm-devel |
17fb819a | 51 | %endif |
2a568d6e AS |
52 | %if %{with snmp} |
53 | BuildRequires: net-snmp-devel | |
54 | %endif | |
55 | %if %{with dbus} | |
56 | BuildRequires: dbus-devel | |
57 | %endif | |
6fa114ac AS |
58 | %if %{with systemd} |
59 | BuildRequires: systemd-units | |
61329a78 JF |
60 | Requires(post): systemd |
61 | Requires(preun): systemd | |
62 | Requires(postun): systemd | |
6fa114ac | 63 | %endif |
23b93ccb SD |
64 | %if %{with xmlconf} |
65 | Requires: libxslt | |
66 | %endif | |
b5fc4494 FDN |
67 | |
68 | BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) | |
69 | ||
70 | %prep | |
8f766dd7 | 71 | %setup -q -n %{name}-%{version}%{?gittarver} |
b5fc4494 | 72 | |
583eb6ae | 73 | %build |
5da3fe9f | 74 | %if %{with runautogen} |
b5fc4494 | 75 | ./autogen.sh |
8c3680d1 | 76 | %endif |
b5fc4494 | 77 | |
e715a455 | 78 | %if %{with rdma} |
15f3bc84 FDN |
79 | export ibverbs_CFLAGS=-I/usr/include/infiniband \ |
80 | export ibverbs_LIBS=-libverbs \ | |
81 | export rdmacm_CFLAGS=-I/usr/include/rdma \ | |
82 | export rdmacm_LIBS=-lrdmacm \ | |
e715a455 | 83 | %endif |
15f3bc84 | 84 | %{configure} \ |
85fb6472 | 85 | %if %{with testagents} |
45fc3a51 | 86 | --enable-testagents \ |
07d06c0c AS |
87 | %endif |
88 | %if %{with watchdog} | |
89 | --enable-watchdog \ | |
90 | %endif | |
91 | %if %{with monitoring} | |
92 | --enable-monitoring \ | |
2a568d6e AS |
93 | %endif |
94 | %if %{with snmp} | |
95 | --enable-snmp \ | |
96 | %endif | |
97 | %if %{with dbus} | |
98 | --enable-dbus \ | |
85fb6472 | 99 | %endif |
17fb819a | 100 | %if %{with rdma} |
dac5df7d | 101 | --enable-rdma \ |
6fa114ac AS |
102 | %endif |
103 | %if %{with systemd} | |
104 | --enable-systemd \ | |
61b2a85e | 105 | %endif |
ca389c3c KI |
106 | %if %{with upstart} |
107 | --enable-upstart \ | |
108 | %endif | |
61b2a85e JF |
109 | %if %{with xmlconf} |
110 | --enable-xmlconf \ | |
17fb819a | 111 | %endif |
769a69e4 | 112 | --with-initddir=%{_initrddir} \ |
ca389c3c KI |
113 | --with-systemddir=%{_unitdir} \ |
114 | --with-upstartdir=%{_sysconfdir}/init | |
b5fc4494 | 115 | |
b5fc4494 FDN |
116 | make %{_smp_mflags} |
117 | ||
118 | %install | |
119 | rm -rf %{buildroot} | |
120 | ||
121 | make install DESTDIR=%{buildroot} | |
b5fc4494 | 122 | |
2d75c705 JF |
123 | %if %{with dbus} |
124 | mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d | |
8f766dd7 | 125 | install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf |
2d75c705 JF |
126 | %endif |
127 | ||
b5fc4494 FDN |
128 | ## tree fixup |
129 | # drop static libs | |
130 | rm -f %{buildroot}%{_libdir}/*.a | |
2156ae60 | 131 | rm -f %{buildroot}%{_libdir}/*.la |
b5fc4494 FDN |
132 | # drop docs and html docs for now |
133 | rm -rf %{buildroot}%{_docdir}/* | |
03f05b58 JF |
134 | # /etc/sysconfig/corosync-notifyd |
135 | mkdir -p %{buildroot}%{_sysconfdir}/sysconfig | |
136 | install -m 644 tools/corosync-notifyd.sysconfig.example \ | |
137 | %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd | |
b5fc4494 FDN |
138 | |
139 | %clean | |
140 | rm -rf %{buildroot} | |
141 | ||
6aad39be | 142 | %description |
b5fc4494 FDN |
143 | This package contains the Corosync Cluster Engine Executive, several default |
144 | APIs and libraries, default configuration files, and an init script. | |
145 | ||
146 | %post | |
61329a78 JF |
147 | %if %{with systemd} && 0%{?systemd_post:1} |
148 | %systemd_post corosync.service | |
149 | %else | |
583eb6ae SD |
150 | if [ $1 -eq 1 ]; then |
151 | /sbin/chkconfig --add corosync || : | |
152 | fi | |
61329a78 | 153 | %endif |
b5fc4494 FDN |
154 | |
155 | %preun | |
61329a78 JF |
156 | %if %{with systemd} && 0%{?systemd_preun:1} |
157 | %systemd_preun corosync.service | |
158 | %else | |
b5fc4494 FDN |
159 | if [ $1 -eq 0 ]; then |
160 | /sbin/service corosync stop &>/dev/null || : | |
161 | /sbin/chkconfig --del corosync || : | |
162 | fi | |
61329a78 JF |
163 | %endif |
164 | ||
165 | %postun | |
166 | %if %{with systemd} && 0%{?systemd_postun:1} | |
167 | %systemd_postun | |
168 | %endif | |
b5fc4494 | 169 | |
6aad39be | 170 | %files |
b5fc4494 FDN |
171 | %defattr(-,root,root,-) |
172 | %doc LICENSE SECURITY | |
173 | %{_sbindir}/corosync | |
174 | %{_sbindir}/corosync-keygen | |
4f04735f | 175 | %{_sbindir}/corosync-cmapctl |
b5fc4494 | 176 | %{_sbindir}/corosync-cfgtool |
15f3bc84 FDN |
177 | %{_sbindir}/corosync-cpgtool |
178 | %{_sbindir}/corosync-quorumtool | |
2a568d6e | 179 | %{_sbindir}/corosync-notifyd |
45fc3a51 | 180 | %{_bindir}/corosync-blackbox |
4f04735f SD |
181 | %if %{with xmlconf} |
182 | %{_bindir}/corosync-xmlproc | |
ab9986cb FDN |
183 | %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example |
184 | %dir %{_datadir}/corosync | |
e5f2ecab | 185 | %{_datadir}/corosync/xml2conf.xsl |
ab9986cb FDN |
186 | %{_mandir}/man8/corosync-xmlproc.8* |
187 | %{_mandir}/man5/corosync.xml.5* | |
4f04735f | 188 | %endif |
b446d4e9 FDN |
189 | %dir %{_sysconfdir}/corosync |
190 | %dir %{_sysconfdir}/corosync/uidgid.d | |
191 | %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example | |
bb05aed9 | 192 | %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu |
03f05b58 | 193 | %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd |
2a568d6e AS |
194 | %if %{with dbus} |
195 | %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf | |
196 | %endif | |
197 | %if %{with snmp} | |
a197e7b1 | 198 | %{_datadir}/snmp/mibs/COROSYNC-MIB.txt |
2a568d6e | 199 | %endif |
6fa114ac AS |
200 | %if %{with systemd} |
201 | %{_unitdir}/corosync.service | |
202 | %{_unitdir}/corosync-notifyd.service | |
d7e205d1 FDN |
203 | %dir %{_datadir}/corosync |
204 | %{_datadir}/corosync/corosync | |
205 | %{_datadir}/corosync/corosync-notifyd | |
6fa114ac | 206 | %else |
6bae61d8 | 207 | %{_initrddir}/corosync |
2a568d6e | 208 | %{_initrddir}/corosync-notifyd |
6fa114ac | 209 | %endif |
ca389c3c KI |
210 | %if %{with upstart} |
211 | %{_sysconfdir}/init/corosync.conf | |
212 | %{_sysconfdir}/init/corosync-notifyd.conf | |
213 | %endif | |
b446d4e9 | 214 | %dir %{_localstatedir}/lib/corosync |
60f13c03 | 215 | %dir %{_localstatedir}/log/cluster |
b5fc4494 | 216 | %{_mandir}/man8/corosync_overview.8* |
824467e6 AS |
217 | %{_mandir}/man8/corosync.8* |
218 | %{_mandir}/man8/corosync-blackbox.8* | |
a516a1f9 | 219 | %{_mandir}/man8/corosync-cmapctl.8* |
52632075 | 220 | %{_mandir}/man8/corosync-keygen.8* |
de317d57 | 221 | %{_mandir}/man8/corosync-cfgtool.8* |
b7ed8064 | 222 | %{_mandir}/man8/corosync-cpgtool.8* |
2a568d6e | 223 | %{_mandir}/man8/corosync-notifyd.8* |
d655a79c | 224 | %{_mandir}/man8/corosync-quorumtool.8* |
b5fc4494 | 225 | %{_mandir}/man5/corosync.conf.5* |
284ca618 | 226 | %{_mandir}/man5/votequorum.5* |
de47f124 | 227 | %{_mandir}/man8/cmap_keys.8* |
b5fc4494 | 228 | |
85fb6472 AS |
229 | # optional testagent rpm |
230 | # | |
231 | %if %{with testagents} | |
232 | ||
233 | %package -n corosync-testagents | |
234 | Summary: The Corosync Cluster Engine Test Agents | |
235 | Group: Development/Libraries | |
236 | Requires: %{name} = %{version}-%{release} | |
237 | ||
238 | %description -n corosync-testagents | |
239 | This package contains corosync test agents. | |
240 | ||
241 | %files -n corosync-testagents | |
242 | %defattr(755,root,root,-) | |
243 | %{_datadir}/corosync/tests/mem_leak_test.sh | |
244 | %{_datadir}/corosync/tests/net_breaker.sh | |
2678f0a0 AS |
245 | %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh |
246 | %{_datadir}/corosync/tests/shm_leak_audit.sh | |
85fb6472 | 247 | %{_bindir}/cpg_test_agent |
1cdad310 AS |
248 | %{_bindir}/sam_test_agent |
249 | %{_bindir}/votequorum_test_agent | |
85fb6472 AS |
250 | |
251 | %endif | |
252 | ||
253 | # library | |
254 | # | |
b5fc4494 FDN |
255 | %package -n corosynclib |
256 | Summary: The Corosync Cluster Engine Libraries | |
257 | Group: System Environment/Libraries | |
47b9e296 | 258 | Requires: %{name} = %{version}-%{release} |
b5fc4494 FDN |
259 | |
260 | %description -n corosynclib | |
261 | This package contains corosync libraries. | |
262 | ||
263 | %files -n corosynclib | |
264 | %defattr(-,root,root,-) | |
265 | %doc LICENSE | |
266 | %{_libdir}/libcfg.so.* | |
267 | %{_libdir}/libcpg.so.* | |
7c250a51 | 268 | %{_libdir}/libcmap.so.* |
b5fc4494 | 269 | %{_libdir}/libtotem_pg.so.* |
b5fc4494 FDN |
270 | %{_libdir}/libquorum.so.* |
271 | %{_libdir}/libvotequorum.so.* | |
47ae82b0 | 272 | %{_libdir}/libsam.so.* |
40727bd6 | 273 | %{_libdir}/libcorosync_common.so.* |
b5fc4494 FDN |
274 | |
275 | %post -n corosynclib -p /sbin/ldconfig | |
276 | ||
277 | %postun -n corosynclib -p /sbin/ldconfig | |
278 | ||
279 | %package -n corosynclib-devel | |
280 | Summary: The Corosync Cluster Engine Development Kit | |
281 | Group: Development/Libraries | |
282 | Requires: corosynclib = %{version}-%{release} | |
283 | Requires: pkgconfig | |
284 | Provides: corosync-devel = %{version} | |
285 | Obsoletes: corosync-devel < 0.92-7 | |
286 | ||
287 | %description -n corosynclib-devel | |
288 | This package contains include files and man pages used to develop using | |
289 | The Corosync Cluster Engine APIs. | |
290 | ||
291 | %files -n corosynclib-devel | |
292 | %defattr(-,root,root,-) | |
bf3a0ad5 | 293 | %doc LICENSE |
b5fc4494 | 294 | %dir %{_includedir}/corosync/ |
b5fc4494 | 295 | %{_includedir}/corosync/corodefs.h |
b5fc4494 | 296 | %{_includedir}/corosync/cfg.h |
7c250a51 | 297 | %{_includedir}/corosync/cmap.h |
b5fc4494 FDN |
298 | %{_includedir}/corosync/corotypes.h |
299 | %{_includedir}/corosync/cpg.h | |
b5fc4494 | 300 | %{_includedir}/corosync/hdb.h |
47ae82b0 | 301 | %{_includedir}/corosync/sam.h |
b5fc4494 FDN |
302 | %{_includedir}/corosync/quorum.h |
303 | %{_includedir}/corosync/votequorum.h | |
304 | %dir %{_includedir}/corosync/totem/ | |
b5fc4494 FDN |
305 | %{_includedir}/corosync/totem/totem.h |
306 | %{_includedir}/corosync/totem/totemip.h | |
307 | %{_includedir}/corosync/totem/totempg.h | |
b5fc4494 FDN |
308 | %{_libdir}/libcfg.so |
309 | %{_libdir}/libcpg.so | |
7c250a51 | 310 | %{_libdir}/libcmap.so |
b5fc4494 | 311 | %{_libdir}/libtotem_pg.so |
b5fc4494 FDN |
312 | %{_libdir}/libquorum.so |
313 | %{_libdir}/libvotequorum.so | |
47ae82b0 | 314 | %{_libdir}/libsam.so |
40727bd6 | 315 | %{_libdir}/libcorosync_common.so |
b5fc4494 FDN |
316 | %{_libdir}/pkgconfig/*.pc |
317 | %{_mandir}/man3/cpg_*3* | |
601684d2 | 318 | %{_mandir}/man3/quorum_*3* |
b5fc4494 | 319 | %{_mandir}/man3/votequorum_*3* |
47ae82b0 | 320 | %{_mandir}/man3/sam_*3* |
b5fc4494 | 321 | %{_mandir}/man8/cpg_overview.8* |
b5fc4494 | 322 | %{_mandir}/man8/votequorum_overview.8* |
47ae82b0 | 323 | %{_mandir}/man8/sam_overview.8* |
c21f9573 JF |
324 | %{_mandir}/man3/cmap_*3* |
325 | %{_mandir}/man8/cmap_overview.8* | |
69cb3e69 | 326 | %{_mandir}/man8/quorum_overview.8* |
b5fc4494 FDN |
327 | |
328 | %changelog | |
b2400314 | 329 | * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@ |
b5fc4494 | 330 | - Autotools generated version |