summaryrefslogtreecommitdiff
path: root/redhat/nagios-plugin-curl.spec
blob: 887ab56c8a18a7d3f8c36cbe4a6a2633e73db75f (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
# Nagios Plugin Curl RPM spec file
#
# Copyright (C) 2012

%define rhel 0
%define rhel5 0
%define rhel6 0
%if 0%{?rhel_version} >= 500 && 0%{?rhel_version} <= 599
%define dist rhel5
%define rhel 1
%define rhel5 1
%endif
%if 0%{?rhel_version} >= 600 && 0%{?rhel_version} <= 699
%define dist rhel6
%define rhel 1
%define rhel6 1
%endif

%define centos 0
%if 0%{?centos_version} >= 500 && 0%{?centos_version} <= 599
%define dist centos5
%define centos 1
%define rhel5 1
%endif

%if 0%{?centos_version} >= 600 && 0%{?centos_version} <= 699
%define dist centos6
%define centos 1
%define rhel6 1
%endif

%define fedora 0
%define fc14 0
%if 0%{?fedora_version} == 14
%define dist fc14
%define fc14 1
%define fedora 1
%endif
%define fc15 0  
%if 0%{?fedora_version} == 15
%define dist fc15
%define fc15 1
%define fedora 1
%endif
%define fc16 0  
%if 0%{?fedora_version} == 16
%define dist fc16
%define fc16 1   
%define fedora 1
%endif
%define fc17 0  
%if 0%{?fedora_version} == 17
%define dist fc17
%define fc17 1   
%define fedora 1
%endif
%define fc18 0  
%if 0%{?fedora_version} == 18
%define dist fc18
%define fc18 1   
%define fedora 1
%endif

%define suse 0
%if 0%{?suse_version} == 1140
%define dist osu114
%define suse 1
%endif
%if 0%{?suse_version} > 1140
%define dist osu121
%define suse 1
%endif

%define sles 0
%if 0%{?sles_version} == 11
%define dist sle11
%define sles 1
%endif

Summary: curl-based web monitoring plugin for Nagios
Name: nagios-plugin-curl
Version: 0.0.4
Release: 0.1
License: GPLv3
Group: Applications/System
Source: %{name}_%{version}.tar.gz

URL: https://github.com/andreasbaumann/nagios-plugin-curl

BuildRoot: %{_tmppath}/%{name}-root

# Build dependencies
###

%if %{rhel} || %{centos} || %{fedora}
BuildRequires: pkgconfig
%endif
%if %{suse} || %{sles}
BuildRequires: pkg-config
%endif

%if %{rhel} || %{centos} || %{fedora}
BuildRequires: curl-devel
Requires: curl
%endif

%if %{suse} || %{sles}
BuildRequires: libcurl-devel
Requires: libcurl
%endif

# Check if 'Distribution' is really set by OBS (as mentioned in bacula)
%if ! 0%{?opensuse_bs}
Distribution: %{dist}
%endif

Packager: Andreas Baumann <abaumann@yahoo.com>


%description
Nagios plugin with similar command line options and functionality
as 'check_http', but based on the cURL web library.

%prep
%setup

%build
make %{?_smp_mflags}

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/nagios/plugins/
install -D -m0755 src/check_curl $RPM_BUILD_ROOT/%{_libdir}/nagios/plugins/

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%dir /%{_libdir}/nagios/
%dir /%{_libdir}/nagios/plugins/
/%{_libdir}/nagios/plugins/check_curl

%changelog
* Wed Mar 07 2012 Andreas Baumann <abaumann@yahoo.com> 0.0.4-0.1
- added handling of cookies (for instance for JSESSIONID)
- added POST parameters

* Mon Sep 28 2009 Andreas Baumann <abaumann@yahoo.com> 0.0.3-0.1
- added client certificate and self-signed SSL chain handling

* Wed Dec 17 2008 Andreas Baumann <abaumann@yahoo.com> 0.0.2-0.1
- fixes for 64-bit, upgrade to 0.0.2

* Thu Sep 25 2008 Andreas Baumann <abaumann@yahoo.com> 0.0.1-0.1
- first preliminary packaged release