3 # - add trigger to update apache configuration when upgrading from
4 # older versions (not sure if this is required)
6 %include /usr/lib/rpm/macros.perl
7 Summary: Simple amavisd-new statistics generator
8 Summary(pl.UTF-8): Prosty generator statystyk dla amavisd-new
13 Group: Applications/System
14 Source0: http://downloads.topicdesk.com/amavis_stats/%{name}-%{version}.tar.gz
15 # Source0-md5: 5bea6811c00a4fda4b96b6a318a04a92
17 Patch0: %{name}-gzip.patch
18 Patch1: %{name}-Makefile.patch
19 Patch2: %{name}-pid.patch
20 URL: http://osx.topicdesk.com/content/view/42/59/
21 BuildRequires: rpmbuild(macros) >= 1.268
22 BuildRequires: sed >= 4.0
23 Provides: %{name}-%{version}-%{release}
25 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27 %define _pkglibdir /var/lib/%{name}
28 %define _pkgcachedir /var/cache/%{name}
29 %define _webapps /etc/webapps
30 %define _webapp %{name}
31 %define _webappdir %{_webapps}/%{_webapp}
32 %define _appdir %{_datadir}/%{_webapp}
35 amavis-stats is a simple amavis statistics generator based on rrdtool.
36 It produces graphs from amavisd-new log entries of infections broken
39 %description -l pl.UTF-8
40 amavis-stats jest prostym generatorem statystyk opartym na rrdtool.
41 Tworzy wykresy zainfekowanych wiadomości, w rozbiciu na poszczególne
42 wirusy, na podstawie logów amavisd-new.
45 Summary: PHP interface for amavis-stats
46 Summary(pl.UTF-8): Interfejs PHP dla amavis-stats
47 Group: Applications/System
48 Requires: %{name}-%{version}-%{release}
51 Requires: webserver(php)
54 PHP interface for amavis-stats.
56 %description php -l pl.UTF-8
57 Interfejs PHP dla amavis-stats.
71 sed -i -e '/basic_machine=powerpc-apple/s/$/\n\t\t;;\n\tnoarch-*)\n\t\tbasic_machine=noarch/;' config.sub
75 --with-log-file=/var/log/maillog
79 rm -rf $RPM_BUILD_ROOT
82 DESTDIR=$RPM_BUILD_ROOT
84 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_webapps}/%{_webapp}}
85 mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.alias.conf,%{_webapps}/%{_webapp}/httpd.conf}
86 mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.php.conf,%{_webapps}/%{_webapp}}
87 ln -s %{_webapps}/%{_webapp}/amavis-stats.php.conf $RPM_BUILD_ROOT%{_datadir}/%{name}/amavis-stats.php.conf
88 cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf
89 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/amavis-stats
92 rm -rf $RPM_BUILD_ROOT
94 %triggerin php -- apache1 < 1.3.37-3, apache1-base
95 %webapp_register apache %{_webapp}
97 %triggerun php -- apache1 < 1.3.37-3, apache1-base
98 %webapp_unregister apache %{_webapp}
100 %triggerin php -- apache < 2.2.0, apache-base
101 %webapp_register httpd %{_webapp}
103 %triggerun php -- apache < 2.2.0, apache-base
104 %webapp_unregister httpd %{_webapp}
106 %triggerpostun php -- %{name}-php < 0.1.13-0.rc6.4.1
107 if [ -f /etc/httpd/httpd.conf ]; then
108 sed -i -e "/^Include.*%{name}\/apache.conf/d" /etc/httpd/httpd.conf
111 if [ -f /etc/%{name}/apache.conf.rpmsave ]; then
112 cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew}
113 mv -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf
116 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
117 /usr/sbin/webapp register httpd %{_webapp}
118 %service -q httpd reload
121 %defattr(644,root,root,755)
122 %doc README ChangeLog
123 %attr(754,root,root) /etc/rc.d/init.d/amavis-stats
124 %attr(755,root,root) %{_sbindir}/amavis-stats
126 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavis-stats.conf
130 %defattr(644,root,root,755)
131 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
132 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
133 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
134 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/amavis-stats.php.conf
136 %{_appdir}/amavis-stats.php.conf
141 %{_appdir}/%{name}.php
142 %{_appdir}/%{name}.html
145 %attr(775,root,http) %dir %{_pkgcachedir}