]>
Commit | Line | Data |
---|---|---|
ddffc99c | 1 | # |
2 | # TODO: | |
2389616b | 3 | # - add trigger to update apache configuration when upgrading from |
4 | # older versions (not sure if this is required) | |
ddffc99c | 5 | # |
3124cc75 | 6 | %include /usr/lib/rpm/macros.perl |
7 | Summary: Simple amavisd-new statistics generator | |
1407ceed | 8 | Summary(pl.UTF-8): Prosty generator statystyk dla amavisd-new |
3124cc75 | 9 | Name: amavis-stats |
87db9fdf | 10 | Version: 0.1.22 |
61cfad50 | 11 | Release: 0.3 |
3124cc75 | 12 | License: GPL |
13 | Group: Applications/System | |
87db9fdf | 14 | Source0: http://downloads.topicdesk.com/amavis_stats/%{name}-%{version}.tar.gz |
15 | # Source0-md5: 5bea6811c00a4fda4b96b6a318a04a92 | |
2389616b | 16 | Source1: %{name}.init |
be1e3db8 | 17 | Patch0: %{name}-gzip.patch |
87db9fdf | 18 | Patch1: %{name}-Makefile.patch |
ddffc99c | 19 | Patch2: %{name}-pid.patch |
ad6e3250 | 20 | URL: http://osx.topicdesk.com/content/view/42/59/ |
d93b6dd2 | 21 | BuildRequires: rpmbuild(macros) >= 1.268 |
cbcba574 | 22 | BuildRequires: sed >= 4.0 |
97b10506 | 23 | Provides: %{name}-%{version}-%{release} |
21830a20 | 24 | BuildArch: noarch |
3124cc75 | 25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
d93b6dd2 | 27 | %define _pkglibdir /var/lib/%{name} |
87db9fdf | 28 | %define _pkgcachedir /var/cache/%{name} |
d93b6dd2 ER |
29 | %define _webapps /etc/webapps |
30 | %define _webapp %{name} | |
31 | %define _webappdir %{_webapps}/%{_webapp} | |
32 | %define _appdir %{_datadir}/%{_webapp} | |
3124cc75 | 33 | |
34 | %description | |
35 | amavis-stats is a simple amavis statistics generator based on rrdtool. | |
36 | It produces graphs from amavisd-new log entries of infections broken | |
37 | down by virus. | |
38 | ||
646d6f3c | 39 | %description -l pl.UTF-8 |
3124cc75 | 40 | amavis-stats jest prostym generatorem statystyk opartym na rrdtool. |
646d6f3c JR |
41 | Tworzy wykresy zainfekowanych wiadomości, w rozbiciu na poszczególne |
42 | wirusy, na podstawie logów amavisd-new. | |
3124cc75 | 43 | |
be22c352 JR |
44 | %package php |
45 | Summary: PHP interface for amavis-stats | |
1407ceed | 46 | Summary(pl.UTF-8): Interfejs PHP dla amavis-stats |
be22c352 | 47 | Group: Applications/System |
e79c41f0 | 48 | Requires: %{name}-%{version}-%{release} |
66cef83b | 49 | Requires: php(pcre) |
d93b6dd2 | 50 | Requires: webapps |
66cef83b | 51 | Requires: webserver(php) |
be22c352 JR |
52 | |
53 | %description php | |
54 | PHP interface for amavis-stats. | |
55 | ||
646d6f3c | 56 | %description php -l pl.UTF-8 |
be22c352 JR |
57 | Interfejs PHP dla amavis-stats. |
58 | ||
3124cc75 | 59 | %prep |
87db9fdf | 60 | %setup -q |
2f883aca | 61 | %patch0 -p1 |
87db9fdf | 62 | %patch1 -p1 |
ddffc99c | 63 | %patch2 -p1 |
ccab77fc | 64 | |
a6334884 | 65 | %build |
87db9fdf | 66 | %{__libtoolize} |
67 | %{__aclocal} | |
68 | %{__autoconf} | |
69 | %{__autoheader} | |
70 | %{__automake} | |
fc8de875 | 71 | sed -i -e '/basic_machine=powerpc-apple/s/$/\n\t\t;;\n\tnoarch-*)\n\t\tbasic_machine=noarch/;' config.sub |
87db9fdf | 72 | %configure \ |
61cfad50 | 73 | --with-user=root \ |
87db9fdf | 74 | --with-group=http \ |
75 | --with-log-file=/var/log/maillog | |
ccab77fc | 76 | %{__make} |
3124cc75 | 77 | |
78 | %install | |
79 | rm -rf $RPM_BUILD_ROOT | |
80 | ||
ccab77fc | 81 | %{__make} install \ |
87db9fdf | 82 | DESTDIR=$RPM_BUILD_ROOT |
94448566 | 83 | |
2389616b | 84 | install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_webapps}/%{_webapp}} |
87db9fdf | 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 | |
d93b6dd2 | 88 | cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf |
2389616b | 89 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/amavis-stats |
df32a844 | 90 | |
3124cc75 | 91 | %clean |
92 | rm -rf $RPM_BUILD_ROOT | |
93 | ||
c9eeb26b | 94 | %triggerin php -- apache1 < 1.3.37-3, apache1-base |
d93b6dd2 ER |
95 | %webapp_register apache %{_webapp} |
96 | ||
c9eeb26b | 97 | %triggerun php -- apache1 < 1.3.37-3, apache1-base |
d93b6dd2 ER |
98 | %webapp_unregister apache %{_webapp} |
99 | ||
100 | %triggerin php -- apache < 2.2.0, apache-base | |
101 | %webapp_register httpd %{_webapp} | |
102 | ||
103 | %triggerun php -- apache < 2.2.0, apache-base | |
104 | %webapp_unregister httpd %{_webapp} | |
105 | ||
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 | |
97b10506 PG |
109 | fi |
110 | ||
d93b6dd2 ER |
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 | |
97b10506 PG |
114 | fi |
115 | ||
d93b6dd2 ER |
116 | rm -f /etc/httpd/httpd.conf/99_%{name}.conf |
117 | /usr/sbin/webapp register httpd %{_webapp} | |
118 | %service -q httpd reload | |
119 | ||
3124cc75 | 120 | %files |
121 | %defattr(644,root,root,755) | |
87db9fdf | 122 | %doc README ChangeLog |
2389616b | 123 | %attr(754,root,root) /etc/rc.d/init.d/amavis-stats |
97b10506 | 124 | %attr(755,root,root) %{_sbindir}/amavis-stats |
3124cc75 | 125 | %dir %{_pkglibdir} |
87db9fdf | 126 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavis-stats.conf |
3124cc75 | 127 | %{_mandir}/man1/* |
be22c352 JR |
128 | |
129 | %files php | |
130 | %defattr(644,root,root,755) | |
d93b6dd2 ER |
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 | |
61cfad50 | 134 | %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/amavis-stats.php.conf |
d93b6dd2 | 135 | %dir %{_appdir} |
87db9fdf | 136 | %{_appdir}/amavis-stats.php.conf |
d93b6dd2 | 137 | %{_appdir}/img |
87db9fdf | 138 | %{_appdir}/includes |
d93b6dd2 | 139 | %{_appdir}/index.php |
87db9fdf | 140 | %{_appdir}/templates |
141 | %{_appdir}/%{name}.php | |
142 | %{_appdir}/%{name}.html | |
143 | %{_appdir}/*.png | |
144 | %{_appdir}/*.ttf | |
145 | %attr(775,root,http) %dir %{_pkgcachedir} |