]>
Commit | Line | Data |
---|---|---|
0a5821eb PG |
1 | # TODO: |
2 | # - move to http://www.daleenterprise.com/amavis-stats/ | |
3124cc75 | 3 | %include /usr/lib/rpm/macros.perl |
df32a844 | 4 | %define _rc rc6 |
66cef83b | 5 | %define _rel 7 |
3124cc75 | 6 | Summary: Simple amavisd-new statistics generator |
1407ceed | 7 | Summary(pl.UTF-8): Prosty generator statystyk dla amavisd-new |
3124cc75 | 8 | Name: amavis-stats |
df32a844 | 9 | Version: 0.1.13 |
087d38c4 | 10 | Release: 0.%{_rc}.%{_rel} |
3124cc75 | 11 | License: GPL |
12 | Group: Applications/System | |
df32a844 | 13 | Source0: http://rekudos.net/download/%{name}-%{version}-%{_rc}.tar.gz |
14 | # Source0-md5: 39156ca0eba50405d836aaf9d97743bf | |
3124cc75 | 15 | Source1: %{name}.cron |
be1e3db8 | 16 | Patch0: %{name}-gzip.patch |
ccab77fc | 17 | Patch1: %{name}-more_ac.patch |
a49ce7c0 | 18 | Patch2: %{name}-Makefile.patch |
0a5821eb PG |
19 | # Old URL: |
20 | #URL: http://rekudos.net/amavis-stats/ | |
21 | URL: http://www.daleenterprise.com/amavis-stats/ | |
d93b6dd2 | 22 | BuildRequires: rpmbuild(macros) >= 1.268 |
97b10506 | 23 | Provides: %{name}-%{version}-%{release} |
d93b6dd2 | 24 | BuildArch: noarch |
3124cc75 | 25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
d93b6dd2 ER |
27 | %define _pkglibdir /var/lib/%{name} |
28 | %define _webapps /etc/webapps | |
29 | %define _webapp %{name} | |
30 | %define _webappdir %{_webapps}/%{_webapp} | |
31 | %define _appdir %{_datadir}/%{_webapp} | |
3124cc75 | 32 | |
33 | %description | |
34 | amavis-stats is a simple amavis statistics generator based on rrdtool. | |
35 | It produces graphs from amavisd-new log entries of infections broken | |
36 | down by virus. | |
37 | ||
646d6f3c | 38 | %description -l pl.UTF-8 |
3124cc75 | 39 | amavis-stats jest prostym generatorem statystyk opartym na rrdtool. |
646d6f3c JR |
40 | Tworzy wykresy zainfekowanych wiadomości, w rozbiciu na poszczególne |
41 | wirusy, na podstawie logów amavisd-new. | |
3124cc75 | 42 | |
be22c352 JR |
43 | %package php |
44 | Summary: PHP interface for amavis-stats | |
1407ceed | 45 | Summary(pl.UTF-8): Interfejs PHP dla amavis-stats |
be22c352 | 46 | Group: Applications/System |
e79c41f0 | 47 | Requires: %{name}-%{version}-%{release} |
66cef83b | 48 | Requires: php(pcre) |
d93b6dd2 | 49 | Requires: webapps |
66cef83b | 50 | Requires: webserver(php) |
be22c352 JR |
51 | |
52 | %description php | |
53 | PHP interface for amavis-stats. | |
54 | ||
646d6f3c | 55 | %description php -l pl.UTF-8 |
be22c352 JR |
56 | Interfejs PHP dla amavis-stats. |
57 | ||
3124cc75 | 58 | %prep |
df32a844 | 59 | %setup -q -n %{name}-%{version}-%{_rc} |
2f883aca | 60 | %patch0 -p1 |
ccab77fc | 61 | %patch1 -p0 |
a49ce7c0 | 62 | %patch2 -p1 |
ccab77fc | 63 | |
a6334884 | 64 | %build |
ccab77fc | 65 | %configure |
66 | %{__make} | |
3124cc75 | 67 | |
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
97b10506 | 70 | install -d $RPM_BUILD_ROOT/etc/cron.d |
ccab77fc | 71 | user=`id -u` |
72 | group=`id -g` | |
3124cc75 | 73 | |
ccab77fc | 74 | %{__make} install \ |
75 | install_prefix=$RPM_BUILD_ROOT \ | |
76 | amavis_user=$user \ | |
77 | amavis_group=$group \ | |
78 | web_user=$user \ | |
79 | web_group=$group | |
94448566 | 80 | |
3124cc75 | 81 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats |
d93b6dd2 ER |
82 | ln -s amavis-stats.php $RPM_BUILD_ROOT%{_datadir}/%{name}/index.php |
83 | install -d $RPM_BUILD_ROOT%{_webapps}/%{_webapp} | |
84 | mv $RPM_BUILD_ROOT{/etc/amavis-stats/apache.conf,%{_webapps}/%{_webapp}/httpd.conf} | |
85 | cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf | |
df32a844 | 86 | |
3124cc75 | 87 | %clean |
88 | rm -rf $RPM_BUILD_ROOT | |
89 | ||
c9eeb26b | 90 | %triggerin php -- apache1 < 1.3.37-3, apache1-base |
d93b6dd2 ER |
91 | %webapp_register apache %{_webapp} |
92 | ||
c9eeb26b | 93 | %triggerun php -- apache1 < 1.3.37-3, apache1-base |
d93b6dd2 ER |
94 | %webapp_unregister apache %{_webapp} |
95 | ||
96 | %triggerin php -- apache < 2.2.0, apache-base | |
97 | %webapp_register httpd %{_webapp} | |
98 | ||
99 | %triggerun php -- apache < 2.2.0, apache-base | |
100 | %webapp_unregister httpd %{_webapp} | |
101 | ||
102 | %triggerpostun php -- %{name}-php < 0.1.13-0.rc6.4.1 | |
103 | if [ -f /etc/httpd/httpd.conf ]; then | |
104 | sed -i -e "/^Include.*%{name}\/apache.conf/d" /etc/httpd/httpd.conf | |
97b10506 PG |
105 | fi |
106 | ||
d93b6dd2 ER |
107 | if [ -f /etc/%{name}/apache.conf.rpmsave ]; then |
108 | cp -f %{_webapps}/%{_webapp}/httpd.conf{,.rpmnew} | |
109 | mv -f /etc/%{name}/apache.conf.rpmsave %{_webapps}/%{_webapp}/httpd.conf | |
97b10506 PG |
110 | fi |
111 | ||
d93b6dd2 ER |
112 | rm -f /etc/httpd/httpd.conf/99_%{name}.conf |
113 | /usr/sbin/webapp register httpd %{_webapp} | |
114 | %service -q httpd reload | |
115 | ||
3124cc75 | 116 | %files |
117 | %defattr(644,root,root,755) | |
75350f5c | 118 | %doc README debian/changelog |
97b10506 | 119 | %attr(755,root,root) %{_sbindir}/amavis-stats |
3124cc75 | 120 | %dir %{_pkglibdir} |
f6f55789 | 121 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/amavis-stats |
3124cc75 | 122 | %{_mandir}/man1/* |
be22c352 JR |
123 | |
124 | %files php | |
125 | %defattr(644,root,root,755) | |
d93b6dd2 ER |
126 | %dir %attr(750,root,http) %{_webapps}/%{_webapp} |
127 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/apache.conf | |
128 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/httpd.conf | |
129 | %dir %{_appdir} | |
130 | # symlink | |
131 | %{_appdir}/img | |
132 | %{_appdir}/%{name}.php | |
133 | %{_appdir}/index.php | |
134 | %attr(775,root,http) %dir %{_pkglibdir}/img |