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
+Version: 3.13
+%define ver %(echo %{version} | tr -d .)
+Release: 3
License: BSD
Group: Networking/Daemons
-Source0: http://www.snert.com/Software/mod_watch/mod_watch%(echo %{version} | sed -e "s#\.##g").tgz
+Source0: http://www.snert.com/Software/mod_watch/mod_watch%{ver}.tgz
+# Source0-md5: 89ca8cee3315d8073359d47104583aee
Source1: %{name}.conf
+Patch0: %{name}-PLD-v6stuff.patch
URL: http://www.snert.com/Software/mod_watch/
BuildRequires: %{apxs}
BuildRequires: apache(EAPI)-devel
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
%prep
%setup -q -n mod_%{mod_name}-%{version}
+%patch -p0
%build
%{__make} build-dynamic
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}}
+install -d $RPM_BUILD_ROOT{%{_pkglibdir},%{_sysconfdir}/httpd}
install mod_%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}
-install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/mod_watch.conf
+install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/mod_watch.conf
-gzip -9nf CHANGES* apache2mrtg*
+mv mod_watch.html mod_watch_pl.html
+sed -e 's/<!--#/<!--/g' index.shtml > mod_watch.html
%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
+if [ -f %{_sysconfdir}/httpd/httpd.conf ] && \
+ ! grep -q "^Include.*mod_watch.conf" %{_sysconfdir}/httpd/httpd.conf; then
+ echo Include %{_sysconfdir}/httpd/mod_watch.conf >> %{_sysconfdir}/httpd/httpd.conf
fi
if [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
+ %{_sysconfdir}/rc.d/init.d/httpd restart 1>&2
+else
+ echo "Run \"/etc/rc.d/init.d/httpd start\" to start apache http daemon."
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
+ grep -v "^Include.*mod_watch.conf" %{_sysconfdir}/httpd/httpd.conf > \
+ %{_sysconfdir}/httpd/httpd.conf.tmp
+ mv -f %{_sysconfdir}/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
if [ -f /var/lock/subsys/httpd ]; then
- /etc/rc.d/init.d/httpd restart 1>&2
+ %{_sysconfdir}/rc.d/init.d/httpd restart 1>&2
fi
fi
%files
%defattr(644,root,root,755)
-%doc *.gz *htm
+%doc CHANGES* *.html
%attr(755,root,root) %{_pkglibdir}/*
+%{_sysconfdir}/httpd/mod_watch.conf