1 %include /usr/lib/rpm/macros.perl
3 Summary: Simple amavisd-new statistics generator
4 Summary(pl): Prosty generator statystyk dla amavisd-new
9 Group: Applications/System
10 Source0: http://rekudos.net/download/%{name}-%{version}-%{_rc}.tar.gz
11 # Source0-md5: 39156ca0eba50405d836aaf9d97743bf
13 Patch0: %{name}-gzip.patch
14 Patch1: %{name}-more_ac.patch
15 Patch2: %{name}-Makefile.patch
16 URL: http://rekudos.net/amavis-stats/
17 BuildRequires: rpmbuild(macros) >= 1.268
18 Provides: %{name}-%{version}-%{release}
20 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
22 %define _pkglibdir /var/lib/%{name}
23 %define _webapps /etc/webapps
24 %define _webapp %{name}
25 %define _webappdir %{_webapps}/%{_webapp}
26 %define _appdir %{_datadir}/%{_webapp}
29 amavis-stats is a simple amavis statistics generator based on rrdtool.
30 It produces graphs from amavisd-new log entries of infections broken
34 amavis-stats jest prostym generatorem statystyk opartym na rrdtool.
35 Tworzy wykresy zainfekowanych wiadomo¶ci, w rozbiciu na poszczególne
36 wirusy, na podstawie logów amavisd-new.
39 Summary: PHP interface for amavis-stats
40 Summary(pl): Interfejs PHP dla amavis-stats
41 Group: Applications/System
42 Requires: %{name}-%{version}-%{release}
48 PHP interface for amavis-stats.
50 %description php -l pl
51 Interfejs PHP dla amavis-stats.
54 %setup -q -n %{name}-%{version}-%{_rc}
64 rm -rf $RPM_BUILD_ROOT
65 install -d $RPM_BUILD_ROOT/etc/cron.d
70 install_prefix=$RPM_BUILD_ROOT \
76 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats
77 ln -s amavis-stats.php $RPM_BUILD_ROOT%{_datadir}/%{name}/index.php
78 install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
79 mv $RPM_BUILD_ROOT{/etc/amavis-stats/apache.conf,%{_webapps}/%{_webapp}/httpd.conf}
80 cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf
83 rm -rf $RPM_BUILD_ROOT
85 %triggerin php -- apache1
86 %webapp_register apache %{_webapp}
88 %triggerun php -- apache1
89 %webapp_unregister apache %{_webapp}
91 %triggerin php -- apache < 2.2.0, apache-base
92 %webapp_register httpd %{_webapp}
94 %triggerun php -- apache < 2.2.0, apache-base
95 %webapp_unregister httpd %{_webapp}
97 %triggerpostun php -- %{name}-php < 0.1.13-0.rc6.4.1
98 if [ -f /etc/httpd/httpd.conf ]; then
99 sed -i -e "/^Include.*%{name}\/apache.conf/d" /etc/httpd/httpd.conf
102 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
103 cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
104 mv -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
107 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
108 /usr/sbin/webapp register httpd %{_webapp}
109 %service -q httpd reload
112 %defattr(644,root,root,755)
113 %doc README debian/changelog
114 %attr(755,root,root) %{_sbindir}/amavis-stats
116 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/amavis-stats
120 %defattr(644,root,root,755)
121 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
122 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
123 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
127 %{_appdir}/%{name}.php
129 %attr(775,root,http) %dir %{_pkglibdir}/img