Sophie

Sophie

distrib > Mandriva > 10.1 > i586 > by-pkgid > 42670c55c3914596d9b6b1fc7dbabc9a > files > 3

echelog-0.6.2-3mdk.src.rpm

%define name echelog
%define version 0.6.2
%define release 3mdk

Name: %name
Version: %version
Release: %release
Summary: Echelog is distributed agent/server monitoring system
License: MIT
Group: Monitoring
URL: http://echelog.sf.net/
Source: http://echelog.sf.net/snapshots/echelog-%{version}.tar.bz2
Patch0: echelog-0.6.2-gcc34.patch.bz2    
Buildrequires: flex libopenssl0.9.7-devel zlib-devel gawk
BuildRoot: %{_tmppath}/%{name}-%{version}
Requires: /bin/ksh

%description
Echelog is a distributed system consisting of one or more agents and one or
more servers. The data are gathered by multiple agents, distributed on computer
network and sent to a server (or more servers) in order to store them for
future processing. This system is intended for a network with system agents
running on each computer and in case something goes wrong (hardware/software
failure, system security compromise ...) there is always entry in server's log
containing information about what exactly happened before the accident. Or you
can simply use gathered data for statistical information and resource
utilization of your network. 

%prep
rm -rf $RPM_BUILD_ROOT

%setup
%patch0 -p0

%build

CXXFLAGS="$RPM_OPT_FLAGS -fpermissive" %configure 

%make

%install
make install \
     prefix=%{buildroot}/usr \
     sysconfdir=%{buildroot}/etc \
     localstatedir=%{buildroot}/var \
     bindir=%{buildroot}/usr/bin \
     sbindir=%{buildroot}/usr/sbin

mkdir -p "$RPM_BUILD_ROOT"/etc/rc.d/init.d/

cp contrib/init "$RPM_BUILD_ROOT"/etc/rc.d/init.d/echelog

%clean
rm -rf $RPM_BUILD_ROOT

%pre
# add group echelog if not found
grep -q ^echelog: /etc/group || {
    groupadd -r echelog || {
       echo "ERROR: Can't add group echelog, aborting install" >&2
       exit 1
    }
}

# add user echelog if not found
grep -q ^echelog: /etc/passwd || {
   useradd -d /var/cache/echelog -g echelog -M -r echelog || {
       echo "ERROR: Can't add user echelog, aborting install" >&2
       exit 1
    }
}

# add user echelogc (Echelog admin) if not found
grep -q ^echelogc: /etc/passwd || {
   useradd echelogc || {
       echo "ERROR: Can't add user echelogc, aborting install" >&2
       exit 1
    }
}

%post
if [ "$1" = 1 -o ! -f /etc/echelog/install.state ] ; then
echo 
echo "Run ./setup-wizard.sh in %_docdir/%name-%version/ directory"
echo
fi

%files 
%defattr (-,root,root)
%doc COPYING AUTHORS INSTALL README setup-wizard.sh README.QuickStart ChangeLog
%attr(0750, root, echelog) %config(noreplace) /etc/echelog/modules/keys
%attr(0755, root, root) %config /etc/rc.d/init.d/echelog
%config(noreplace) /etc/echelog/*.conf
%config /etc/echelog/templates
%attr(0755, echelog, echelog)/var/lib/echelog/*
%attr(0750, echelog, echelog)/var/log/echelog
%attr(0750, echelog, echelog)/var/cache/*
%_bindir/*
%_sbindir/*

%changelog
* Wed Jun 30 2004 Thierry Vignaud <tvignaud@mandrakesoft.com> 0.6.2-3mdk
- rebuild with new g++
- patch 0: fix compiling with new g++

* Tue Apr 29 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.2-2mdk
- adjust buildrequires

* Mon Mar 10 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.2-1mdk
- 0.6.2

* Tue Jan 07 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.6.1-1mdk
- from Kamil Toman <ktoman@email.cz> :
	- added ChangeLog
	- added README.QuickStart
	- create needed users and groups
	- file permissions
	- init script

* Fri May 30 2002 Martin Macok <martin.macok@underground.cz> 0.6-1
 - rpm created