1 %include /usr/lib/rpm/macros.perl
2 Summary: Simple mail statistics for Postfix
3 Summary(pl): Proste statystyki dla Postfiksa
8 Group: Applications/Networking
9 Group(de): Applikationen/Netzwerkwesen
10 Group(pl): Aplikacje/Sieciowe
11 Source0: %{name}-%{version}.tar.gz
14 Patch0: %{name}-paths.patch
15 URL: http://people.ee.ethz.ch/~dws/software/mailgraph/
16 Prereq: /sbin/chkconfig
20 Requires: apache-mod_expires
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
24 %define _pkglibdir /var/lib/%{name}
27 Mailgraph is a very simple mail statistics RRDtool frontend for
28 Postfix that produces daily, weekly, monthly and yearly graphs of
29 received/sent and bounced/rejected mail.
32 Mailgraph to prosty frontend na RRDtool do statystyk pocztowych dla
33 Postfiksa. Produkuje wykresy dzienne, tygodniowe, miesiêczne i roczne
34 poczty wys³anej/odebranej i odbitej/odrzuconej.
41 rm -rf $RPM_BUILD_ROOT
43 install -d $RPM_BUILD_ROOT{%{_pkglibdir},/etc/rc.d/init.d,/etc/httpd,/home/httpd/html/mailgraph,/home/httpd/html/mailgraph/imgs,%{_bindir}}
45 install mailgraph.cgi $RPM_BUILD_ROOT/home/httpd/html/mailgraph/mailgraph.cgi
46 install mailgraph.pl $RPM_BUILD_ROOT%{_bindir}/mailgraph.pl
48 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
49 install %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
51 gzip -9nf README CHANGES
54 /sbin/chkconfig --add %{name}
55 if [ -f %{_sysconfdir}/httpd/httpd.conf ] && \
56 ! grep -q "^Include.*/%{name}.conf" %{_sysconfdir}/httpd/httpd.conf; then
57 echo "Include %{_sysconfdir}/httpd/%{name}.conf" >> %{_sysconfdir}/httpd/httpd.conf
58 if [ -f /var/lock/subsys/httpd ]; then
59 /etc/rc.d/init.d/httpd restart 1>&2
62 if [ -f /var/lock/subsys/%{name} ]; then
63 /etc/rc.d/init.d/%{name} restart 1>&2
65 echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
69 if [ "$1" = "0" ]; then
70 grep -E -v "^Include.*%{name}.conf" %{_sysconfdir}/httpd/httpd.conf > \
71 %{_sysconfdir}/httpd/httpd.conf.tmp
72 mv -f %{_sysconfdir}/httpd/httpd.conf.tmp %{_sysconfdir}/httpd/httpd.conf
73 if [ -f /var/lock/subsys/httpd ]; then
74 /etc/rc.d/init.d/httpd restart 1>&2
76 if [ -f /var/lock/subsys/%{name} ]; then
77 /etc/rc.d/init.d/%{name} stop 1>&2
79 /sbin/chkconfig --del %{name}
83 rm -rf $RPM_BUILD_ROOT
86 %defattr(644,root,root,755)
87 %attr(755,root,root) %{_bindir}/mailgraph.pl
88 %attr(755,root,root) /home/httpd/html/mailgraph/mailgraph.cgi
89 %attr(754,root,root) /etc/rc.d/init.d/mailgraph
90 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/httpd/mailgraph.conf
92 %attr(771,root,http) %dir /home/httpd/html/mailgraph/imgs