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