]>
Commit | Line | Data |
---|---|---|
569cdae1 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without pam # PAM support | |
4 | %bcond_without ssl # SSL support | |
5 | ||
ed5da8a8 ER |
6 | # NOTES: |
7 | # - Release notes: https://mmonit.com/monit/changes/ | |
8 | ||
fdb71f6a | 9 | Summary: Process monitor and restart utility |
e78603a4 | 10 | Summary(pl.UTF-8): Narzędzie do monitorowania procesów i ich restartowania |
14b3c34c | 11 | Name: monit |
da18c754 | 12 | Version: 5.15 |
3b334ee3 | 13 | Release: 2 |
4b7f41ce | 14 | License: AGPL v3 |
6cefd882 | 15 | Group: Daemons |
e0057d64 | 16 | Source0: http://mmonit.com/monit/dist/%{name}-%{version}.tar.gz |
da18c754 | 17 | # Source0-md5: c723745298d7ba6d28194b9f25eba6fe |
14b3c34c | 18 | Source1: %{name}.init |
6f726317 | 19 | Source2: %{name}rc |
e09b5b4a | 20 | Source3: %{name}.config |
4b7f41ce | 21 | Patch0: config.patch |
e0057d64 | 22 | URL: http://mmonit.com/monit/ |
fdb71f6a AM |
23 | BuildRequires: bison |
24 | BuildRequires: flex | |
569cdae1 ER |
25 | %{?with_ssl:BuildRequires: openssl-devel >= 0.9.7d} |
26 | %{?with_pam:BuildRequires: pam-devel} | |
3d130d51 | 27 | BuildRequires: rpmbuild(macros) >= 1.268 |
14b3c34c | 28 | Requires(post,preun): /sbin/chkconfig |
976db287 | 29 | Requires: rc-scripts >= 0.4.0.15 |
fdb71f6a AM |
30 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
31 | ||
32 | %description | |
33 | monit is an utility for monitoring daemons or similar programs running | |
34 | on a Unix system. It will start specified programs if they are not | |
35 | running and restart programs not responding. | |
36 | ||
b8a62915 JR |
37 | %description -l pl.UTF-8 |
38 | monit jest narzędziem do monitorowania demonów oraz podobnych | |
39 | programów pracujących w systemie Unix. monit zrestartuje podany | |
40 | program w momencie gdy przestaje on pracować lub w momencie gdy | |
41 | program przestaje odpowiadać. | |
fdb71f6a AM |
42 | |
43 | %prep | |
03278c9b | 44 | %setup -q |
4b7f41ce | 45 | %patch0 -p1 |
fdb71f6a AM |
46 | |
47 | %build | |
3d086971 | 48 | %configure \ |
4b7f41ce | 49 | --bindir=%{_sbindir} \ |
569cdae1 ER |
50 | %{__with_without ssl} \ |
51 | %{__with_without pam} \ | |
3d086971 | 52 | --with-ssl-lib-dir=%{_libdir} |
fdb71f6a AM |
53 | %{__make} |
54 | ||
55 | %install | |
56 | rm -rf $RPM_BUILD_ROOT | |
4b7f41ce | 57 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,monit,sysconfig} |
fdb71f6a AM |
58 | %{__make} install \ |
59 | DESTDIR=$RPM_BUILD_ROOT | |
60 | ||
4b7f41ce ER |
61 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} |
62 | cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/monit | |
63 | ||
64 | cp -p monitrc $RPM_BUILD_ROOT%{_sysconfdir}/monitrc | |
6f726317 | 65 | # NOTE: 'include *.monitrc' will fail if nothing matches the glob. |
4b7f41ce ER |
66 | # so install dummy config not to remove it with upgrades (avoid .rpmsave) |
67 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/monit/default.monitrc | |
fdb71f6a AM |
68 | |
69 | %clean | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | ||
72 | %post | |
73 | /sbin/chkconfig --add %{name} | |
3d130d51 | 74 | %service monit restart "Monit Daemon" |
fdb71f6a AM |
75 | |
76 | %preun | |
77 | if [ "$1" = "0" ]; then | |
3d130d51 | 78 | %service monit stop |
14ec2da6 | 79 | /sbin/chkconfig --del %{name} |
fdb71f6a AM |
80 | fi |
81 | ||
82 | %files | |
83 | %defattr(644,root,root,755) | |
4b7f41ce ER |
84 | %doc CONTRIBUTORS README* |
85 | %attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monitrc | |
86 | %dir %attr(751,root,root) %{_sysconfdir}/%{name} | |
6f726317 | 87 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default.monitrc |
4b7f41ce | 88 | %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/monit |
fdb71f6a | 89 | %attr(754,root,root) /etc/rc.d/init.d/%{name} |
4b7f41ce ER |
90 | %attr(755,root,root) %{_sbindir}/monit |
91 | %{_mandir}/man1/monit.1* |