1 %include /usr/lib/rpm/macros.perl
2 Summary: Simple amavisd-new statistics generator
3 Summary(pl.UTF-8): Prosty generator statystyk dla amavisd-new
8 Group: Applications/System
9 Source0: http://downloads.topicdesk.com/amavis_stats/%{name}-%{version}.tar.gz
10 # Source0-md5: 5bea6811c00a4fda4b96b6a318a04a92
12 Patch0: %{name}-gzip.patch
13 Patch1: %{name}-Makefile.patch
14 URL: http://osx.topicdesk.com/content/view/42/59/
15 BuildRequires: rpmbuild(macros) >= 1.268
16 BuildRequires: sed >= 4.0
17 Provides: %{name}-%{version}-%{release}
19 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
21 %define _pkglibdir /var/lib/%{name}
22 %define _pkgcachedir /var/cache/%{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
33 %description -l pl.UTF-8
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.UTF-8): Interfejs PHP dla amavis-stats
41 Group: Applications/System
42 Requires: %{name}-%{version}-%{release}
45 Requires: webserver(php)
48 PHP interface for amavis-stats.
50 %description php -l pl.UTF-8
51 Interfejs PHP dla amavis-stats.
64 sed -i -e '/basic_machine=powerpc-apple/s/$/\n\t\t;;\n\tnoarch-*)\n\t\tbasic_machine=noarch/;' config.sub
68 --with-log-file=/var/log/maillog
72 rm -rf $RPM_BUILD_ROOT
73 install -d $RPM_BUILD_ROOT/etc/cron.d
76 DESTDIR=$RPM_BUILD_ROOT
78 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats
79 install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
80 mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.alias.conf,%{_webapps}/%{_webapp}/httpd.conf}
81 mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.php.conf,%{_webapps}/%{_webapp}}
82 ln -s %{_webapps}/%{_webapp}/amavis-stats.php.conf $RPM_BUILD_ROOT%{_datadir}/%{name}/amavis-stats.php.conf
83 cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf
86 rm -rf $RPM_BUILD_ROOT
88 %triggerin php -- apache1 < 1.3.37-3, apache1-base
89 %webapp_register apache %{_webapp}
91 %triggerun php -- apache1 < 1.3.37-3, apache1-base
92 %webapp_unregister apache %{_webapp}
94 %triggerin php -- apache < 2.2.0, apache-base
95 %webapp_register httpd %{_webapp}
97 %triggerun php -- apache < 2.2.0, apache-base
98 %webapp_unregister httpd %{_webapp}
100 %triggerpostun php -- %{name}-php < 0.1.13-0.rc6.4.1
101 if [ -f /etc/httpd/httpd.conf ]; then
102 sed -i -e "/^Include.*%{name}\/apache.conf/d" /etc/httpd/httpd.conf
105 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
106 cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
107 mv -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
110 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
111 /usr/sbin/webapp register httpd %{_webapp}
112 %service -q httpd reload
115 %defattr(644,root,root,755)
116 %doc README ChangeLog
117 %attr(755,root,root) %{_sbindir}/amavis-stats
119 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/amavis-stats
120 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavis-stats.conf
124 %defattr(644,root,root,755)
125 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
126 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
127 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
128 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/amavis-stats.php.conf
130 %{_appdir}/amavis-stats.php.conf
135 %{_appdir}/%{name}.php
136 %{_appdir}/%{name}.html
139 %attr(775,root,http) %dir %{_pkgcachedir}