]> git.proxmox.com Git - mirror_corosync.git/blob - corosync.spec.in
build: make libstatgrab the facto default for monitoring service
[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 xmlconf
16
17 %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
18 %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
19
20 Name: corosync
21 Summary: The Corosync Cluster Engine and Application Programming Interfaces
22 Version: @version@
23 Release: 1%{?gitver}%{?dist}
24 License: BSD
25 Group: System Environment/Base
26 URL: http://ftp.corosync.org
27 Source0: ftp://ftp:user@ftp.corosync.org/downloads/%{name}-%{version}/%{name}-%{version}%{?gittarver}.tar.gz
28
29 # Runtime bits
30 Requires: corosynclib = %{version}-%{release}
31 Requires(pre): /usr/sbin/useradd
32 Requires(post): /sbin/chkconfig
33 Requires(preun): /sbin/chkconfig
34 Conflicts: openais <= 0.89, openais-devel <= 0.89
35
36 # Build bits
37
38 %define buildtrunk 0
39 %{?_with_buildtrunk: %define buildtrunk 1}
40
41 BuildRequires: groff
42 BuildRequires: libqb-devel
43 BuildRequires: nss-devel
44 %if %{buildtrunk}
45 BuildRequires: autoconf automake
46 %endif
47 %if %{with monitoring}
48 BuildRequires: libstatgrab-devel
49 %endif
50 %if %{with rdma}
51 BuildRequires: libibverbs-devel librdmacm-devel
52 %endif
53 %if %{with snmp}
54 BuildRequires: net-snmp-devel
55 %endif
56 %if %{with dbus}
57 BuildRequires: dbus-devel
58 %endif
59 %if %{with systemd}
60 BuildRequires: systemd-units
61 %endif
62 %if %{with xmlconf}
63 Requires: libxslt
64 %endif
65
66 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
67
68 %prep
69 %setup -q -n %{name}-%{version}%{?gittarver}
70
71 %build
72 %if %{buildtrunk}
73 ./autogen.sh
74 %endif
75
76 %if %{with rdma}
77 export ibverbs_CFLAGS=-I/usr/include/infiniband \
78 export ibverbs_LIBS=-libverbs \
79 export rdmacm_CFLAGS=-I/usr/include/rdma \
80 export rdmacm_LIBS=-lrdmacm \
81 %endif
82 %{configure} \
83 %if %{with testagents}
84 --enable-testagents \
85 %endif
86 %if %{with watchdog}
87 --enable-watchdog \
88 %endif
89 %if %{with monitoring}
90 --enable-monitoring \
91 %endif
92 %if %{with snmp}
93 --enable-snmp \
94 %endif
95 %if %{with dbus}
96 --enable-dbus \
97 %endif
98 %if %{with rdma}
99 --enable-rdma \
100 %endif
101 %if %{with systemd}
102 --enable-systemd \
103 %endif
104 %if %{with xmlconf}
105 --enable-xmlconf \
106 %endif
107 --with-initddir=%{_initrddir} \
108 --with-systemddir=%{_unitdir}
109
110 make %{_smp_mflags}
111
112 %install
113 rm -rf %{buildroot}
114
115 make install DESTDIR=%{buildroot}
116
117 %if %{with dbus}
118 mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
119 install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
120 %endif
121
122 ## tree fixup
123 # drop static libs
124 rm -f %{buildroot}%{_libdir}/*.a
125 rm -f %{buildroot}%{_libdir}/*.la
126 # drop docs and html docs for now
127 rm -rf %{buildroot}%{_docdir}/*
128
129 %clean
130 rm -rf %{buildroot}
131
132 %description
133 This package contains the Corosync Cluster Engine Executive, several default
134 APIs and libraries, default configuration files, and an init script.
135
136 %post
137 if [ $1 -eq 1 ]; then
138 /sbin/chkconfig --add corosync || :
139 fi
140
141 %preun
142 if [ $1 -eq 0 ]; then
143 /sbin/service corosync stop &>/dev/null || :
144 /sbin/chkconfig --del corosync || :
145 fi
146
147 %files
148 %defattr(-,root,root,-)
149 %doc LICENSE SECURITY
150 %{_sbindir}/corosync
151 %{_sbindir}/corosync-keygen
152 %{_sbindir}/corosync-cmapctl
153 %{_sbindir}/corosync-cfgtool
154 %{_sbindir}/corosync-cpgtool
155 %{_sbindir}/corosync-quorumtool
156 %{_sbindir}/corosync-notifyd
157 %{_bindir}/corosync-blackbox
158 %if %{with xmlconf}
159 %{_bindir}/corosync-xmlproc
160 %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
161 %dir %{_datadir}/corosync
162 %dir %{_datadir}/corosync/xml2conf.xsl
163 %{_mandir}/man8/corosync-xmlproc.8*
164 %{_mandir}/man5/corosync.xml.5*
165 %endif
166 %dir %{_sysconfdir}/corosync
167 %dir %{_sysconfdir}/corosync/uidgid.d
168 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
169 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
170 %if %{with dbus}
171 %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
172 %endif
173 %if %{with snmp}
174 %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
175 %endif
176 %if %{with systemd}
177 %{_unitdir}/corosync.service
178 %{_unitdir}/corosync-notifyd.service
179 %dir %{_datadir}/corosync
180 %{_datadir}/corosync/corosync
181 %{_datadir}/corosync/corosync-notifyd
182 %else
183 %{_initrddir}/corosync
184 %{_initrddir}/corosync-notifyd
185 %endif
186 %dir %{_localstatedir}/lib/corosync
187 %dir %{_localstatedir}/log/cluster
188 %{_mandir}/man8/corosync_overview.8*
189 %{_mandir}/man8/corosync.8*
190 %{_mandir}/man8/corosync-blackbox.8*
191 %{_mandir}/man8/corosync-cmapctl.8*
192 %{_mandir}/man8/corosync-keygen.8*
193 %{_mandir}/man8/corosync-cfgtool.8*
194 %{_mandir}/man8/corosync-cpgtool.8*
195 %{_mandir}/man8/corosync-notifyd.8*
196 %{_mandir}/man8/corosync-quorumtool.8*
197 %{_mandir}/man5/corosync.conf.5*
198 %{_mandir}/man5/votequorum.5*
199 %{_mandir}/man8/cmap_keys.8*
200
201 # optional testagent rpm
202 #
203 %if %{with testagents}
204
205 %package -n corosync-testagents
206 Summary: The Corosync Cluster Engine Test Agents
207 Group: Development/Libraries
208 Requires: %{name} = %{version}-%{release}
209
210 %description -n corosync-testagents
211 This package contains corosync test agents.
212
213 %files -n corosync-testagents
214 %defattr(755,root,root,-)
215 %{_datadir}/corosync/tests/mem_leak_test.sh
216 %{_datadir}/corosync/tests/net_breaker.sh
217 %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
218 %{_datadir}/corosync/tests/shm_leak_audit.sh
219 %{_bindir}/cpg_test_agent
220 %{_bindir}/sam_test_agent
221 %{_bindir}/votequorum_test_agent
222
223 %endif
224
225 # library
226 #
227 %package -n corosynclib
228 Summary: The Corosync Cluster Engine Libraries
229 Group: System Environment/Libraries
230 Requires: %{name} = %{version}-%{release}
231
232 %description -n corosynclib
233 This package contains corosync libraries.
234
235 %files -n corosynclib
236 %defattr(-,root,root,-)
237 %doc LICENSE
238 %{_libdir}/libcfg.so.*
239 %{_libdir}/libcpg.so.*
240 %{_libdir}/libcmap.so.*
241 %{_libdir}/libtotem_pg.so.*
242 %{_libdir}/libquorum.so.*
243 %{_libdir}/libvotequorum.so.*
244 %{_libdir}/libsam.so.*
245 %{_libdir}/libcorosync_common.so.*
246
247 %post -n corosynclib -p /sbin/ldconfig
248
249 %postun -n corosynclib -p /sbin/ldconfig
250
251 %package -n corosynclib-devel
252 Summary: The Corosync Cluster Engine Development Kit
253 Group: Development/Libraries
254 Requires: corosynclib = %{version}-%{release}
255 Requires: pkgconfig
256 Provides: corosync-devel = %{version}
257 Obsoletes: corosync-devel < 0.92-7
258
259 %description -n corosynclib-devel
260 This package contains include files and man pages used to develop using
261 The Corosync Cluster Engine APIs.
262
263 %files -n corosynclib-devel
264 %defattr(-,root,root,-)
265 %doc LICENSE
266 %dir %{_includedir}/corosync/
267 %{_includedir}/corosync/corodefs.h
268 %{_includedir}/corosync/cfg.h
269 %{_includedir}/corosync/cmap.h
270 %{_includedir}/corosync/corotypes.h
271 %{_includedir}/corosync/cpg.h
272 %{_includedir}/corosync/hdb.h
273 %{_includedir}/corosync/sam.h
274 %{_includedir}/corosync/quorum.h
275 %{_includedir}/corosync/votequorum.h
276 %dir %{_includedir}/corosync/totem/
277 %{_includedir}/corosync/totem/totem.h
278 %{_includedir}/corosync/totem/totemip.h
279 %{_includedir}/corosync/totem/totempg.h
280 %{_libdir}/libcfg.so
281 %{_libdir}/libcpg.so
282 %{_libdir}/libcmap.so
283 %{_libdir}/libtotem_pg.so
284 %{_libdir}/libquorum.so
285 %{_libdir}/libvotequorum.so
286 %{_libdir}/libsam.so
287 %{_libdir}/libcorosync_common.so
288 %{_libdir}/pkgconfig/*.pc
289 %{_mandir}/man3/cpg_*3*
290 %{_mandir}/man3/quorum_*3*
291 %{_mandir}/man3/votequorum_*3*
292 %{_mandir}/man3/sam_*3*
293 %{_mandir}/man8/cpg_overview.8*
294 %{_mandir}/man8/votequorum_overview.8*
295 %{_mandir}/man8/sam_overview.8*
296 %{_mandir}/man3/cmap_*3*
297 %{_mandir}/man8/cmap_overview.8*
298 %{_mandir}/man8/quorum_overview.8*
299
300 %changelog
301 * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
302 - Autotools generated version