]> git.pld-linux.org Git - packages/monit.git/blob - monit.spec
1bf97418c007427999b3c36046a478851a865552
[packages/monit.git] / monit.spec
1 # TODO
2 # - package systemd units
3 #
4 # Conditional build:
5 %bcond_without  pam             # PAM support
6 %bcond_without  ssl             # SSL support
7
8 # NOTES:
9 # - Release notes: https://mmonit.com/monit/changes/
10
11 Summary:        Process monitor and restart utility
12 Summary(pl.UTF-8):      Narzędzie do monitorowania procesów i ich restartowania
13 Name:           monit
14 Version:        5.19.0
15 Release:        1
16 License:        AGPL v3
17 Group:          Daemons
18 Source0:        http://mmonit.com/monit/dist/%{name}-%{version}.tar.gz
19 # Source0-md5:  51ee50dd71e1bb9fe9a128bc88456b77
20 Source1:        %{name}.init
21 Source2:        %{name}rc
22 Source3:        %{name}.config
23 Patch0:         config.patch
24 URL:            http://mmonit.com/monit/
25 BuildRequires:  bison
26 BuildRequires:  flex
27 %{?with_ssl:BuildRequires:      openssl-devel >= 0.9.7d}
28 %{?with_pam:BuildRequires:      pam-devel}
29 BuildRequires:  rpmbuild(macros) >= 1.268
30 Requires(post,preun):   /sbin/chkconfig
31 Requires:       rc-scripts >= 0.4.0.15
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
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ć.
44
45 %prep
46 %setup -q
47 %patch0 -p1
48
49 %build
50 %configure \
51         --bindir=%{_sbindir} \
52         %{__with_without ssl} \
53         %{__with_without pam} \
54         --with-ssl-lib-dir=%{_libdir}
55 %{__make}
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
59 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,monit,sysconfig}
60 %{__make} install \
61         DESTDIR=$RPM_BUILD_ROOT
62
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
67 # NOTE: 'include *.monitrc' will fail if nothing matches the glob.
68 # so install dummy config not to remove it with upgrades (avoid .rpmsave)
69 cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/monit/default.monitrc
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
74 %post
75 /sbin/chkconfig --add %{name}
76 %service monit restart "Monit Daemon"
77
78 %preun
79 if [ "$1" = "0" ]; then
80         %service monit stop
81         /sbin/chkconfig --del %{name}
82 fi
83
84 %files
85 %defattr(644,root,root,755)
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}
89 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}/default.monitrc
90 %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/monit
91 %attr(754,root,root) /etc/rc.d/init.d/%{name}
92 %attr(755,root,root) %{_sbindir}/monit
93 %{_mandir}/man1/monit.1*
This page took 0.075986 seconds and 2 git commands to generate.