]>
Commit | Line | Data |
---|---|---|
3e055a5a ER |
1 | # |
2 | # Conditional build: | |
98cc26b4 | 3 | %bcond_with tests # build with tests |
3e055a5a ER |
4 | %bcond_with doc # build doc |
5 | ||
6 | Summary: Open Source Host, Service And Network Monitoring Program | |
7 | Name: naemon-core | |
8 | Version: 1.0.3 | |
860df76a | 9 | Release: 0.2 |
3e055a5a ER |
10 | License: GPL v2 |
11 | Group: Applications/System | |
12 | Source0: http://labs.consol.de/naemon/release/v%{version}/src/%{name}-%{version}.tar.gz | |
13 | # Source0-md5: 5eb9c6e9be29b993e8488d58f8b3de23 | |
14 | URL: http://www.naemon.org/ | |
3e055a5a | 15 | BuildRequires: chrpath |
3e055a5a | 16 | BuildRequires: gperf |
7383c5b0 | 17 | BuildRequires: help2man |
3e055a5a | 18 | BuildRequires: perl-ExtUtils-MakeMaker |
7383c5b0 | 19 | BuildRequires: pkgconfig |
3e055a5a ER |
20 | BuildRequires: zlib-devel |
21 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
22 | ||
98cc26b4 ER |
23 | %define plugindir %{_prefix}/lib/nagios/plugins |
24 | ||
3e055a5a ER |
25 | %description |
26 | Naemon is an application, system and network monitoring application. | |
27 | It can escalate problems by email, pager or any other medium. It is | |
28 | also useful for incident or SLA reporting. It is originally a fork of | |
29 | Nagios, but with extended functionality, stability and performance. | |
30 | ||
31 | %package devel | |
32 | Summary: Development Files For Naemon | |
33 | Group: Development/Libraries | |
34 | ||
35 | %description devel | |
36 | This package contains the header files, static libraries and | |
88b76319 ER |
37 | development documentation for naemon-core. |
38 | ||
39 | If you are a NEB-module author or wish to write addons for Naemon | |
40 | using Naemons own APIs, you should install this package. | |
3e055a5a ER |
41 | |
42 | %prep | |
43 | %setup -q | |
44 | ||
45 | %build | |
46 | %configure \ | |
04b6820c ER |
47 | --with-logrotatedir=%{_sysconfdir}/logrotate.d \ |
48 | --with-initdir=%{_initrddir} \ | |
98cc26b4 | 49 | --with-pluginsdir=%{plugindir} \ |
04b6820c ER |
50 | --localstatedir=%{_localstatedir}/lib/naemon \ |
51 | --with-checkresultdir=%{_localstatedir}/spool/naemon/checkresults \ | |
52 | %{__with_without tests} \ | |
53 | --enable-event-broker \ | |
54 | --with-naemon-user=naemon \ | |
55 | --with-naemon-group=naemon \ | |
56 | --with-mail=/bin/mail | |
3e055a5a ER |
57 | |
58 | %{__make} | |
59 | ||
60 | %install | |
61 | rm -rf $RPM_BUILD_ROOT | |
62 | %{__make} install \ | |
3e055a5a ER |
63 | INSTALL_OPTS="" \ |
64 | COMMAND_OPTS="" \ | |
98cc26b4 ER |
65 | INIT_OPTS="" \ |
66 | DESTDIR=$RPM_BUILD_ROOT | |
3e055a5a | 67 | |
04b6820c | 68 | install -d $RPM_BUILD_ROOT%{_localstatedir}/{lib/naemon,log/naemon/archives} |
3e055a5a ER |
69 | |
70 | %if %{with doc} | |
71 | ### Install documentation | |
72 | install -d $RPM_BUILD_ROOT%{_datadir}/%{name}/documentation/search | |
73 | cp -a Documentation/html/* $RPM_BUILD_ROOT%{_datadir}/%{name}/documentation | |
74 | chmod 0755 $RPM_BUILD_ROOT%{_datadir}/%{name}/documentation/search | |
75 | rm $RPM_BUILD_ROOT%{_datadir}/%{name}/documentation/installdox | |
76 | %endif | |
77 | ||
78 | # Put the new RC sysconfig in place | |
79 | install -d $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig | |
88b76319 | 80 | install -p sample-config/naemon.sysconfig $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/naemon |
3e055a5a | 81 | |
3e055a5a ER |
82 | # Install systemd entry |
83 | install -D -p daemon-systemd $RPM_BUILD_ROOT%{systemdunitdir}/%{name}.service | |
84 | install -D -p naemon.tmpfiles.conf $RPM_BUILD_ROOT%{systemdtmpfilesdir}/%{name}.conf | |
85 | # Move SystemV init-script | |
86 | #mv -f $RPM_BUILD_ROOT%{_initrddir}/%{name} $RPM_BUILD_ROOT%{_bindir}/%{name}-ctl | |
87 | ||
88 | %clean | |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
04b6820c ER |
91 | %post -p /sbin/ldconfig |
92 | %postun -p /sbin/ldconfig | |
93 | ||
3e055a5a ER |
94 | %files |
95 | %defattr(644,root,root,755) | |
96 | %doc README.md | |
88b76319 | 97 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/naemon |
3e055a5a | 98 | %attr(754,root,root) /etc/rc.d/init.d/naemon |
04b6820c ER |
99 | %attr(755,root,root) %{_libdir}/libnaemon.so.*.*.* |
100 | %ghost %{_libdir}/libnaemon.so.0 | |
3e055a5a ER |
101 | %attr(755,root,root) %{_bindir}/naemon |
102 | %attr(755,root,root) %{_bindir}/naemonstats | |
103 | %attr(755,root,root) %{_bindir}/oconfsplit | |
104 | %attr(755,root,root) %{_bindir}/shadownaemon | |
105 | %{_mandir}/man8/naemon.8* | |
106 | %{_mandir}/man8/naemonstats.8* | |
107 | %{_mandir}/man8/oconfsplit.8* | |
108 | %{_mandir}/man8/shadownaemon.8* | |
109 | %{systemdunitdir}/%{name}.service | |
110 | %{systemdtmpfilesdir}/%{name}.conf | |
111 | %config(noreplace) /etc/logrotate.d/naemon | |
98cc26b4 | 112 | %dir %{_sysconfdir}/naemon |
04b6820c ER |
113 | %dir %{_sysconfdir}/naemon/conf.d |
114 | %dir %{_sysconfdir}/naemon/conf.d/templates | |
3e055a5a ER |
115 | %config(noreplace) %{_sysconfdir}/naemon/naemon.cfg |
116 | %config(noreplace) %{_sysconfdir}/naemon/resource.cfg | |
04b6820c ER |
117 | %config(noreplace) %{_sysconfdir}/naemon/conf.d/*.cfg |
118 | %config(noreplace) %{_sysconfdir}/naemon/conf.d/templates/*.cfg | |
860df76a | 119 | %dir %{_localstatedir}/spool/naemon |
04b6820c ER |
120 | %attr(2775,naemon,http) %dir %{_localstatedir}/spool/naemon/checkresults |
121 | %attr(775,root,naemon) %dir %{_localstatedir}/lib/naemon | |
122 | %attr(775,root,naemon) %dir %{_localstatedir}/log/naemon | |
123 | %attr(775,root,naemon) %dir %{_localstatedir}/log/naemon/archives | |
98cc26b4 | 124 | |
3e055a5a ER |
125 | %if %{with doc} |
126 | %attr(-,root,root) %{_datadir}/%{name}/documentation | |
127 | %endif | |
3e055a5a ER |
128 | |
129 | %files devel | |
130 | %defattr(644,root,root,755) | |
131 | %{_includedir}/naemon | |
04b6820c ER |
132 | %{_libdir}/libnaemon.a |
133 | %{_libdir}/libnaemon.la | |
134 | %{_libdir}/libnaemon.so | |
88b76319 | 135 | %{_pkgconfigdir}/naemon.pc |