]> git.pld-linux.org Git - packages/mailgraph.git/blob - mailgraph.spec
- pl description, cosmetics
[packages/mailgraph.git] / mailgraph.spec
1 %include        /usr/lib/rpm/macros.perl
2 Summary:        Simple mail statistics for Postfix
3 Summary(pl):    Proste statystyki dla Postfiksa
4 Name:           mailgraph
5 Version:        0.17
6 Release:        1
7 License:        GPL
8 Group:          Applications/Networking
9 Group(de):      Applikationen/Netzwerkwesen
10 Group(pl):      Aplikacje/Sieciowe
11 Source0:        %{name}-%{version}.tar.gz
12 Source1:        %{name}.init
13 Source2:        %{name}.conf
14 Patch0:         %{name}-paths.patch
15 URL:            http://people.ee.ethz.ch/~dws/software/mailgraph/
16 Prereq:         /sbin/chkconfig
17 Prereq:         rc-scripts
18 Prereq:         grep
19 Requires:       postfix
20 Requires:       apache-mod_expires
21 Provides:       %{name}
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %define         _pkglibdir              /var/lib/%{name}
25
26 %description
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.
30
31 %description -l pl
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.
35
36 %prep
37 %setup  -q
38 %patch0 -p1
39
40 %install
41 rm -rf $RPM_BUILD_ROOT
42
43 install -d $RPM_BUILD_ROOT{%{_pkglibdir},/etc/rc.d/init.d,/etc/httpd,/home/httpd/html/mailgraph,/home/httpd/html/mailgraph/imgs,%{_bindir}}
44
45 install mailgraph.cgi $RPM_BUILD_ROOT/home/httpd/html/mailgraph/mailgraph.cgi
46 install mailgraph.pl $RPM_BUILD_ROOT%{_bindir}/mailgraph.pl
47
48 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}
49 install %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/%{name}.conf
50
51 gzip -9nf README CHANGES
52
53 %post
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
60         fi
61 fi
62 if [ -f /var/lock/subsys/%{name} ]; then
63         /etc/rc.d/init.d/%{name} restart 1>&2
64 else
65         echo "Run \"/etc/rc.d/init.d/%{name} start\" to start %{name} daemon."
66 fi
67
68 %preun
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
75         fi
76         if [ -f /var/lock/subsys/%{name} ]; then
77                 /etc/rc.d/init.d/%{name} stop 1>&2
78         fi
79         /sbin/chkconfig --del %{name}
80 fi
81
82 %clean
83 rm -rf $RPM_BUILD_ROOT
84
85 %files
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
91 %dir %{_pkglibdir}
92 %attr(771,root,http) %dir /home/httpd/html/mailgraph/imgs
93 %doc *.gz
This page took 0.029132 seconds and 3 git commands to generate.