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