forked from mej/nhc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lbnl-nhc.spec.in
85 lines (67 loc) · 2.53 KB
/
lbnl-nhc.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
%{!?_rel:%{expand:%%global _rel 0.@GITVERSION@}}
%{!?sname:%global sname nhc}
%{!?nhc_script_dir:%global nhc_script_dir %{_sysconfdir}/%{sname}/scripts}
%{!?nhc_helper_dir:%global nhc_helper_dir %{_libexecdir}/%{sname}}
Summary: LBNL Node Health Check
Name: @PACKAGE@
Version: @VERSION@
#Release: %{_rel}%{?dist}
Release: 1%{?dist}
License: US Dept. of Energy (BSD-like)
Group: Applications/System
URL: https://github.com/mej/nhc/
Source: https://github.com/mej/nhc/archive/%{name}-%{version}.tar.gz
Packager: %{?_packager}%{!?_packager:Michael Jennings <[email protected]>}
Vendor: %{?_vendorinfo}%{!?_vendorinfo:LBNL NHC Project (https://github.com/mej/nhc/)}
Requires: bash
Obsoletes: warewulf-nhc <= 1.4.2-1
BuildArch: noarch
BuildRoot: %{?_tmppath}%{!?_tmppath:/var/tmp}/%{name}-%{version}-%{release}-root
%description
This package contains the LBNL Node Health Check system.
TORQUE (and other resource managers) allow for the execution of a
script to determine if a node is "healthy" or "unhealthy" and
potentially mark unhealthy nodes as unavailable. The scripts
contained in this package provide a flexible, extensible mechanism for
collecting health checks to be run on your cluster and specifying
which checks should be run on which nodes.
%prep
%setup
%build
%{configure}
%{__make} %{?mflags}
%install
umask 0077
%{__make} install DESTDIR=$RPM_BUILD_ROOT %{?mflags_install}
%check
%{__make} test
%triggerpostun -p /bin/bash -- warewulf-nhc <= 1.4.2-1
if [ $1 -gt 0 -a $2 -eq 0 ]; then
cd %{_sysconfdir}/%{sname}/scripts
for SCRIPT in ww_*.nhc.rpmsave ; do
if [ -e $SCRIPT ]; then
NEWSCRIPT=lbnl${SCRIPT##ww}
NEWSCRIPT=${NEWSCRIPT%%.rpmsave}
echo warning: Auto-fixing script naming due to modified script ${SCRIPT%%.rpmsave}
mv -v $NEWSCRIPT $NEWSCRIPT.rpmnew && mv -v $SCRIPT $NEWSCRIPT
fi
done 2>/dev/null
fi
%clean
test "$RPM_BUILD_ROOT" != "/" && %{__rm} -rf $RPM_BUILD_ROOT
%files
%defattr(-, root, root)
%doc COPYING ChangeLog LICENSE nhc.conf contrib/nhc.cron
%dir %{_sysconfdir}/%{sname}/
%dir %{_localstatedir}/lib/%{sname}/
%dir %{_localstatedir}/run/%{sname}/
%dir %{nhc_script_dir}/
%dir %{nhc_helper_dir}/
%ghost %dir %{_sysconfdir}/%{sname}/sysconfig/
%config(noreplace) %{_sysconfdir}/%{sname}/%{sname}.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/%{sname}
%config(noreplace) %{nhc_script_dir}/*.nhc
%config(noreplace) %{nhc_helper_dir}/*
%config(noreplace) %{_sbindir}/%{sname}
%config(noreplace) %{_sbindir}/%{sname}-genconf
%config(noreplace) %{_sbindir}/%{sname}-wrapper