File monit.spec of Package monit
#
# spec file for package monit
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define bosh_dir /var/vcap/
%define bosh_prefix %{bosh_dir}/bosh
Name: monit
Version: 5.2.5
Release: 0
Summary: Monit is a small Open Source utility for managing and monitoring Unix systems
License: AGPL-3.0-only
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
Group: System/Monitoring
Url: https://bitbucket.org/tildeslash/monit/src/master/
Source: monit-5.2.5.tar.gz
Source1: validate_patch.tar.gz
Source2: monitrc.tar.gz
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: bison
BuildRequires: flex
BuildRequires: gcc
BuildRequires: glibc-devel
BuildRequires: libtool
BuildRequires: make
BuildRequires: pam-devel
BuildRequires: zlib-devel
BuildArch: x86_64
%description
Monit is a utility for managing and monitoring processes, files,
directories, and devices on a Unix system. Monit conducts automatic
maintenance and repair and can execute meaningful causal actions in
error situations. For example, monit can start a process if it does
not run, restart a process if it does not respond, and stop a process
if it uses too many resources. You can use monit to monitor files,
directories, and devices for changes, such as time stamp changes,
checksum changes, or size changes. You can even use monit to monitor
remote hosts: monit can ping a remote host and check port connections.
%prep
%setup -q
%setup -T -D -a 1
%setup -T -D -a 2
mkdir -p %{buildroot}%{bosh_dir}
%build
patch -p 1 < validate.patch
%configure \
--prefix=%{bosh_prefix} \
--exec-prefix=%{bosh_prefix} \
--bindir=%{bosh_prefix}/bin \
--sbindir=%{bosh_prefix}/sbin \
--sysconfdir=%{bosh_prefix}/etc \
--datadir=%{bosh_prefix}/share \
--mandir=%{bosh_prefix}/share/man \
--without-ssl
set -o monitor
#%make_build
make
mkdir -p %{buildroot}%{bosh_dir}/monit
touch %{buildroot}%{bosh_dir}/monit/empty.monitrc
mkdir -p %{buildroot}%{bosh_prefix}/etc
#touch %{buildroot}%{bosh_prefix}/monitrc
cp monitrc %{buildroot}%{bosh_prefix}/monitrc
#TODO Add the monitrc?
#mkdir -p %{buildroot}%{bosh_prefix}/src
#cp %{Source} %{buildroot}%{bosh_prefix}/src
%install
%make_install
%post
%postun
%files
%license COPYING
%doc README
%{bosh_dir}/*
%changelog