]> git.pld-linux.org Git - packages/amavis-stats.git/blob - amavis-stats.spec
99bf31c7237f70b99029f74c56eaae59976e05f4
[packages/amavis-stats.git] / amavis-stats.spec
1 # TODO:
2 # - move to http://www.daleenterprise.com/amavis-stats/
3 %include        /usr/lib/rpm/macros.perl
4 %define         _rc     rc6
5 %define         _rel    7
6 Summary:        Simple amavisd-new statistics generator
7 Summary(pl.UTF-8):      Prosty generator statystyk dla amavisd-new
8 Name:           amavis-stats
9 Version:        0.1.13
10 Release:        0.%{_rc}.%{_rel}
11 License:        GPL
12 Group:          Applications/System
13 Source0:        http://rekudos.net/download/%{name}-%{version}-%{_rc}.tar.gz
14 # Source0-md5:  39156ca0eba50405d836aaf9d97743bf
15 Source1:        %{name}.cron
16 Patch0:         %{name}-gzip.patch
17 Patch1:         %{name}-more_ac.patch
18 Patch2:         %{name}-Makefile.patch
19 # Old URL:
20 #URL:           http://rekudos.net/amavis-stats/
21 URL:            http://www.daleenterprise.com/amavis-stats/
22 BuildRequires:  rpmbuild(macros) >= 1.268
23 Provides:       %{name}-%{version}-%{release}
24 BuildArch:      noarch
25 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26
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}
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
38 %description -l pl.UTF-8
39 amavis-stats jest prostym generatorem statystyk opartym na rrdtool.
40 Tworzy wykresy zainfekowanych wiadomości, w rozbiciu na poszczególne
41 wirusy, na podstawie logów amavisd-new.
42
43 %package php
44 Summary:        PHP interface for amavis-stats
45 Summary(pl.UTF-8):      Interfejs PHP dla amavis-stats
46 Group:          Applications/System
47 Requires:       %{name}-%{version}-%{release}
48 Requires:       php(pcre)
49 Requires:       webapps
50 Requires:       webserver(php)
51
52 %description php
53 PHP interface for amavis-stats.
54
55 %description php -l pl.UTF-8
56 Interfejs PHP dla amavis-stats.
57
58 %prep
59 %setup -q -n %{name}-%{version}-%{_rc}
60 %patch0 -p1
61 %patch1 -p0
62 %patch2 -p1
63
64 %build
65 %configure
66 %{__make}
67
68 %install
69 rm -rf $RPM_BUILD_ROOT
70 install -d $RPM_BUILD_ROOT/etc/cron.d
71 user=`id -u`
72 group=`id -g`
73
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
80
81 install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/amavis-stats
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
86
87 %clean
88 rm -rf $RPM_BUILD_ROOT
89
90 %triggerin php -- apache1 < 1.3.37-3, apache1-base
91 %webapp_register apache %{_webapp}
92
93 %triggerun php -- apache1 < 1.3.37-3, apache1-base
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
105 fi
106
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
110 fi
111
112 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
113 /usr/sbin/webapp register httpd %{_webapp}
114 %service -q httpd reload
115
116 %files
117 %defattr(644,root,root,755)
118 %doc README debian/changelog
119 %attr(755,root,root) %{_sbindir}/amavis-stats
120 %dir %{_pkglibdir}
121 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/amavis-stats
122 %{_mandir}/man1/*
123
124 %files php
125 %defattr(644,root,root,755)
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
This page took 0.034124 seconds and 3 git commands to generate.