]> git.pld-linux.org Git - packages/amavis-stats.git/blob - amavis-stats.spec
- drop obsolete and outdated manual inclusion of rpm macros
[packages/amavis-stats.git] / amavis-stats.spec
1 #
2 # TODO:
3 #   - add trigger to update apache configuration when upgrading from
4 #     older versions (not sure if this is required)
5 #
6 %include        /usr/lib/rpm/macros.perl
7 Summary:        Simple amavisd-new statistics generator
8 Summary(pl.UTF-8):      Prosty generator statystyk dla amavisd-new
9 Name:           amavis-stats
10 Version:        0.1.22
11 Release:        1
12 License:        GPL
13 Group:          Applications/System
14 Source0:        http://downloads.topicdesk.com/amavis_stats/%{name}-%{version}.tar.gz
15 # Source0-md5:  5bea6811c00a4fda4b96b6a318a04a92
16 Source1:        %{name}.init
17 Patch0:         %{name}-gzip.patch
18 Patch1:         %{name}-Makefile.patch
19 Patch2:         %{name}-pid.patch
20 URL:            http://osx.topicdesk.com/content/view/42/59/
21 BuildRequires:  rpmbuild(macros) >= 1.268
22 BuildRequires:  sed >= 4.0
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         _pkgcachedir    /var/cache/%{name}
29 %define         _webapps        /etc/webapps
30 %define         _webapp         %{name}
31 %define         _webappdir      %{_webapps}/%{_webapp}
32 %define         _appdir         %{_datadir}/%{_webapp}
33
34 %description
35 amavis-stats is a simple amavis statistics generator based on rrdtool.
36 It produces graphs from amavisd-new log entries of infections broken
37 down by virus.
38
39 %description -l pl.UTF-8
40 amavis-stats jest prostym generatorem statystyk opartym na rrdtool.
41 Tworzy wykresy zainfekowanych wiadomości, w rozbiciu na poszczególne
42 wirusy, na podstawie logów amavisd-new.
43
44 %package php
45 Summary:        PHP interface for amavis-stats
46 Summary(pl.UTF-8):      Interfejs PHP dla amavis-stats
47 Group:          Applications/System
48 Requires:       %{name}-%{version}-%{release}
49 Requires:       php(pcre)
50 Requires:       webapps
51 Requires:       webserver(php)
52
53 %description php
54 PHP interface for amavis-stats.
55
56 %description php -l pl.UTF-8
57 Interfejs PHP dla amavis-stats.
58
59 %prep
60 %setup -q
61 %patch0 -p1
62 %patch1 -p1
63 %patch2 -p1
64
65 %build
66 %{__libtoolize}
67 %{__aclocal}
68 %{__autoconf}
69 %{__autoheader}
70 %{__automake}
71 sed -i -e '/basic_machine=powerpc-apple/s/$/\n\t\t;;\n\tnoarch-*)\n\t\tbasic_machine=noarch/;' config.sub
72 %configure \
73         --with-user=root \
74         --with-group=http \
75         --with-log-file=/var/log/maillog
76 %{__make}
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80
81 %{__make} install \
82         DESTDIR=$RPM_BUILD_ROOT
83
84 install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_webapps}/%{_webapp}}
85 mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.alias.conf,%{_webapps}/%{_webapp}/httpd.conf}
86 mv $RPM_BUILD_ROOT{%{_datadir}/amavis-stats/amavis-stats.php.conf,%{_webapps}/%{_webapp}}
87 ln -s %{_webapps}/%{_webapp}/amavis-stats.php.conf $RPM_BUILD_ROOT%{_datadir}/%{name}/amavis-stats.php.conf
88 cp $RPM_BUILD_ROOT%{_webapps}/%{_webapp}/{httpd,apache}.conf
89 install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/amavis-stats
90
91 %clean
92 rm -rf $RPM_BUILD_ROOT
93
94 %triggerin php -- apache1 < 1.3.37-3, apache1-base
95 %webapp_register apache %{_webapp}
96
97 %triggerun php -- apache1 < 1.3.37-3, apache1-base
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
107 if [ -f /etc/httpd/httpd.conf ]; then
108         sed -i -e "/^Include.*%{name}\/apache.conf/d" /etc/httpd/httpd.conf
109 fi
110
111 if [ -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
114 fi
115
116 rm -f /etc/httpd/httpd.conf/99_%{name}.conf
117 /usr/sbin/webapp register httpd %{_webapp}
118 %service -q httpd reload
119
120 %files
121 %defattr(644,root,root,755)
122 %doc README ChangeLog
123 %attr(754,root,root) /etc/rc.d/init.d/amavis-stats
124 %attr(755,root,root) %{_sbindir}/amavis-stats
125 %dir %{_pkglibdir}
126 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/amavis-stats.conf
127 %{_mandir}/man1/*
128
129 %files php
130 %defattr(644,root,root,755)
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
134 %attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_webapps}/%{_webapp}/amavis-stats.php.conf
135 %dir %{_appdir}
136 %{_appdir}/amavis-stats.php.conf
137 %{_appdir}/img
138 %{_appdir}/includes
139 %{_appdir}/index.php
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.084785 seconds and 3 git commands to generate.