summaryrefslogtreecommitdiffstats
path: root/cluster-glue-fedora.spec
blob: b480ff5a6740f92ff87a0ef69881e0bbb7efee3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# Keep around for when/if required
## define alphatag XXX

%define gname haclient
%define uname hacluster
%define nogroup nobody

# Directory where we install documentation
%global glue_docdir %{_defaultdocdir}/%{name}-%{version}

# When downloading directly from Mercurial, it will automatically add this prefix
# Invoking 'hg archive' wont but you can add one with: hg archive -t tgz -p "Reusable-Cluster-Components-" -r $upstreamversion $upstreamversion.tar.gz
%global upstreamprefix Reusable-Cluster-Components-
%global upstreamversion d97b9dea436e

Name:		cluster-glue
Summary:	Reusable cluster components
Version:	1.0.12
Release:	1%{?dist}
License:	GPLv2+ and LGPLv2+
Url:		http://www.linux-ha.org/wiki/Cluster_Glue
Group:		System Environment/Base
Source0:	cluster-glue.tar.bz2
Requires:	perl-TimeDate
Requires:	cluster-glue-libs = %{version}-%{release}

# Directives to allow upgrade from combined heartbeat packages in Fedora11
Provides:       heartbeat-stonith = 3.0.0-1
Provides:       heartbeat-pils = 3.0.0-1
Obsoletes:      heartbeat-stonith < 3.0.0-1
Obsoletes:      heartbeat-pils < 3.0.0-1
Obsoletes:	heartbeat-common

## Setup/build bits

BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

# Build dependencies
BuildRequires: automake autoconf libtool pkgconfig which
BuildRequires: bzip2-devel glib2-devel python-devel libxml2-devel libaio-devel
BuildRequires: OpenIPMI-devel openssl-devel
BuildRequires: libxslt docbook-dtds docbook-style-xsl
BuildRequires: help2man
BuildRequires: asciidoc

%if 0%{?fedora} 
BuildRequires:    libcurl-devel libnet-devel
%endif

%if 0%{?fedora} || 0%{?centos} > 4 || 0%{?rhel} > 4
BuildRequires:    libtool-ltdl-devel openhpi-devel 
BuildRequires:    net-snmp-devel >= 5.4
%else
BuildRequires:    gcc-c++
%endif

%if 0%{?fedora} > 11 || 0%{?centos} > 5 || 0%{?rhel} > 5
BuildRequires: libuuid-devel
%else
BuildRequires: e2fsprogs-devel
%endif

%if %{defined systemd_requires}
BuildRequires:  systemd
%{?systemd_requires}
%endif

%prep
%setup -q -n cluster-glue

./autogen.sh

# RHEL <= 5 does not support ./configure --docdir=,
# hence, use this ugly hack
%if 0%{?centos} <= 5 || 0%{?rhel} <= 5
export docdir=%{glue_docdir}
%configure \
    --enable-fatal-warnings=yes \
    --with-daemon-group=%{gname} \
    --with-daemon-user=%{uname} \
    --localstatedir=%{_var} \
    --libdir=%{_libdir}
%else
%configure \
    --enable-fatal-warnings=yes \
    --with-daemon-group=%{gname} \
    --with-daemon-user=%{uname} \
    --localstatedir=%{_var} \
    --libdir=%{_libdir} \
%if %{defined _unitdir}
    --with-systemdsystemunitdir=%{_unitdir} \
%endif
    --docdir=%{glue_docdir}
%endif

%build
make %{?jobs:-j%jobs} docdir=%{glue_docdir}

%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} docdir=%{glue_docdir}


## tree fix up
# Dont package static libs
find %{buildroot} -name '*.a' -exec rm {} \;
find %{buildroot} -name '*.la' -exec rm {} \;

%clean
rm -rf %{buildroot}

# cluster-glue

%description
A collection of common tools that are useful for writing cluster managers 
such as Pacemaker.
Provides a local resource manager that understands the OCF and LSB
standards, and an interface to common STONITH devices.

%files
%defattr(-,root,root)
%dir %{_datadir}/%{name}
%if %{defined _unitdir}
%{_unitdir}/logd.service
%else
%{_sysconfdir}/init.d/logd
%endif
%{_datadir}/%{name}/ha_cf_support.sh
%{_datadir}/%{name}/openais_conf_support.sh
%{_datadir}/%{name}/utillib.sh
%{_datadir}/%{name}/ha_log.sh

%{_sbindir}/ha_logger
%{_sbindir}/hb_report
%{_sbindir}/lrmadmin
%{_sbindir}/cibsecret
%{_sbindir}/meatclient
%{_sbindir}/stonith
%dir %{_libdir}/heartbeat
%dir %{_libdir}/heartbeat/plugins
%dir %{_libdir}/heartbeat/plugins/RAExec
%dir %{_libdir}/heartbeat/plugins/InterfaceMgr
%dir %{_libdir}/heartbeat/plugins/compress
%{_libdir}/heartbeat/lrmd
%{_libdir}/heartbeat/ha_logd
%{_libdir}/heartbeat/plugins/RAExec/*.so
%{_libdir}/heartbeat/plugins/InterfaceMgr/*.so
%{_libdir}/heartbeat/plugins/compress/*.so
%dir %{_libdir}/stonith
%dir %{_libdir}/stonith/plugins
%dir %{_libdir}/stonith/plugins/stonith2
%{_libdir}/stonith/plugins/external
%{_libdir}/stonith/plugins/stonith2/*.so
%{_libdir}/stonith/plugins/stonith2/*.py*
%exclude %{_libdir}/stonith/plugins/external/ssh
%exclude %{_libdir}/stonith/plugins/stonith2/null.so
%exclude %{_libdir}/stonith/plugins/stonith2/ssh.so
%{_libdir}/stonith/plugins/xen0-ha-dom0-stonith-helper
%dir %{_var}/lib/heartbeat
%dir %{_var}/lib/heartbeat/cores
%dir %attr (0700, root, root)		%{_var}/lib/heartbeat/cores/root
%dir %attr (0700, nobody, %{nogroup})	%{_var}/lib/heartbeat/cores/nobody
%dir %attr (0700, %{uname}, %{gname})	%{_var}/lib/heartbeat/cores/%{uname}
%{_mandir}/man1/*
%{_mandir}/man8/*
%doc doc/stonith/README*
%doc logd/logd.cf
%doc AUTHORS
%doc COPYING
%doc ChangeLog

# cluster-glue-libs

%package -n cluster-glue-libs
Summary:	Reusable cluster libraries
Group:		Development/Libraries
Obsoletes:	libheartbeat2

%description -n cluster-glue-libs
A collection of libraries that are useful for writing cluster managers 
such as Pacemaker.

%pre
getent group %{gname} >/dev/null || groupadd -r %{gname}
getent passwd %{uname} >/dev/null || \
useradd -r -g %{gname} -d %{_var}/lib/heartbeat/cores/hacluster -s /sbin/nologin \
-c "cluster user" %{uname}
exit 0

%if %{defined _unitdir}
%post
%systemd_post logd.service

%preun
%systemd_preun logd.service

%postun
%systemd_postun_with_restart logd.service
%endif

%post -n cluster-glue-libs -p /sbin/ldconfig

%postun -n cluster-glue-libs -p /sbin/ldconfig

%files -n cluster-glue-libs
%defattr(-,root,root)
%{_libdir}/lib*.so.*
%doc AUTHORS
%doc COPYING.LIB

# cluster-glue-libs-devel

%package -n cluster-glue-libs-devel 
Summary:	Headers and libraries for writing cluster managers
Group:		Development/Libraries
Requires:	cluster-glue-libs = %{version}-%{release}
Obsoletes:	libheartbeat-devel

%description -n cluster-glue-libs-devel
Headers and shared libraries for a useful for writing cluster managers 
such as Pacemaker.

%files -n cluster-glue-libs-devel
%defattr(-,root,root)
%dir %{_libdir}/heartbeat/plugins
%dir %{_libdir}/heartbeat/plugins/test
%dir %{_libdir}/heartbeat
%dir %{_datadir}/%{name}
%{_libdir}/lib*.so
%{_libdir}/heartbeat/ipctest
%{_libdir}/heartbeat/ipctransientclient
%{_libdir}/heartbeat/ipctransientserver
%{_libdir}/heartbeat/transient-test.sh
%{_libdir}/heartbeat/base64_md5_test
%{_libdir}/heartbeat/logtest
%{_includedir}/clplumbing
%{_includedir}/heartbeat
%{_includedir}/stonith
%{_includedir}/pils
%{_datadir}/%{name}/lrmtest
%{_libdir}/heartbeat/plugins/test/test.so
%{_libdir}/stonith/plugins/external/ssh
%{_libdir}/stonith/plugins/stonith2/null.so
%{_libdir}/stonith/plugins/stonith2/ssh.so
%doc AUTHORS
%doc COPYING
%doc COPYING.LIB

%changelog