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