]>
Commit | Line | Data |
---|---|---|
1 | %include /usr/lib/rpm/macros.perl | |
2 | Summary: Simple mail statistics for Postfix | |
3 | Summary(pl.UTF-8): Proste statystyki dla Postfiksa | |
4 | Name: mailgraph | |
5 | Version: 1.14 | |
6 | Release: 2.7 | |
7 | License: GPL v2 | |
8 | Group: Applications/Networking | |
9 | Source0: http://mailgraph.schweikert.ch/pub/%{name}-%{version}.tar.gz | |
10 | # Source0-md5: 0f0ae91968ea7ae0c1d14985c560530b | |
11 | Source1: %{name}.init | |
12 | Source2: %{name}.sysconfig | |
13 | Source3: %{name}.conf | |
14 | Source4: lighttpd.conf | |
15 | Patch0: %{name}-paths.patch | |
16 | Patch1: %{name}-postfix_rbl.patch | |
17 | Patch2: clamd-enable.patch | |
18 | URL: http://mailgraph.schweikert.ch/ | |
19 | BuildRequires: perl-tools-pod | |
20 | BuildRequires: rpm-perlprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.268 | |
22 | Requires(post,preun): /sbin/chkconfig | |
23 | Requires(triggerpostun): sed >= 4.0 | |
24 | Requires: postfix | |
25 | Requires: rc-scripts | |
26 | BuildArch: noarch | |
27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
28 | ||
29 | %define _webapps /etc/webapps | |
30 | %define _webapp %{name} | |
31 | %define _sysconfdir %{_webapps}/%{_webapp} | |
32 | %define _appdir %{_prefix}/lib/cgi-bin/%{_webapp} | |
33 | %define _pkglibdir /var/lib/%{name} | |
34 | ||
35 | %description | |
36 | Mailgraph is a very simple mail statistics RRDtool frontend for | |
37 | Postfix that produces daily, weekly, monthly and yearly graphs of | |
38 | received/sent and bounced/rejected mail. | |
39 | ||
40 | %description -l pl.UTF-8 | |
41 | Mailgraph to prosty frontend na RRDtool do statystyk pocztowych dla | |
42 | Postfiksa. Produkuje wykresy dzienne, tygodniowe, miesięczne i roczne | |
43 | poczty wysłanej/odebranej i odbitej/odrzuconej. | |
44 | ||
45 | %package cgi | |
46 | Summary: CGI script for displaying mailgraph rrd data | |
47 | Group: Applications/WWW | |
48 | Requires: %{name} = %{version}-%{release} | |
49 | Requires: webapps | |
50 | Requires: webserver | |
51 | Requires: webserver(cgi) | |
52 | Requires: webserver(expires) | |
53 | ||
54 | %description cgi | |
55 | CGI script for displaying mailgraph rrd data. | |
56 | ||
57 | %prep | |
58 | %setup -q | |
59 | %patch0 -p1 | |
60 | %patch1 -p1 | |
61 | %patch2 -p1 | |
62 | ||
63 | %build | |
64 | pod2man mailgraph.pl > mailgraph.1 | |
65 | ||
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
68 | install -d $RPM_BUILD_ROOT{/etc/{rc.d/init.d,sysconfig},%{_sysconfdir},%{_sbindir},%{_mandir}/man1} \ | |
69 | $RPM_BUILD_ROOT{%{_appdir},%{_pkglibdir}/img,/var/log} | |
70 | ||
71 | install -p mailgraph.cgi $RPM_BUILD_ROOT%{_appdir}/index.cgi | |
72 | install -p mailgraph.pl $RPM_BUILD_ROOT%{_sbindir}/mailgraph.pl | |
73 | install -p %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} | |
74 | cp -a mailgraph.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
75 | cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/mailgraph | |
76 | touch $RPM_BUILD_ROOT/var/log/mailgraph.log | |
77 | ||
78 | # cgi app | |
79 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/apache.conf | |
80 | cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
81 | cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
82 | cp -a mailgraph.css $RPM_BUILD_ROOT%{_sysconfdir}/mailgraph.css | |
83 | ln -sf %{_sysconfdir}/mailgraph.css $RPM_BUILD_ROOT%{_appdir}/mailgraph.css | |
84 | ||
85 | %clean | |
86 | rm -rf $RPM_BUILD_ROOT | |
87 | ||
88 | %post | |
89 | /sbin/chkconfig --add %{name} | |
90 | %service %{name} restart | |
91 | if [ ! -f /var/log/mailgraph.log ]; then | |
92 | touch /var/log/mailgraph.log | |
93 | chown http /var/log/mailgraph.log | |
94 | fi | |
95 | ||
96 | %preun | |
97 | if [ "$1" = "0" ]; then | |
98 | %service %{name} stop | |
99 | /sbin/chkconfig --del %{name} | |
100 | fi | |
101 | ||
102 | %triggerin cgi -- apache1 < 1.3.37-3, apache1-base | |
103 | %webapp_register apache %{_webapp} | |
104 | ||
105 | %triggerun cgi -- apache1 < 1.3.37-3, apache1-base | |
106 | %webapp_unregister apache %{_webapp} | |
107 | ||
108 | %triggerin cgi -- apache < 2.2.0, apache-base | |
109 | %webapp_register httpd %{_webapp} | |
110 | ||
111 | %triggerun cgi -- apache < 2.2.0, apache-base | |
112 | %webapp_unregister httpd %{_webapp} | |
113 | ||
114 | %triggerin cgi -- lighttpd | |
115 | %webapp_register lighttpd %{_webapp} | |
116 | ||
117 | %triggerun cgi -- lighttpd | |
118 | %webapp_unregister lighttpd %{_webapp} | |
119 | ||
120 | %triggerpostun -- %{name} < 1.14-2.1 | |
121 | chown http:http %{_pkglibdir}/*.rrd | |
122 | ||
123 | %files | |
124 | %defattr(644,root,root,755) | |
125 | %doc README CHANGES | |
126 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/mailgraph | |
127 | %attr(754,root,root) /etc/rc.d/init.d/mailgraph | |
128 | %attr(755,root,root) %{_sbindir}/mailgraph.pl | |
129 | %{_mandir}/man1/mailgraph.1* | |
130 | %attr(770,root,http) %dir %{_pkglibdir} | |
131 | %ghost /var/log/mailgraph.log | |
132 | ||
133 | %files cgi | |
134 | %defattr(644,root,root,755) | |
135 | %dir %attr(750,root,http) %{_sysconfdir} | |
136 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/apache.conf | |
137 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
138 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
139 | %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/mailgraph.css | |
140 | %dir %{_appdir} | |
141 | %attr(755,root,root) %{_appdir}/index.cgi | |
142 | %{_appdir}/mailgraph.css | |
143 | %attr(775,root,http) %dir %{_pkglibdir}/img |