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