--- /dev/null
+--- monit-5.9/monitrc 2014-10-27 17:33:09.741090635 +0200
++++ monit-5.9/monitrc 2014-10-27 17:35:35.171362348 +0200
+@@ -51,7 +51,8 @@
+ ## specified using a comma separator. If the first mail server fails, Monit
+ # will use the second mail server in the list and so on. By default Monit uses
+ # port 25 - it is possible to override this with the PORT option.
+-#
++
++set mailserver localhost
+ # set mailserver mail.bar.baz, # primary mailserver
+ # backup.bar.baz port 10025, # backup mailserver on port 10025
+ # localhost # fallback relay
+@@ -108,9 +109,9 @@
+ ## You can set alert recipients whom will receive alerts if/when a
+ ## service defined in this file has errors. Alerts may be restricted on
+ ## events by using a filter as in the second example below.
+-#
+-# set alert sysadm@foo.bar # receive all alerts
+-#
++
++set alert root@localhost # receive all alerts
++
+ ## Do not alert when Monit starts, stops or performs a user initiated action.
+ ## This filter is recommended to avoid getting alerts for trivial cases.
+ #
+@@ -256,3 +257,2 @@
+-#
+-# include /etc/monit.d/*
+-#
++
++include /etc/monit/*.monitrc
-#
Summary: Process monitor and restart utility
Summary(pl.UTF-8): Narzędzie do monitorowania procesów i ich restartowania
Name: monit
-Version: 5.3.2
+Version: 5.9
Release: 1
-License: GPL v3+
+License: AGPL v3
Group: Daemons
Source0: http://mmonit.com/monit/dist/%{name}-%{version}.tar.gz
-# Source0-md5: 8bc077e3c289b2ad54360cc63914c4e5
+# Source0-md5: 808473ebbacda0c5085d7399e507bfda
Source1: %{name}.init
Source2: %{name}rc
Source3: %{name}.config
+Patch0: config.patch
URL: http://mmonit.com/monit/
BuildRequires: bison
BuildRequires: flex
%prep
%setup -q
+%patch0 -p1
%build
%configure \
+ --bindir=%{_sbindir} \
--with-ssl-lib-dir=%{_libdir}
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,monit,sysconfig},%{_sbindir}}
-
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,monit,sysconfig}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
+cp -p %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/monit
+
+cp -p monitrc $RPM_BUILD_ROOT%{_sysconfdir}/monitrc
# NOTE: 'include *.monitrc' will fail if nothing matches the glob.
-install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/monitrc
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/sysconfig/monit
-install monitrc $RPM_BUILD_ROOT%{_sysconfdir}/monit/default.monitrc
-mv $RPM_BUILD_ROOT{%{_bindir},%{_sbindir}}/monit
+# so install dummy config not to remove it with upgrades (avoid .rpmsave)
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/monit/default.monitrc
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc CHANGES README*
-%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}rc
-%dir %attr(751,root,root) %{_sysconfdir}/monit
-%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/monit
+%doc CONTRIBUTORS README*
+%attr(600,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/monitrc
+%dir %attr(751,root,root) %{_sysconfdir}/%{name}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default.monitrc
-%attr(755,root,root) %{_sbindir}/monit
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/monit
%attr(754,root,root) /etc/rc.d/init.d/%{name}
-%{_mandir}/man?/*
+%attr(755,root,root) %{_sbindir}/monit
+%{_mandir}/man1/monit.1*
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
-##
-
-include /etc/monit/*.monitrc
-
-###############################################################################
-## Global section
-###############################################################################
-##
-
-## Set list of mailservers for alert delivery. Multiple servers may be
-## specified using comma separator. By default monit uses port 25 - it is
-## possible to override it with the PORT option.
-#
-set mailserver localhost # primary mailserver
-
-## You can set the alert recipients here, which will receive the alert for
-## each service. The event alerts may be restricted using the list.
-#
-set alert root@localhost # receive all alerts
-
-## Monit has an embedded webserver, which can be used to view the
-## configuration, actual services parameters or manage the services using the
-## web interface.
-#
-set httpd port 2812 and
- use address localhost # only accept connection from localhost
- allow localhost # allow localhost to connect to the server and
- allow admin:monit # require user 'admin' with password 'monit'