File: cluster-glue-suse.spec

package info (click to toggle)
cluster-glue 1.0.6-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,112 kB
  • ctags: 4,580
  • sloc: ansic: 42,941; sh: 4,373; python: 901; xml: 665; makefile: 558; perl: 234
file content (273 lines) | stat: -rw-r--r-- 7,845 bytes parent folder | download
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
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

# 
# Since this spec file supports multiple distributions, ensure we
# use the correct group for each.
#

%define uid 90
%define gname haclient
%define uname hacluster

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

Name:           cluster-glue
Summary:        Reusable cluster components
Version:        1.0.6
Release:        1%{?dist}
License:        GPL v2 or later; LGPL v2.1 or later
Url:            http://www.linux-ha.org/wiki/Cluster_Glue
Group:		Productivity/Clustering/HA
Source:         cluster-glue.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
AutoReqProv:    on
BuildRequires:  automake autoconf libtool e2fsprogs-devel glib2-devel pkgconfig python-devel libxml2-devel
BuildRequires:  libnet net-snmp-devel OpenIPMI-devel openhpi-devel
BuildRequires:  libxslt docbook_4 docbook-xsl-stylesheets
BuildRequires:  help2man

Obsoletes:	heartbeat-common
Provides:	heartbeat-common
Requires(pre):    /usr/sbin/groupadd /usr/bin/getent /usr/sbin/useradd

# SLES10 needs tcpd-devel but doesn't have libcurl
# in SLES10 docbook has no dependency on sgml-skel
%if 0%{?suse_version} < 1020
BuildRequires:  tcpd-devel
BuildRequires:  sgml-skel
%else
BuildRequires:  libcurl-devel 
%endif

%description
A collection of common tools derived from the Heartbeat project 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.

%package -n libglue2
License:        GPL v2 only; GPL v2 or later; LGPL v2.1 or later
Summary:        The Pacemaker scalable High-Availability cluster resource manager
Group:		Productivity/Clustering/HA
Obsoletes:	libheartbeat2
Provides:	libheartbeat2
Requires:       %{name} = %{version}-%{release}

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

%package -n libglue-devel 
License:        GPL v2 only; GPL v2 or later; LGPL v2.1 or later
Summary:        The Pacemaker scalable High-Availability cluster resource manager
Group:		Development/Libraries/C and C++
Requires:       %{name} = %{version}-%{release}
Requires:       libglue2 = %{version}-%{release}
Obsoletes:	libheartbeat-devel
Provides:	libheartbeat-devel

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

%prep
###########################################################
%setup -n cluster-glue -q
###########################################################

%build
CFLAGS="${CFLAGS} ${RPM_OPT_FLAGS}"
export CFLAGS

./autogen.sh
# SLES <= 10 does not support ./configure --docdir=,
# hence, use this ugly hack
%if 0%{?suse_version} < 1020
export docdir=%{glue_docdir}
%configure \
    --enable-fatal-warnings=yes \
    --with-package-name=%{name} \
    --with-daemon-group=%{gname} \
    --with-daemon-user=%{uname}
%else
%configure \
    --enable-fatal-warnings=yes \
    --with-package-name=%{name} \
    --with-daemon-group=%{gname} \
    --with-daemon-user=%{uname} \
    --docdir=%{glue_docdir}
%endif

make %{?_smp_mflags} docdir=%{glue_docdir}
###########################################################

%install
###########################################################
make DESTDIR=$RPM_BUILD_ROOT docdir=%{glue_docdir} install
# Dont package static libs or compiled python
find $RPM_BUILD_ROOT -name '*.a' -type f -print0 | xargs -0 rm -f
find $RPM_BUILD_ROOT -name '*.la' -type f -print0 | xargs -0 rm -f
find $RPM_BUILD_ROOT -name '*.pyc' -type f -print0 | xargs -0 rm -f
find $RPM_BUILD_ROOT -name '*.pyo' -type f -print0 | xargs -0 rm -f

test -d $RPM_BUILD_ROOT/sbin || mkdir $RPM_BUILD_ROOT/sbin
(
  cd $RPM_BUILD_ROOT/sbin
  ln -s /etc/init.d/logd rclogd
)

###########################################################

%clean
###########################################################
if
  [ -n "${RPM_BUILD_ROOT}" -a "${RPM_BUILD_ROOT}" != "/" ]
then
  rm -rf $RPM_BUILD_ROOT
fi
rm -rf $RPM_BUILD_DIR/cluster-glue
###########################################################

%pre
if
  getent group %{gname} >/dev/null
then
  : OK group haclient already present
else
  /usr/sbin/groupadd -o -r -g %{uid} %{gname} 2>/dev/null || :
fi
if
  getent passwd %{uname} >/dev/null
then
  : OK hacluster user already present
else
  /usr/sbin/useradd -r -g %{gname} -c "heartbeat processes" \
        -d %{_var}/lib/heartbeat/cores/%{uname} -o -u %{uid} \
        %{uname} 2>/dev/null || :
fi

%preun
%stop_on_removal logd

%post
%{insserv_force_if_yast logd}

%postun
%insserv_cleanup

%post -n libglue2
/sbin/ldconfig  
  
%postun -n libglue2
/sbin/ldconfig

%files
###########################################################
%defattr(-,root,root)

%dir %{_libdir}/heartbeat
%dir %{_var}/lib/heartbeat
%dir %{_var}/lib/heartbeat/cores
%dir %attr (0700, root, root)           %{_var}/lib/heartbeat/cores/root
%dir %attr (0700, nobody, nobody)       %{_var}/lib/heartbeat/cores/nobody
%dir %attr (0700, %{uname}, %{gname})   %{_var}/lib/heartbeat/cores/%{uname}

%dir %{_libdir}/heartbeat/plugins
%dir %{_libdir}/heartbeat/plugins/RAExec
%dir %{_libdir}/heartbeat/plugins/InterfaceMgr

%dir %{_libdir}/stonith
%dir %{_libdir}/stonith/plugins
%dir %{_libdir}/stonith/plugins/stonith2

%dir %{_datadir}/%{name}
%{_datadir}/%{name}/ha_cf_support.sh
%{_datadir}/%{name}/openais_conf_support.sh
%{_datadir}/%{name}/utillib.sh
%{_datadir}/%{name}/combine-logs.pl
%{_datadir}/%{name}/ha_log.sh

%{_sbindir}/ha_logger
%{_sbindir}/hb_report
%{_sbindir}/lrmadmin
%{_sbindir}/meatclient
%{_sbindir}/stonith
%{_sbindir}/sbd

%{_sysconfdir}/init.d/logd

%doc %{_mandir}/man1/*
%doc %{_mandir}/man8/*
%doc AUTHORS
%doc COPYING
%doc ChangeLog
%doc logd/logd.cf
%doc doc/stonith/README*

/sbin/rclogd

%{_libdir}/heartbeat/lrmd
%{_libdir}/heartbeat/ha_logd

%{_libdir}/heartbeat/plugins/RAExec/*.so
%{_libdir}/heartbeat/plugins/InterfaceMgr/*.so

%{_libdir}/stonith/plugins/external
%{_libdir}/stonith/plugins/stonith2/*.so
%{_libdir}/stonith/plugins/stonith2/*.py
%{_libdir}/stonith/plugins/xen0-ha-dom0-stonith-helper
%exclude %{_libdir}/stonith/plugins/external/ssh
%exclude %{_libdir}/stonith/plugins/stonith2/null.so
%exclude %{_libdir}/stonith/plugins/stonith2/ssh.so

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

%files -n libglue-devel
%defattr(-,root,root)

%dir %{_libdir}/heartbeat
%dir %{_libdir}/heartbeat/plugins
%dir %{_libdir}/heartbeat/plugins/test
%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