%define mod_name watch %define apxs /usr/sbin/apxs Summary: Apache module: Monitoring Interface for MRTG Summary(pl): Moduł do apache: Interfejs do monitorowania za pomocą MRTG Name: apache-mod_%{mod_name} Version: 3.12 Release: 1 License: BSD Group: Networking/Daemons Source0: http://www.snert.com/Software/mod_watch/mod_watch%(echo %{version} | sed -e "s#\.##g").tgz Source1: %{name}.conf URL: http://www.snert.com/Software/mod_watch/ BuildRequires: %{apxs} BuildRequires: apache(EAPI)-devel Prereq: %{_sbindir}/apxs Requires: apache(EAPI) BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) %define _pkglibdir %(%{apxs} -q LIBEXECDIR) %define _sysconfdir /etc/httpd %description This module will watch and collect the bytes, requests, and documents in & out per virtual host, file owner, remote-ip address, directory or location, and the web server as a whole. This module was designed for use with MRTG, which will make nice graphical representations of the data, but is general enough that it can be applied to other purposes, as the raw data is accessed by a URL. This module supports mod_vhost_alias and mod_gzip. %description -l pl Ten moduł kontroluje i zbiera informacje na temat ilości przesłanych bajtów (przychodzących i wychodzących) wg. serwera wirtualnego, właściciela plików, zdalnego adresu ip, katalogu lub lokacji oraz serwera jako całości. Moduł został zaprojektowany do pracy z MRTG, dzięki czemu otrzymamy ładną, graficzną reprezentacje danych. Moduł wspiera mod_vhost_alias oraz mod_gzip. %prep %setup -q -n mod_%{mod_name}-%{version} %build %{__make} build-dynamic %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}} install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir} install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_watch.conf gzip -9nf CHANGES* apache2mrtg* %post %{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 if [ -f /etc/httpd/httpd.conf ] && ! grep -q "^Include.*mod_watch.conf" /etc/httpd/httpd.conf; then echo "Include /etc/httpd/mod_watch.conf" >> /etc/httpd/httpd.conf fi if [ -f /var/lock/subsys/httpd ]; then /etc/rc.d/init.d/httpd restart 1>&2 fi %preun if [ "$1" = "0" ]; then %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2 grep -v "^Include.*mod_watch.conf" /etc/httpd/httpd.conf > \ /etc/httpd/httpd.conf.tmp mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf 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 *.gz *htm %attr(755,root,root) %{_pkglibdir}/*