]>
Commit | Line | Data |
---|---|---|
1 | # TODO: | |
2 | # - think about some trigger to upgrade from 6.5-1 and older | |
3 | # (I suggest just to forget about those broken version, | |
4 | # unfortunately they have already landed in Ac) | |
5 | # - apache1 config | |
6 | # - security CVE-2006-1945, CVE-2006-2237: http://security.gentoo.org/glsa/glsa-200606-06.xml | |
7 | %include /usr/lib/rpm/macros.perl | |
8 | Summary: Advanced Web Statistics is a free powerful server log file analyzer | |
9 | Summary(pl.UTF-8): Zaawansowany program do analizowania logów serwera | |
10 | Name: awstats | |
11 | Version: 7.5 | |
12 | Release: 1 | |
13 | License: GPL v3+ | |
14 | Group: Applications/Networking | |
15 | Source0: http://awstats.sourceforge.net/files/%{name}-%{version}.tar.gz | |
16 | # Source0-md5: 1b11916a0a369a014abeb128289bf6b9 | |
17 | Source1: %{name}.crontab | |
18 | Source2: %{name}-httpd.conf | |
19 | Source3: %{name}.conf | |
20 | Source4: %{name}-lighttpd.conf | |
21 | Patch0: %{name}_conf.patch | |
22 | Patch1: %{name}-created_dir_mode.patch | |
23 | Patch2: %{name}-PLD.patch | |
24 | URL: http://awstats.sourceforge.net/ | |
25 | BuildRequires: rpm-perlprov | |
26 | BuildRequires: rpmbuild(macros) >= 1.264 | |
27 | Requires(triggerpostun): sed >= 4.0 | |
28 | Requires: perl-Geo-IP | |
29 | Requires: perl-Storable | |
30 | Requires: perl-Time-HiRes | |
31 | Requires: webapps | |
32 | Suggests: crondaemon | |
33 | Conflicts: apache-base < 2.4.0-1 | |
34 | BuildArch: noarch | |
35 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
36 | ||
37 | %define _webapps /etc/webapps | |
38 | %define _webapp %{name} | |
39 | %define _sysconfdir %{_webapps}/%{_webapp} | |
40 | ||
41 | %description | |
42 | Advanced Web Statistics is a powerful and featureful tool that | |
43 | generates advanced web server graphic statistics. This server log | |
44 | analyzer works from command line or as a CGI and shows you all | |
45 | information your log contains, in graphical web pages. It can analyze | |
46 | a lot of web/wap/proxy servers like Apache, IIS, Weblogic, Webstar, | |
47 | Squid, ... but also mail or FTP servers. | |
48 | ||
49 | This program can measure visits, unique vistors, authenticated users, | |
50 | pages, domains/countries, OS busiest times, robot visits, type of | |
51 | files, search engines/keywords used, visits duration, HTTP errors and | |
52 | more... Statistics can be updated from a browser or your scheduler. | |
53 | The program also supports virtual servers, plugins and a lot of | |
54 | features. | |
55 | ||
56 | %description -l pl.UTF-8 | |
57 | awstats (Advanced Web Statistics - zaawansowane statystyki WWW) to | |
58 | potężne i bogate w możliwości narzędzie generujące zaawansowane | |
59 | graficzne statystyki serwera WWW. Ten analizator logów serwera działa | |
60 | z linii poleceń lub jako CGI i pokazuje wszystkie informacje zawarte w | |
61 | logu w postaci graficznych stron WWW. Może analizować logi wielu | |
62 | serwerów WWW/WAP/proxy, takich jak Apache, IIS, Weblogic, Webstar, | |
63 | Squid... ale także serwerów pocztowych lub FTP. | |
64 | ||
65 | Ten program może mierzyć odwiedziny, odwiedzających, uwierzytelnionych | |
66 | użytkowników, strony, domeny/kraje, najbardziej zajęte godziny, | |
67 | odwiedziny robotów, rodzaje plików, używane wyszukiwarki i słowa | |
68 | kluczowe, czasy trwania odwiedzin, błędy HTTP... a nawet więcej. | |
69 | Statystyki mogą być uaktualniane z przeglądarki lub schedulera. | |
70 | Program obsługuje także serwery wirtualne, wtyczki i wiele innych | |
71 | rzeczy. | |
72 | ||
73 | %prep | |
74 | %setup -q | |
75 | %patch0 -p1 | |
76 | %patch1 -p1 | |
77 | %patch2 -p1 | |
78 | find . '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f | |
79 | ||
80 | %install | |
81 | rm -rf $RPM_BUILD_ROOT | |
82 | install -d $RPM_BUILD_ROOT{/etc/cron.d,%{_sysconfdir},%{_bindir}} \ | |
83 | $RPM_BUILD_ROOT{%{_datadir}/awstats,/var/lib/awstats} | |
84 | ||
85 | install -p tools/awstats_* $RPM_BUILD_ROOT%{_bindir} | |
86 | install -p tools/{logresolvemerge,maillogconvert,urlaliasbuilder}.pl $RPM_BUILD_ROOT%{_bindir} | |
87 | cp -r wwwroot $RPM_BUILD_ROOT%{_datadir}/awstats | |
88 | mv $RPM_BUILD_ROOT%{_datadir}/awstats/wwwroot/cgi-bin/awstats.model.conf $RPM_BUILD_ROOT%{_sysconfdir} | |
89 | mv $RPM_BUILD_ROOT%{_datadir}/awstats/wwwroot/cgi-bin/{lang,lib,plugins} $RPM_BUILD_ROOT%{_datadir}/%{name} | |
90 | cp -p %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/awstats | |
91 | cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd.conf | |
92 | cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf | |
93 | cp -p %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/lighttpd.conf | |
94 | ln -s %{_datadir}/awstats/wwwroot/cgi-bin/awstats.pl $RPM_BUILD_ROOT%{_bindir} | |
95 | ||
96 | %clean | |
97 | rm -rf $RPM_BUILD_ROOT | |
98 | ||
99 | %triggerin -- apache-base | |
100 | %webapp_register httpd %{_webapp} | |
101 | ||
102 | %triggerun -- apache-base | |
103 | %webapp_unregister httpd %{_webapp} | |
104 | ||
105 | %triggerin -- lighttpd | |
106 | %webapp_register lighttpd %{_webapp} | |
107 | ||
108 | %triggerun -- lighttpd | |
109 | %webapp_unregister lighttpd %{_webapp} | |
110 | ||
111 | %triggerpostun -- %{name} < 6.5-2.1 | |
112 | # rescue app configs. | |
113 | for i in awstats.conf awstats.model.conf; do | |
114 | if [ -f /etc/%{name}/$i.rpmsave ]; then | |
115 | mv -f %{_sysconfdir}/$i{,.rpmnew} | |
116 | mv -f /etc/%{name}/$i.rpmsave %{_sysconfdir}/$i | |
117 | fi | |
118 | done | |
119 | ||
120 | # nuke very-old config location (this mostly for Ra) | |
121 | if [ -f /etc/httpd/httpd.conf ]; then | |
122 | sed -i -e "/^Include.*%{name}.conf/d" /etc/httpd/httpd.conf | |
123 | fi | |
124 | ||
125 | # migrate from httpd (apache2) config dir | |
126 | if [ -f /etc/httpd/%{name}.conf.rpmsave ]; then | |
127 | cp -f %{_sysconfdir}/httpd.conf{,.rpmnew} | |
128 | mv -f /etc/httpd/%{name}.conf.rpmsave %{_sysconfdir}/httpd.conf | |
129 | fi | |
130 | ||
131 | # migrate from apache-config macros | |
132 | if [ -f /etc/%{name}/apache.conf.rpmsave ]; then | |
133 | if [ -d /etc/httpd/webapps.d ]; then | |
134 | cp -f %{_sysconfdir}/httpd.conf{,.rpmnew} | |
135 | cp -f /etc/%{name}/apache.conf.rpmsave %{_sysconfdir}/httpd.conf | |
136 | fi | |
137 | rm -f /etc/%{name}/apache.conf.rpmsave | |
138 | fi | |
139 | ||
140 | rm -f /etc/httpd/httpd.conf/99_%{name}.conf | |
141 | /usr/sbin/webapp register httpd %{_webapp} | |
142 | %service -q httpd reload | |
143 | ||
144 | %files | |
145 | %defattr(644,root,root,755) | |
146 | %doc README.md docs/* tools/webmin tools/xslt | |
147 | %dir %attr(750,root,http) %{_sysconfdir} | |
148 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd.conf | |
149 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lighttpd.conf | |
150 | %attr(644,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/awstats*.conf | |
151 | %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/cron.d/awstats | |
152 | ||
153 | %attr(755,root,root) %{_bindir}/*.pl | |
154 | %dir %{_datadir}/%{name} | |
155 | %{_datadir}/%{name}/lang | |
156 | %{_datadir}/%{name}/lib | |
157 | %{_datadir}/%{name}/plugins | |
158 | %dir %{_datadir}/%{name}/wwwroot | |
159 | %dir %{_datadir}/%{name}/wwwroot/cgi-bin | |
160 | %attr(755,root,root) %{_datadir}/%{name}/wwwroot/cgi-bin/awdownloadcsv.pl | |
161 | %attr(755,root,root) %{_datadir}/%{name}/wwwroot/cgi-bin/awredir.pl | |
162 | %attr(755,root,root) %{_datadir}/%{name}/wwwroot/cgi-bin/awstats.pl | |
163 | %{_datadir}/%{name}/wwwroot/classes | |
164 | %{_datadir}/%{name}/wwwroot/css | |
165 | %{_datadir}/%{name}/wwwroot/icon | |
166 | %{_datadir}/%{name}/wwwroot/js | |
167 | %attr(775,root,stats) /var/lib/%{name} |