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