]> git.pld-linux.org Git - packages/amavis-stats.git/blame - amavis-stats.spec
- added init script
[packages/amavis-stats.git] / amavis-stats.spec
CommitLineData
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
7Summary: Simple amavisd-new statistics generator
1407ceed 8Summary(pl.UTF-8): Prosty generator statystyk dla amavisd-new
3124cc75 9Name: amavis-stats
87db9fdf 10Version: 0.1.22
2389616b 11Release: 0.2
3124cc75 12License: GPL
13Group: Applications/System
87db9fdf 14Source0: http://downloads.topicdesk.com/amavis_stats/%{name}-%{version}.tar.gz
15# Source0-md5: 5bea6811c00a4fda4b96b6a318a04a92
2389616b 16Source1: %{name}.init
be1e3db8 17Patch0: %{name}-gzip.patch
87db9fdf 18Patch1: %{name}-Makefile.patch
ddffc99c 19Patch2: %{name}-pid.patch
ad6e3250 20URL: http://osx.topicdesk.com/content/view/42/59/
d93b6dd2 21BuildRequires: rpmbuild(macros) >= 1.268
cbcba574 22BuildRequires: sed >= 4.0
97b10506 23Provides: %{name}-%{version}-%{release}
21830a20 24BuildArch: noarch
3124cc75 25BuildRoot: %{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
35amavis-stats is a simple amavis statistics generator based on rrdtool.
36It produces graphs from amavisd-new log entries of infections broken
37down by virus.
38
646d6f3c 39%description -l pl.UTF-8
3124cc75 40amavis-stats jest prostym generatorem statystyk opartym na rrdtool.
646d6f3c
JR
41Tworzy wykresy zainfekowanych wiadomości, w rozbiciu na poszczególne
42wirusy, na podstawie logów amavisd-new.
3124cc75 43
be22c352
JR
44%package php
45Summary: PHP interface for amavis-stats
1407ceed 46Summary(pl.UTF-8): Interfejs PHP dla amavis-stats
be22c352 47Group: Applications/System
e79c41f0 48Requires: %{name}-%{version}-%{release}
66cef83b 49Requires: php(pcre)
d93b6dd2 50Requires: webapps
66cef83b 51Requires: webserver(php)
be22c352
JR
52
53%description php
54PHP interface for amavis-stats.
55
646d6f3c 56%description php -l pl.UTF-8
be22c352
JR
57Interfejs 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 71sed -i -e '/basic_machine=powerpc-apple/s/$/\n\t\t;;\n\tnoarch-*)\n\t\tbasic_machine=noarch/;' config.sub
87db9fdf 72%configure \
73 --with-user=http \
74 --with-group=http \
75 --with-log-file=/var/log/maillog
ccab77fc 76%{__make}
3124cc75 77
78%install
79rm -rf $RPM_BUILD_ROOT
80
ccab77fc 81%{__make} install \
87db9fdf 82 DESTDIR=$RPM_BUILD_ROOT
94448566 83
2389616b 84install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_webapps}/%{_webapp}}
87db9fdf 85mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.alias.conf,%{_webapps}/%{_webapp}/httpd.conf}
86mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.php.conf,%{_webapps}/%{_webapp}}
87ln -s %{_webapps}/%{_webapp}/amavis-stats.php.conf $RPM_BUILD_ROOT%{_datadir}/%{name}/amavis-stats.php.conf
d93b6dd2 88cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf
2389616b 89install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/amavis-stats
df32a844 90
3124cc75 91%clean
92rm -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
107if [ -f /etc/httpd/httpd.conf ]; then
108 sed -i -e "/^Include.*%{name}\/apache.conf/d" /etc/httpd/httpd.conf
97b10506
PG
109fi
110
d93b6dd2
ER
111if [ -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
114fi
115
d93b6dd2
ER
116rm -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
87db9fdf 134%attr(640,root,root) %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}
This page took 0.751652 seconds and 4 git commands to generate.