3 # - write %post script with display short activatuion instruction
4 # depending on information is httpd cnfig file is vanilla or not,
6 %include /usr/lib/rpm/macros.perl
7 Summary: Simple mail statistics for Postfix
8 Summary(pl): Proste statystyki dla Postfiksa
13 Group: Applications/Networking
14 Source0: http://people.ee.ethz.ch/~dws/software/mailgraph/pub/%{name}-%{version}.tar.gz
15 # Source0-md5: f06cf84a49479529e9d280e78b7b34a9
17 Source2: %{name}.sysconfig
19 Patch0: %{name}-paths.patch
20 Patch1: %{name}-postfix_rbl.patch
21 URL: http://people.ee.ethz.ch/~dws/software/mailgraph/
23 Requires(post,preun): /sbin/chkconfig
24 Requires(post,preun): grep
25 Requires(preun): fileutils
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define _pkglibdir /var/lib/%{name}
31 %define _httpappsdir %{_datadir}/%{name}
34 Mailgraph is a very simple mail statistics RRDtool frontend for
35 Postfix that produces daily, weekly, monthly and yearly graphs of
36 received/sent and bounced/rejected mail.
39 Mailgraph to prosty frontend na RRDtool do statystyk pocztowych dla
40 Postfiksa. Produkuje wykresy dzienne, tygodniowe, miesiêczne i roczne
41 poczty wys³anej/odebranej i odbitej/odrzuconej.
49 rm -rf $RPM_BUILD_ROOT
50 install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig,httpd},%{_bindir}} \
51 $RPM_BUILD_ROOT{%{_httpappsdir},%{_pkglibdir}}
53 install mailgraph.cgi $RPM_BUILD_ROOT%{_httpappsdir}/index.cgi
54 install mailgraph.pl $RPM_BUILD_ROOT%{_bindir}/mailgraph.pl
56 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
57 install %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mailgraph
58 install %{SOURCE3} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
61 rm -rf $RPM_BUILD_ROOT
64 /sbin/chkconfig --add %{name}
65 if [ -f /etc/httpd/httpd.conf ] && \
66 ! grep -q "^Include.*/%{name}.conf" /etc/httpd/httpd.conf; then
67 echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
68 if [ -f /var/lock/subsys/httpd ]; then
69 /etc/rc.d/init.d/httpd restart 1>&2
72 if [ -f /var/lock/subsys/%{name} ]; then
73 /etc/rc.d/init.d/%{name} restart 1>&2
75 echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
79 if [ "$1" = "0" ]; then
81 grep -E -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
82 /etc/httpd/httpd.conf.tmp
83 mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
84 if [ -f /var/lock/subsys/httpd ]; then
85 /etc/rc.d/init.d/httpd restart 1>&2
87 if [ -f /var/lock/subsys/%{name} ]; then
88 /etc/rc.d/init.d/%{name} stop 1>&2
90 /sbin/chkconfig --del %{name}
94 %defattr(644,root,root,755)
96 %attr(755,root,root) %{_bindir}/mailgraph.pl
97 %attr(754,root,root) /etc/rc.d/init.d/mailgraph
98 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/sysconfig/mailgraph
99 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/httpd/mailgraph.conf
101 %attr(755,root,root) %{_httpappsdir}/index.cgi
102 %attr(750,root,http) %dir %{_pkglibdir}