3 %include /usr/lib/rpm/macros.perl
6 Summary: Simple amavisd-new statistics generator
7 Summary(pl.UTF-8): Prosty generator statystyk dla amavisd-new
10 Release: 0.%{_rc}.%{_rel}
12 Group: Applications/System
13 Source0: http://rekudos.net/download/%{name}-%{version}-%{_rc}.tar.gz
14 # Source0-md5: 39156ca0eba50405d836aaf9d97743bf
16 Patch0: %{name}-gzip.patch
17 Patch1: %{name}-more_ac.patch
18 Patch2: %{name}-Makefile.patch
19 URL: http://osx.topicdesk.com/content/view/42/59/
20 BuildRequires: rpmbuild(macros) >= 1.268
21 Provides: %{name}-%{version}-%{release}
23 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 %define _pkglibdir /var/lib/%{name}
26 %define _webapps /etc/webapps
27 %define _webapp %{name}
28 %define _webappdir %{_webapps}/%{_webapp}
29 %define _appdir %{_datadir}/%{_webapp}
32 amavis-stats is a simple amavis statistics generator based on rrdtool.
33 It produces graphs from amavisd-new log entries of infections broken
36 %description -l pl.UTF-8
37 amavis-stats jest prostym generatorem statystyk opartym na rrdtool.
38 Tworzy wykresy zainfekowanych wiadomości, w rozbiciu na poszczególne
39 wirusy, na podstawie logów amavisd-new.
42 Summary: PHP interface for amavis-stats
43 Summary(pl.UTF-8): Interfejs PHP dla amavis-stats
44 Group: Applications/System
45 Requires: %{name}-%{version}-%{release}
48 Requires: webserver(php)
51 PHP interface for amavis-stats.
53 %description php -l pl.UTF-8
54 Interfejs PHP dla amavis-stats.
57 %setup -q -n %{name}-%{version}-%{_rc}
67 rm -rf $RPM_BUILD_ROOT
68 install -d $RPM_BUILD_ROOT/etc/cron.d
73 install_prefix=$RPM_BUILD_ROOT \
79 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats
80 ln -s amavis-stats.php $RPM_BUILD_ROOT%{_datadir}/%{name}/index.php
81 install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp}
82 mv $RPM_BUILD_ROOT{/etc/amavis-stats/apache.conf,%{_webapps}/%{_webapp}/httpd.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 debian/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
123 %defattr(644,root,root,755)
124 %dir %attr(750,root,http) %{_webapps}/%{_webapp}
125 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf
126 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf
130 %{_appdir}/%{name}.php
132 %attr(775,root,http) %dir %{_pkglibdir}/img