]> git.proxmox.com Git - mirror_corosync.git/blob - corosync.spec.in
Remove dir pragma for xml2conf.xsl in specfile
[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
139 %clean
140 rm -rf %{buildroot}
141
142 %description
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
147 %if %{with systemd} && 0%{?systemd_post:1}
148 %systemd_post corosync.service
149 %else
150 if [ $1 -eq 1 ]; then
151 /sbin/chkconfig --add corosync || :
152 fi
153 %endif
154
155 %preun
156 %if %{with systemd} && 0%{?systemd_preun:1}
157 %systemd_preun corosync.service
158 %else
159 if [ $1 -eq 0 ]; then
160 /sbin/service corosync stop &>/dev/null || :
161 /sbin/chkconfig --del corosync || :
162 fi
163 %endif
164
165 %postun
166 %if %{with systemd} && 0%{?systemd_postun:1}
167 %systemd_postun
168 %endif
169
170 %files
171 %defattr(-,root,root,-)
172 %doc LICENSE SECURITY
173 %{_sbindir}/corosync
174 %{_sbindir}/corosync-keygen
175 %{_sbindir}/corosync-cmapctl
176 %{_sbindir}/corosync-cfgtool
177 %{_sbindir}/corosync-cpgtool
178 %{_sbindir}/corosync-quorumtool
179 %{_sbindir}/corosync-notifyd
180 %{_bindir}/corosync-blackbox
181 %if %{with xmlconf}
182 %{_bindir}/corosync-xmlproc
183 %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
184 %dir %{_datadir}/corosync
185 %{_datadir}/corosync/xml2conf.xsl
186 %{_mandir}/man8/corosync-xmlproc.8*
187 %{_mandir}/man5/corosync.xml.5*
188 %endif
189 %dir %{_sysconfdir}/corosync
190 %dir %{_sysconfdir}/corosync/uidgid.d
191 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
192 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
193 %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
194 %if %{with dbus}
195 %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
196 %endif
197 %if %{with snmp}
198 %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
199 %endif
200 %if %{with systemd}
201 %{_unitdir}/corosync.service
202 %{_unitdir}/corosync-notifyd.service
203 %dir %{_datadir}/corosync
204 %{_datadir}/corosync/corosync
205 %{_datadir}/corosync/corosync-notifyd
206 %else
207 %{_initrddir}/corosync
208 %{_initrddir}/corosync-notifyd
209 %endif
210 %if %{with upstart}
211 %{_sysconfdir}/init/corosync.conf
212 %{_sysconfdir}/init/corosync-notifyd.conf
213 %endif
214 %dir %{_localstatedir}/lib/corosync
215 %dir %{_localstatedir}/log/cluster
216 %{_mandir}/man8/corosync_overview.8*
217 %{_mandir}/man8/corosync.8*
218 %{_mandir}/man8/corosync-blackbox.8*
219 %{_mandir}/man8/corosync-cmapctl.8*
220 %{_mandir}/man8/corosync-keygen.8*
221 %{_mandir}/man8/corosync-cfgtool.8*
222 %{_mandir}/man8/corosync-cpgtool.8*
223 %{_mandir}/man8/corosync-notifyd.8*
224 %{_mandir}/man8/corosync-quorumtool.8*
225 %{_mandir}/man5/corosync.conf.5*
226 %{_mandir}/man5/votequorum.5*
227 %{_mandir}/man8/cmap_keys.8*
228
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
245 %{_datadir}/corosync/tests/cmap-dispatch-deadlock.sh
246 %{_datadir}/corosync/tests/shm_leak_audit.sh
247 %{_bindir}/cpg_test_agent
248 %{_bindir}/sam_test_agent
249 %{_bindir}/votequorum_test_agent
250
251 %endif
252
253 # library
254 #
255 %package -n corosynclib
256 Summary: The Corosync Cluster Engine Libraries
257 Group: System Environment/Libraries
258 Requires: %{name} = %{version}-%{release}
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.*
268 %{_libdir}/libcmap.so.*
269 %{_libdir}/libtotem_pg.so.*
270 %{_libdir}/libquorum.so.*
271 %{_libdir}/libvotequorum.so.*
272 %{_libdir}/libsam.so.*
273 %{_libdir}/libcorosync_common.so.*
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,-)
293 %doc LICENSE
294 %dir %{_includedir}/corosync/
295 %{_includedir}/corosync/corodefs.h
296 %{_includedir}/corosync/cfg.h
297 %{_includedir}/corosync/cmap.h
298 %{_includedir}/corosync/corotypes.h
299 %{_includedir}/corosync/cpg.h
300 %{_includedir}/corosync/hdb.h
301 %{_includedir}/corosync/sam.h
302 %{_includedir}/corosync/quorum.h
303 %{_includedir}/corosync/votequorum.h
304 %dir %{_includedir}/corosync/totem/
305 %{_includedir}/corosync/totem/totem.h
306 %{_includedir}/corosync/totem/totemip.h
307 %{_includedir}/corosync/totem/totempg.h
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 %{_libdir}/pkgconfig/*.pc
317 %{_mandir}/man3/cpg_*3*
318 %{_mandir}/man3/quorum_*3*
319 %{_mandir}/man3/votequorum_*3*
320 %{_mandir}/man3/sam_*3*
321 %{_mandir}/man8/cpg_overview.8*
322 %{_mandir}/man8/votequorum_overview.8*
323 %{_mandir}/man8/sam_overview.8*
324 %{_mandir}/man3/cmap_*3*
325 %{_mandir}/man8/cmap_overview.8*
326 %{_mandir}/man8/quorum_overview.8*
327
328 %changelog
329 * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
330 - Autotools generated version