-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwhatsup.spec.in
223 lines (193 loc) · 6.07 KB
/
whatsup.spec.in
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
Name: @PACKAGE@
Version: @VERSION@
Release: 1
Summary: whatsup node up/down detection utility
Group: Applications/Communications
License: GPL
Source: @PACKAGE@-@[email protected]
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRoot: %{_tmppath}/@PACKAGE@-@VERSION@
%description
Whatsup is a cluster node up/down detection utility.
%{!?_with_cerebro: %{!?_without_cerebro: %define _with_cerebro --with-cerebro}}
%{!?_with_ganglia: %{!?_without_ganglia: %define _with_ganglia --with-ganglia}}
%{!?_with_pingd: %{!?_without_pingd: %define _with_pingd --with-pingd}}
%{!?_with_genders: %{!?_without_genders: %define _with_genders --with-genders}}
%{!?_with_hostsfile: %{!?_without_hostsfile: %define _with_hostsfile --with-hostsfile}}
# choose vendor arch by default
%{!?_with_perl_site_arch: %{!?_with_perl_vendor_arch: %define _with_perl_vendor_arch --with-perl-vendor-arch}}
%package backend-ganglia
Summary: whatsup ganglia backend
Group: System Environment/Base
Requires: whatsup
%description backend-ganglia
Ganglia backend module
%package backend-cerebro
Summary: whatsup cerebro backend
Group: System Environment/Base
Requires: whatsup
Requires: cerebro
%description backend-cerebro
Cerebro backend module
%package backend-pingd
Summary: whatsup pingd backend
Group: System Environment/Base
Requires: whatsup
%description backend-pingd
Pingd backend module and daemon
%package clusterlist-genders
Summary: whatsup genders clusterlist module
Group: System Environment/Base
Requires: whatsup
Requires: genders >= 1.2
%description clusterlist-genders
Genders clusterlist module
%package clusterlist-hostsfile
Summary: whatsup hostsfile clusterlist module
Group: System Environment/Base
Requires: whatsup
%description clusterlist-hostsfile
Hostsfile clusterlist module
%package options-cerebro-monitor
Summary: whatsup cerebro-monitor options module
Group: System Environment/Base
Requires: whatsup
Requires: cerebro
%description options-cerebro-monitor
Cerebro Monitor options module
%package pingd
Summary: whatsup pingd daemon
Group: System Environment/Base
%description pingd
Pingd daemon
%package pingd-clusterlist-genders
Summary: whatsup pingd backend clusterlist genders module
Group: System Environment/Base
Requires: whatsup
Requires: whatsup-pingd
%description pingd-clusterlist-genders
Pingd genders clusterlist module
%package pingd-clusterlist-hostsfile
Summary: whatsup pingd backend clusterlist hostsfile module
Group: System Environment/Base
Requires: whatsup
Requires: whatsup-pingd
%description pingd-clusterlist-hostsfile
Pingd hostsfile clusterlist module
%post pingd
if [ "$1" = 1 ]; then
if [ -x %{_initrddir}/whatsup-pingd ]; then
/sbin/chkconfig --add whatsup-pingd
/sbin/chkconfig whatsup-pingd off
fi
fi
if [ $1 -ge 1 ]; then
if [ -x %{_initrddir}/whatsup-pingd ]; then
if %{_initrddir}/whatsup-pingd status | grep -q running; then
%{_initrddir}/whatsup-pingd restart
else
%{_initrddir}/whatsup-pingd condrestart
fi
fi
fi
%{!?_with_perl_extensions: %{!?_without_perl_extensions: %define _with_perl_extensions --with-perl-extensions}}
%prep
%setup -q
%build
%configure --program-prefix=%{?_program_prefix:%{_program_prefix}} \
--with-perl-destdir="$RPM_BUILD_ROOT" \
%{?_with_cerebro} \
%{?_without_cerebro} \
%{?_with_ganglia} \
%{?_without_ganglia} \
%{?_with_pingd} \
%{?_without_pingd} \
%{?_with_genders} \
%{?_without_genders} \
%{?_with_hostsfile} \
%{?_without_hostsfile} \
%{?_with_perl_extensions} \
%{?_without_perl_extensions} \
%{?_with_perl_site_arch} \
%{?_without_perl_site_arch} \
%{?_with_perl_vendor_arch} \
%{?_without_perl_vendor_arch}
make
%install
rm -rf "$RPM_BUILD_ROOT"
DESTDIR="$RPM_BUILD_ROOT" make install
%clean
rm -rf "$RPM_BUILD_ROOT"
%files
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog DISCLAIMER DISCLAIMER.UC INSTALL NEWS README README.expat
%config(noreplace) %{_sysconfdir}/nodeupdown.conf
# It doesn't matter if the user chooses a 32bit or 64bit target. The
# packaging must work off whatever Perl is installed.
%if %{?_with_perl_site_arch:1}%{!?_with_perl_site_arch:0}
%define _perldir %(perl -e 'use Config; $T=$Config{installsitearch}; $P=$Config{siteprefix}; $T=~/$P\\/(.*)/; print "%{_prefix}/$1\\n"')
%endif
%if %{?_with_perl_vendor_arch:1}%{!?_with_perl_vendor_arch:0}
%define _perldir %(perl -e 'use Config; $T=$Config{installvendorarch}; $P=$Config{vendorprefix}; $T=~/$P\\/(.*)/; print "%{_prefix}/$1\\n"')
%endif
%{_bindir}/*
%{_includedir}/*
%dir %{_libdir}/nodeupdown
%dir %{_libdir}/whatsup
%{_libdir}/libnodeupdown.*
%{_mandir}/man1/*
%{_mandir}/man3/*
%{_mandir}/man5/nodeupdown*
%if %{?_with_perl_extensions:1}%{!?_with_perl_extensions:0}
%{_perldir}/*
%endif
%if %{?_with_ganglia:1}%{!?_with_ganglia:0}
%files backend-ganglia
%defattr(-,root,root)
%{_libdir}/nodeupdown/*ganglia.*
%endif
%if %{?_with_cerebro:1}%{!?_with_cerebro:0}
%files backend-cerebro
%defattr(-,root,root)
%{_libdir}/nodeupdown/*cerebro.*
%endif
%if %{?_with_pingd:1}%{!?_with_pingd:0}
%files backend-pingd
%defattr(-,root,root)
%{_libdir}/nodeupdown/*pingd.*
%endif
%if %{?_with_genders:1}%{!?_with_genders:0}
%files clusterlist-genders
%defattr(-,root,root)
%{_libdir}/nodeupdown/*genders.*
%endif
%if %{?_with_hostsfile:1}%{!?_with_hostsfile:0}
%files clusterlist-hostsfile
%defattr(-,root,root)
%{_libdir}/nodeupdown/*hostsfile.*
%endif
%if %{?_with_cerebro:1}%{!?_with_cerebro:0}
%files options-cerebro-monitor
%defattr(-,root,root)
%{_libdir}/whatsup/*cerebro_monitor.*
%endif
%if %{?_with_pingd:1}%{!?_with_pingd:0}
%files pingd
%defattr(-,root,root)
%config(noreplace) %{_initrddir}/whatsup-pingd
%config(noreplace) %{_sysconfdir}/pingd.conf
%{_sbindir}/pingd
%dir %{_libdir}/pingd
%{_mandir}/man5/pingd*
%{_mandir}/man8/*
%if %{?_with_genders:1}%{!?_with_genders:0}
%files pingd-clusterlist-genders
%defattr(-,root,root)
%{_libdir}/pingd/*genders.*
%endif
%if %{?_with_hostsfile:1}%{!?_with_hostsfile:0}
%files pingd-clusterlist-hostsfile
%defattr(-,root,root)
%{_libdir}/pingd/*hostsfile.*
%endif
%endif