]> git.pld-linux.org Git - packages/amavis-stats.git/blob - amavis-stats.spec
d5c7ca1530e0d025c3d8fab594eca8e9be6127f7
[packages/amavis-stats.git] / amavis-stats.spec
1 %include        /usr/lib/rpm/macros.perl
2 Summary:        Simple amavisd-new statistics generator
3 Summary(pl):    Prosty generator statystyk dla amavisd-new
4 Name:           amavis-stats
5 Version:        0.1.12
6 Release:        1
7 License:        GPL
8 Group:          Applications/System
9 Source0:        http://rekudos.net/download/%{name}-%{version}.tar.gz
10 # Source0-md5:  b85063b3bb8ecdb03d1b7aebf0c0a6cd
11 Source1:        %{name}.cron
12 Patch0:         %{name}-gzip.patch
13 Patch1:         %{name}-more_ac.patch
14 URL:            http://rekudos.net/amavis-stats/
15 BuildArch:      noarch
16 Provides:       %{name}-%{version}-%{release}
17 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
18
19 %define         _pkglibdir              /var/lib/%{name}
20 %define         _phpdir                 /usr/share/%{name}
21
22 %description
23 amavis-stats is a simple amavis statistics generator based on rrdtool.
24 It produces graphs from amavisd-new log entries of infections broken
25 down by virus.
26
27 %description -l pl
28 amavis-stats jest prostym generatorem statystyk opartym na rrdtool.
29 Tworzy wykresy zainfekowanych wiadomo¶ci, w rozbiciu na poszczególne
30 wirusy, na podstawie logów amavisd-new.
31
32 %package php
33 Summary:        PHP interface for amavis-stats
34 Summary(pl):    Interfejs PHP dla amavis-stats
35 Group:          Applications/System
36 Requires:       %{name}-%{version}-%{release}
37
38 %description php
39 PHP interface for amavis-stats.
40
41 %description php -l pl
42 Interfejs PHP dla amavis-stats.
43
44 %prep
45 %setup -q
46 %patch0 -p1
47 %patch1 -p0
48
49 %build
50 %configure
51 %{__make}
52
53 %install
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT/etc/cron.d
56 user=`id -u`
57 group=`id -g`
58
59 %{__make} install \
60         install_prefix=$RPM_BUILD_ROOT \
61         amavis_user=$user \
62         amavis_group=$group \
63         web_user=$user \
64         web_group=$group
65         
66 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats
67
68 %clean
69 rm -rf $RPM_BUILD_ROOT
70
71 %post php
72 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*/etc/%{name}/apache.conf" /etc/httpd/httpd.conf; then
73         echo "Include /etc/%{name}/apache.conf" >> /etc/httpd/httpd.conf
74 fi
75 if [ -f /var/lock/subsys/httpd ]; then
76         /usr/sbin/apachectl restart 1>&2
77 fi
78
79 %preun php
80 if [ "$1" = "0" ]; then
81         umask 027
82         grep -v "^Include.*/etc/%{name}/apache.conf" /etc/httpd/httpd.conf > \
83                 etc/httpd/httpd.conf.tmp
84         mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
85         if [ -f /var/lock/subsys/httpd ]; then
86                 /usr/sbin/apachectl restart 1>&2
87         fi
88 fi
89
90 %files
91 %defattr(644,root,root,755)
92 %doc README
93 %attr(755,root,root) %{_sbindir}/amavis-stats
94 %dir %{_pkglibdir}
95 %attr(640,root,root) %config(noreplace) %verify(not size mtime md5) /etc/cron.d/amavis-stats
96 %{_mandir}/man1/*
97
98 %files php
99 %defattr(644,root,root,755)
100 %dir /etc/%{name}
101 %attr(640,root,root) %config(noreplace) /etc/%{name}/apache.conf
102 %dir %{_phpdir}
103 %dir %attr(755,http,root) %{_phpdir}/img
104 %{_phpdir}/%{name}.php
105 %{_phpdir}/index.php
106 %attr(755,http,http) %dir %{_pkglibdir}/img
This page took 0.104075 seconds and 3 git commands to generate.