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