Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > e47e4d9d2310e4690d16c2b5a807482a > files > 5

mailgraph-1.12-1mdk.src.rpm

Summary:	Mailgraph - a RRDtool frontend for Mail statistics
Name:		mailgraph
Version:	1.12
Release:	%mkrel 1
License:	GPL
Group:		System/Servers
URL:		http://people.ee.ethz.ch/~dws/software/mailgraph/
Source0:	http://people.ee.ethz.ch/~dws/software/mailgraph/pub/%{name}-%{version}.tar.bz2
Patch0:		mailgraph-1.12-mdv_config.diff
Source1:	mailgraph.init.bz2
Source2:	mailgraph.sysconfig.bz2
Source3:	mailgraph.logrotate.bz2
Requires(post): rpm-helper
Requires(preun): rpm-helper
Requires(pre):	webserver
Requires:	rrdtool
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-buildroot

%description
Mailgraph is a very simple mail statistics RRDtool frontend for Postfix and
Sendmail that produces daily, weekly, monthly and yearly graphs of
received/sent and bounced/rejected mail.

%prep

%setup -q -n %{name}-%{version}
%patch0 -p1

bzcat %{SOURCE1} > %{name}.init
bzcat %{SOURCE2} > %{name}.sysconfig
bzcat %{SOURCE3} > %{name}.logrotate

%build

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

# don't fiddle with the initscript!
export DONT_GPRINTIFY=1

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_localstatedir}/%{name}
install -d %{buildroot}/var/run/%{name}
install -d %{buildroot}/var/log/%{name}
install -d %{buildroot}/var/cache/%{name}
install -d %{buildroot}/var/www/cgi-bin

install -m0755 %{name}.pl %{buildroot}%{_sbindir}/%{name}
install -m0755 %{name}.cgi %{buildroot}/var/www/cgi-bin/
install -m0755 %{name}.init %{buildroot}%{_initrddir}/%{name}
install -m0644 %{name}.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -m0644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}

%post
%_post_service %{name}

%preun
%_preun_service %{name}

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files 
%defattr(-,root,root)
%doc README CHANGES COPYING
%attr(0755,root,root) %{_initrddir}/%{name}
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%attr(0755,root,root) %{_sbindir}/%{name}
%attr(0755,root,root) /var/www/cgi-bin/%{name}.cgi
%dir %attr(0755,root,root) /var/run/%{name}
%dir %attr(0755,root,root) /var/log/%{name}
%dir %attr(0755,root,root) /var/cache/%{name}
%dir %attr(0755,root,root) %{_localstatedir}/%{name}

%changelog
* Fri Apr 28 2006 Oden Eriksson <oeriksson@mandriva.com> 1.12-1mdk
- initial Mandriva package (spec file fragments by Zeck, also 
  from the bindgraph spec file)