-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogwarn.spec.in
92 lines (78 loc) · 2.97 KB
/
logwarn.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
#
# Logwarn - Utility for finding interesting messages in log files
#
# Copyright (C) 2010-2011 Archie L. Cobbs. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
Name: logwarn
Version: @PACKAGE_VERSION@
Release: 1
License: Apache-2.0
Summary: Utility for finding interesting messages in log files
Group: System/Monitoring
Source: %{name}-%{version}.tar.gz
URL: https://github.com/archiecobbs/%{name}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildRequires: make
BuildRequires: gcc
BuildRequires: nagios-rpm-macros
%description
%{name} searches for interesting messages in log files, where ``interest-
ing'' is defined by an user-supplied list of positive and negative (pre-
ceeded with a ``!'') extended regular expressions provided on the command
line.
Each log message is compared against each pattern in the order given. If
the log message matches a positive pattern before matching a negative
!pattern then it's printed to standard output.
%{name} keeps track of its position between invocations, so each matching
line is only ever output once. It also finds messages in log files that
have been rotated (and possibly compressed) since the previous invoca-
tion.
%{name} also includes support for log messages that span multiple lines.
%prep
%setup -q
%build
%{configure}
make
%install
%{makeinstall}
install -d %{buildroot}%{_var}/lib/%{name}
install -d %{buildroot}%{_datadir}/doc/packages/%{name}
install COPYING %{buildroot}%{_datadir}/doc/packages/%{name}/
rm -rf %{buildroot}%{_datadir}/doc/packages/%{name}/INSTALL
%files
%attr(0755,root,root) %{_bindir}/%{name}
%attr(0644,root,root) %{_mandir}/man1/%{name}.1.gz
%defattr(0644,root,root,0755)
%{_var}/lib/%{name}
%doc %{_datadir}/doc/packages/%{name}
%package nagios-plugin
Summary: Nagios plugin based on the logwarn(1) utility
Group: System/Monitoring
Requires: bash
Requires: logwarn >= %{version}
Buildarch: noarch
%description nagios-plugin
%{name} searches for interesting messages in log files, where ``interest-
ing'' is defined by an user-supplied list of positive and negative (pre-
ceeded with a ``!'') extended regular expressions provided on the command
line.
This package contains the Nagios plugin that is based on %{name}.
%files nagios-plugin
%defattr(0755,root,root,0755)
# avoid build dependecy of nagios - own the dirs
%dir %{nagios_libdir}
%dir %{nagios_plugindir}
%{nagios_plugindir}/check_logwarn
%changelog