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