]> git.pld-linux.org Git - packages/apache1-mod_watch.git/blobdiff - apache1-mod_watch.spec
- fixed macro
[packages/apache1-mod_watch.git] / apache1-mod_watch.spec
index ab840c16e12b49cded44857f0e487895cfd675a7..c0ed01b4d4688175681355f74d314f4664c0bd67 100644 (file)
@@ -3,12 +3,15 @@
 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
@@ -17,7 +20,6 @@ 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
@@ -37,36 +39,41 @@ graficzn
 
 %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
-%{_sbindir}/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
+%{apxs} -e -a -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+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
-       %{_sbindir}/apxs -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
-        grep -v -q "^Include.*mod_watch.conf" /etc/httpd/httpd.conf > \
-                /etc/httpd/httpd.conf.tmp
-        mv -f /etc/httpd/httpd.conf.tmp /etc/httpd/httpd.conf
+       %{apxs} -e -A -n %{mod_name} %{_pkglibdir}/mod_%{mod_name}.so 1>&2
+       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
 
@@ -75,5 +82,6 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc *.gz *htm
+%doc CHANGES* *.html
 %attr(755,root,root) %{_pkglibdir}/*
+%{_sysconfdir}/httpd/mod_watch.conf
This page took 0.036101 seconds and 4 git commands to generate.