SPECS: awstats.spec - Release: 1.5 - Awstats is started with uid o...

jajcus jajcus at pld-linux.org
Sun Aug 21 19:59:31 CEST 2005


Author: jajcus                       Date: Sun Aug 21 17:59:31 2005 GMT
Module: SPECS                         Tag: HEAD
---- Log message:
- Release: 1.5
- Awstats is started with uid of stats. Parsing logs with root privileges is a
  big security problem!
- all HTTP-accessible files moved to /usr/share/awstats/wwwroot, mixing Awstats
  files with Apache files doesn't seem like a good idea
- missing wwwroot/ files added to the package
- Apache configuration setting up awstats aliases, making
  http://localhost/awstats/awstats.pl working out of the box
- default configuration changed so it works out of the box and it is easy to
  add additional configs (virtual hosts)
- configuration file moved to /etc/awstats

---- Files affected:
SPECS:
   awstats.spec (1.36 -> 1.37) 

---- Diffs:

================================================================
Index: SPECS/awstats.spec
diff -u SPECS/awstats.spec:1.36 SPECS/awstats.spec:1.37
--- SPECS/awstats.spec:1.36	Tue Apr 19 11:12:54 2005
+++ SPECS/awstats.spec	Sun Aug 21 19:59:25 2005
@@ -1,16 +1,25 @@
 # $Revision$, $Date$
+#
+# TODO:
+#	- think about some trigger to upgrade from 6.5-1 and older 
+#         (I suggest just to forget about those broken version,
+#          unfortunately they have already landed in Ac)
+#
 %include	/usr/lib/rpm/macros.perl
 Summary:	Advanced Web Statistics is a free powerful server log file analyzer
 Summary(pl):	Zaawansowany program do analizowania logów serwera
 Name:		awstats
 Version:	6.5
-Release:	1
+Release:	1.5
 License:	GPL
 Group:		Applications/Networking
 Source0:	http://awstats.sourceforge.net/files/%{name}-%{version}.tgz
 # Source0-md5:	8a4a5f1ad25c45c324182ba369893a5a
-Source1:	%{name}-cron
+Source1:	%{name}.crontab
+Source2:	%{name}-httpd.conf
+Source3:	%{name}.conf
 Patch0:		%{name}_conf.patch
+Patch1:		%{name}-created_dir_mode.patch
 URL:		http://awstats.sourceforge.net/
 BuildRequires:	rpm-perlprov
 Requires:	perl-Geo-IP
@@ -19,8 +28,6 @@
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
-%define		wwwdir	/home/services/httpd
-
 %description
 Advanced Web Statistics is a powerful and featureful tool that
 generates advanced web server graphic statistics. This server log
@@ -39,11 +46,11 @@
 %description -l pl
 awstats (Advanced Web Statistics - zaawansowane statystyki WWW) to
 potężne i bogate w możliwości narzędzie generujące zaawansowane
-graficzne statystyki serwera WWW. Ten analizator logów serwera
-działa z linii poleceń lub jako CGI i pokazuje wszystkie informacje
-zawarte w logu w postaci graficznych stron WWW. Może analizować logi
-wielu serwerów WWW/WAP/proxy, takich jak Apache, IIS, Weblogic,
-Webstar, Squid... ale także serwerów pocztowych lub FTP.
+graficzne statystyki serwera WWW. Ten analizator logów serwera działa
+z linii poleceń lub jako CGI i pokazuje wszystkie informacje zawarte w
+logu w postaci graficznych stron WWW. Może analizować logi wielu
+serwerów WWW/WAP/proxy, takich jak Apache, IIS, Weblogic, Webstar,
+Squid... ale także serwerów pocztowych lub FTP.
 
 Ten program może mierzyć odwiedziny, odwiedzających, uwierzytelnionych
 użytkowników, strony, domeny/kraje, najbardziej zajęte godziny,
@@ -55,45 +62,75 @@
 
 %prep
 %setup -q
-%patch -p0
+%patch0 -p1
+%patch1 -p1
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{/etc/cron.hourly,%{_bindir}} \
-	$RPM_BUILD_ROOT%{_datadir}/awstats/{lang,lib,plugins/example} \
-	$RPM_BUILD_ROOT%{wwwdir}/{cgi-bin,html/icon/{browser,clock,cpu,flags,mime,os,other}}
-
-install tools/logresolvemerge.pl $RPM_BUILD_ROOT%{_bindir}/logresolvemerge.pl
-install tools/awstats_buildstaticpages.pl $RPM_BUILD_ROOT%{_bindir}/awstats_buildstaticpages.pl
-install tools/awstats_exportlib.pl $RPM_BUILD_ROOT%{_bindir}/awstats_exportlib.pl
-install tools/awstats_updateall.pl $RPM_BUILD_ROOT%{_bindir}/awstats_updateall.pl
-install wwwroot/cgi-bin/awstats.pl $RPM_BUILD_ROOT%{wwwdir}/cgi-bin/awstats.pl
-install wwwroot/cgi-bin/lib/* $RPM_BUILD_ROOT%{_datadir}/awstats/lib
-install wwwroot/cgi-bin/plugins/*.pm $RPM_BUILD_ROOT%{_datadir}/awstats/plugins
-install wwwroot/cgi-bin/plugins/example/* $RPM_BUILD_ROOT%{_datadir}/awstats/plugins/example
-install wwwroot/cgi-bin/awstats.model.conf $RPM_BUILD_ROOT%{_sysconfdir}/awstats.conf
-install wwwroot/icon/browser/* $RPM_BUILD_ROOT%{wwwdir}/html/icon/browser
-install wwwroot/icon/clock/* $RPM_BUILD_ROOT%{wwwdir}/html/icon/clock
-install wwwroot/icon/cpu/* $RPM_BUILD_ROOT%{wwwdir}/html/icon/cpu
-install wwwroot/icon/flags/* $RPM_BUILD_ROOT%{wwwdir}/html/icon/flags
-install wwwroot/icon/mime/* $RPM_BUILD_ROOT%{wwwdir}/html/icon/mime
-install wwwroot/icon/os/* $RPM_BUILD_ROOT%{wwwdir}/html/icon/os
-install wwwroot/icon/other/* $RPM_BUILD_ROOT%{wwwdir}/html/icon/other
-cp -a wwwroot/cgi-bin/lang/* $RPM_BUILD_ROOT%{_datadir}/awstats/lang
-install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.hourly/00awstats
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/{httpd,cron.d},%{_sysconfdir}/awstats,%{_bindir}} \
+	$RPM_BUILD_ROOT{%{_datadir}/awstats,/var/lib/awstats}
+
+install tools/awstats_* $RPM_BUILD_ROOT%{_bindir}
+install tools/{logresolvemerge,maillogconvert,urlaliasbuilder}.pl $RPM_BUILD_ROOT%{_bindir}
+cp -r wwwroot $RPM_BUILD_ROOT%{_datadir}/awstats
+mv $RPM_BUILD_ROOT%{_datadir}/awstats/wwwroot/cgi-bin/awstats.model.conf $RPM_BUILD_ROOT%{_sysconfdir}/awstats
+mv $RPM_BUILD_ROOT%{_datadir}/awstats/wwwroot/cgi-bin/{lang,lib,plugins} $RPM_BUILD_ROOT%{_datadir}/%{name}
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/cron.d/awstats
+install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/%{name}.conf
+install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/%{name}.conf
+ln -s %{_datadir}/awstats/wwwroot/cgi-bin/awstats.pl $RPM_BUILD_ROOT%{_bindir}
+
+%post
+if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*/%{name}.conf" /etc/httpd/httpd.conf; then
+	echo "Include /etc/httpd/%{name}.conf" >> /etc/httpd/httpd.conf
+	if [ -f /var/lock/subsys/httpd ]; then
+		/etc/rc.d/init.d/httpd restart 1>&2
+	fi
+elif [ -d /etc/httpd/httpd.conf ]; then
+	ln -sf /etc/httpd/%{name}.conf /etc/httpd/httpd.conf/99_%{name}.conf
+	if [ -f /var/lock/subsys/httpd ]; then
+		/etc/rc.d/init.d/httpd restart 1>&2
+	fi
+fi
+
+%preun
+if [ "$1" = "0" ]; then
+	umask 027
+	if [ -d /etc/httpd/httpd.conf ]; then
+		rm -f /etc/httpd/httpd.conf/99_%{name}.conf
+	else
+		grep -v "^Include.*%{name}.conf" /etc/httpd/httpd.conf > \
+			/etc/httpd/httpd.conf.tmp
+		mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
+	fi
+	if [ -f /var/lock/subsys/httpd ]; then
+		/etc/rc.d/init.d/httpd restart 1>&2
+	fi
+fi
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc README.TXT docs/*
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/awstats.conf
-%attr(750,root,root) /etc/cron.hourly/00awstats
+%doc README.TXT docs/* tools/webmin tools/xslt
+%dir %{_sysconfdir}/awstats
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/awstats/*.conf
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/httpd/%{name}.conf
+%attr(640,root,root) /etc/cron.d/awstats
 %attr(755,root,root) %{_bindir}/*
-%{_datadir}/%{name}
-%attr(750,root,http) %{wwwdir}/cgi-bin/*
-%{wwwdir}/html/*
+%dir %{_datadir}/%{name}
+%{_datadir}/%{name}/lang
+%{_datadir}/%{name}/lib
+%{_datadir}/%{name}/plugins
+%dir %{_datadir}/%{name}/wwwroot
+%dir %{_datadir}/%{name}/wwwroot/cgi-bin
+%attr(755,root,root) %{_datadir}/%{name}/wwwroot/cgi-bin/*
+%{_datadir}/%{name}/wwwroot/classes
+%{_datadir}/%{name}/wwwroot/css
+%{_datadir}/%{name}/wwwroot/icon
+%{_datadir}/%{name}/wwwroot/js
+%attr(775,root,stats) /var/lib/%{name}
 
 %define date	%(echo `LC_ALL="C" date +"%a %b %d %Y"`)
 %changelog
@@ -101,6 +138,19 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.37  2005/08/21 17:59:25  jajcus
+- Release: 1.5
+- Awstats is started with uid of stats. Parsing logs with root privileges is a
+  big security problem!
+- all HTTP-accessible files moved to /usr/share/awstats/wwwroot, mixing Awstats
+  files with Apache files doesn't seem like a good idea
+- missing wwwroot/ files added to the package
+- Apache configuration setting up awstats aliases, making
+  http://localhost/awstats/awstats.pl working out of the box
+- default configuration changed so it works out of the box and it is easy to
+  add additional configs (virtual hosts)
+- configuration file moved to /etc/awstats
+
 Revision 1.36  2005/04/19 09:12:54  kosmo
 - added mime icons.
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SPECS/awstats.spec?r1=1.36&r2=1.37&f=u




More information about the pld-cvs-commit mailing list