]> git.proxmox.com Git - mirror_corosync.git/blob - corosync.spec.in
build: Do not compile totempg as a shared library
[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 watchdog
9 %bcond_with monitoring
10 %bcond_with snmp
11 %bcond_with dbus
12 %bcond_with systemd
13 %bcond_with xmlconf
14 %bcond_with runautogen
15
16 %global gitver %{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}
17 %global gittarver %{?numcomm:.%{numcomm}}%{?alphatag:-%{alphatag}}%{?dirty:-%{dirty}}
18
19 Name: corosync
20 Summary: The Corosync Cluster Engine and Application Programming Interfaces
21 Version: @version@
22 Release: 1%{?gitver}%{?dist}
23 License: BSD
24 URL: http://corosync.github.io/corosync/
25 Source0: http://build.clusterlabs.org/corosync/releases/%{name}-%{version}%{?gittarver}.tar.gz
26
27 # Runtime bits
28 # The automatic dependency overridden in favor of explicit version lock
29 Requires: corosynclib%{?_isa} = %{version}-%{release}
30
31 # Build bits
32 BuildRequires: gcc
33
34 %if 0%{?suse_version}
35 BuildRequires: groff-full
36 %else
37 BuildRequires: groff
38 %endif
39 BuildRequires: libqb-devel
40 BuildRequires: libknet1-devel
41 BuildRequires: zlib-devel
42 %if %{with runautogen}
43 BuildRequires: autoconf automake libtool
44 %endif
45 %if %{with monitoring}
46 BuildRequires: libstatgrab-devel
47 %endif
48 %if %{with snmp}
49 BuildRequires: net-snmp-devel
50 %endif
51 %if %{with dbus}
52 %if 0%{?suse_version}
53 BuildRequires: dbus-1-devel
54 %else
55 BuildRequires: dbus-devel
56 %endif
57 %endif
58 %if %{with systemd}
59 %{?systemd_requires}
60 BuildRequires: systemd
61 BuildRequires: systemd-devel
62 %else
63 Requires(post): /sbin/chkconfig
64 Requires(preun): /sbin/chkconfig
65 %endif
66 %if %{with xmlconf}
67 Requires: libxslt
68 %endif
69
70 %prep
71 %setup -q -n %{name}-%{version}%{?gittarver}
72
73 %build
74 %if %{with runautogen}
75 ./autogen.sh
76 %endif
77
78 %{configure} \
79 %if %{with watchdog}
80 --enable-watchdog \
81 %endif
82 %if %{with monitoring}
83 --enable-monitoring \
84 %endif
85 %if %{with snmp}
86 --enable-snmp \
87 %endif
88 %if %{with dbus}
89 --enable-dbus \
90 %endif
91 %if %{with systemd}
92 --enable-systemd \
93 %endif
94 %if %{with xmlconf}
95 --enable-xmlconf \
96 %endif
97 --with-initddir=%{_initrddir} \
98 --with-systemddir=%{_unitdir} \
99 --docdir=%{_docdir}
100
101 make %{_smp_mflags}
102
103 %install
104 make install DESTDIR=%{buildroot}
105
106 %if %{with dbus}
107 mkdir -p -m 0700 %{buildroot}/%{_sysconfdir}/dbus-1/system.d
108 install -m 644 %{_builddir}/%{name}-%{version}%{?gittarver}/conf/corosync-signals.conf %{buildroot}/%{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
109 %endif
110
111 ## tree fixup
112 # drop static libs
113 rm -f %{buildroot}%{_libdir}/*.a
114 rm -f %{buildroot}%{_libdir}/*.la
115 # drop docs and html docs for now
116 rm -rf %{buildroot}%{_docdir}/*
117 # /etc/sysconfig/corosync-notifyd
118 mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
119 install -m 644 tools/corosync-notifyd.sysconfig.example \
120 %{buildroot}%{_sysconfdir}/sysconfig/corosync-notifyd
121 # /etc/sysconfig/corosync
122 install -m 644 init/corosync.sysconfig.example \
123 %{buildroot}%{_sysconfdir}/sysconfig/corosync
124
125 %description
126 This package contains the Corosync Cluster Engine Executive, several default
127 APIs and libraries, default configuration files, and an init script.
128
129 %post
130 %if %{with systemd} && 0%{?systemd_post:1}
131 %systemd_post corosync.service
132 %else
133 if [ $1 -eq 1 ]; then
134 /sbin/chkconfig --add corosync || :
135 fi
136 %endif
137
138 %preun
139 %if %{with systemd} && 0%{?systemd_preun:1}
140 %systemd_preun corosync.service
141 %else
142 if [ $1 -eq 0 ]; then
143 /sbin/service corosync stop &>/dev/null || :
144 /sbin/chkconfig --del corosync || :
145 fi
146 %endif
147
148 %postun
149 %if %{with systemd} && 0%{?systemd_postun:1}
150 %systemd_postun corosync.service
151 %endif
152
153 %files
154 %doc LICENSE
155 %{_sbindir}/corosync
156 %{_sbindir}/corosync-keygen
157 %{_sbindir}/corosync-cmapctl
158 %{_sbindir}/corosync-cfgtool
159 %{_sbindir}/corosync-cpgtool
160 %{_sbindir}/corosync-quorumtool
161 %{_sbindir}/corosync-notifyd
162 %{_bindir}/corosync-blackbox
163 %if %{with xmlconf}
164 %{_bindir}/corosync-xmlproc
165 %config(noreplace) %{_sysconfdir}/corosync/corosync.xml.example
166 %dir %{_datadir}/corosync
167 %{_datadir}/corosync/xml2conf.xsl
168 %{_mandir}/man8/corosync-xmlproc.8*
169 %{_mandir}/man5/corosync.xml.5*
170 %endif
171 %dir %{_sysconfdir}/corosync
172 %dir %{_sysconfdir}/corosync/uidgid.d
173 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example
174 %config(noreplace) %{_sysconfdir}/corosync/corosync.conf.example.udpu
175 %config(noreplace) %{_sysconfdir}/sysconfig/corosync-notifyd
176 %config(noreplace) %{_sysconfdir}/sysconfig/corosync
177 %config(noreplace) %{_sysconfdir}/logrotate.d/corosync
178 %if %{with dbus}
179 %{_sysconfdir}/dbus-1/system.d/corosync-signals.conf
180 %endif
181 %if %{with snmp}
182 %{_datadir}/snmp/mibs/COROSYNC-MIB.txt
183 %endif
184 %if %{with systemd}
185 %{_unitdir}/corosync.service
186 %{_unitdir}/corosync-notifyd.service
187 %else
188 %{_initrddir}/corosync
189 %{_initrddir}/corosync-notifyd
190 %endif
191 %dir %{_localstatedir}/lib/corosync
192 %dir %{_localstatedir}/log/cluster
193 %{_mandir}/man7/corosync_overview.7*
194 %{_mandir}/man8/corosync.8*
195 %{_mandir}/man8/corosync-blackbox.8*
196 %{_mandir}/man8/corosync-cmapctl.8*
197 %{_mandir}/man8/corosync-keygen.8*
198 %{_mandir}/man8/corosync-cfgtool.8*
199 %{_mandir}/man8/corosync-cpgtool.8*
200 %{_mandir}/man8/corosync-notifyd.8*
201 %{_mandir}/man8/corosync-quorumtool.8*
202 %{_mandir}/man5/corosync.conf.5*
203 %{_mandir}/man5/votequorum.5*
204 %{_mandir}/man8/cmap_keys.8*
205
206 # library
207 #
208 %package -n corosynclib
209 Summary: The Corosync Cluster Engine Libraries
210
211 %description -n corosynclib
212 This package contains corosync libraries.
213
214 %files -n corosynclib
215 %doc LICENSE
216 %{_libdir}/libcfg.so.*
217 %{_libdir}/libcpg.so.*
218 %{_libdir}/libcmap.so.*
219 %{_libdir}/libquorum.so.*
220 %{_libdir}/libvotequorum.so.*
221 %{_libdir}/libsam.so.*
222 %{_libdir}/libcorosync_common.so.*
223
224 %post -n corosynclib -p /sbin/ldconfig
225
226 %postun -n corosynclib -p /sbin/ldconfig
227
228 %package -n corosynclib-devel
229 Summary: The Corosync Cluster Engine Development Kit
230 Requires: corosynclib%{?_isa} = %{version}-%{release}
231 Requires: pkgconfig
232 Provides: corosync-devel = %{version}
233
234 %description -n corosynclib-devel
235 This package contains include files and man pages used to develop using
236 The Corosync Cluster Engine APIs.
237
238 %files -n corosynclib-devel
239 %doc LICENSE
240 %dir %{_includedir}/corosync/
241 %{_includedir}/corosync/corodefs.h
242 %{_includedir}/corosync/cfg.h
243 %{_includedir}/corosync/cmap.h
244 %{_includedir}/corosync/corotypes.h
245 %{_includedir}/corosync/cpg.h
246 %{_includedir}/corosync/hdb.h
247 %{_includedir}/corosync/sam.h
248 %{_includedir}/corosync/quorum.h
249 %{_includedir}/corosync/votequorum.h
250 %dir %{_includedir}/corosync/totem/
251 %{_includedir}/corosync/totem/totem.h
252 %{_includedir}/corosync/totem/totemip.h
253 %{_includedir}/corosync/totem/totempg.h
254 %{_includedir}/corosync/totem/totemstats.h
255 %{_libdir}/libcfg.so
256 %{_libdir}/libcpg.so
257 %{_libdir}/libcmap.so
258 %{_libdir}/libquorum.so
259 %{_libdir}/libvotequorum.so
260 %{_libdir}/libsam.so
261 %{_libdir}/libcorosync_common.so
262 %{_libdir}/pkgconfig/*.pc
263 %{_mandir}/man3/cpg_*3*
264 %{_mandir}/man3/quorum_*3*
265 %{_mandir}/man3/votequorum_*3*
266 %{_mandir}/man3/sam_*3*
267 %{_mandir}/man3/cmap_*3*
268
269 %changelog
270 * @date@ Autotools generated version <nobody@nowhere.org> - @version@-1-@numcomm@.@alphatag@.@dirty@
271 - Autotools generated version