-%define apache_version 1.3.6
-%define mod_name dav
Summary: WebDAV module for the Apache Web server
Summary(pl): Modu³ WebDAV dla webserwera Apache
+%define apache_version 1.3.6
+%define mod_name dav
Name: apache-mod_%{mod_name}
Version: 1.0.2
Release: 1
-License: OSI Approved
Group: Networking/Daemons
Group(de): Netzwerkwesen/Server
Group(pl): Sieciowe/Serwery
-Source0: http://www.webdav.org/mod_%{mod_name}/mod_%{mod_name}-%{version}-%{apache_version}.tar.gz
-URL: http://www.webdav.org/mod_%{mod_name}
+License: OSI Approved
+Source0: http://www.webdav.org/mod_dav/mod_%{mod_name}-%{version}-%{apache_version}.tar.gz
+URL: http://www.webdav.org/mod_dav/
Prereq: /usr/sbin/apxs
+BuildRequires: /usr/sbin/apxs
BuildRequires: expat-devel
BuildRequires: apache(EAPI)-devel >= %{apache_version}
Requires: apache(EAPI) >= %{apache_version}
Requires: expat
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+Obsoletes: mod_dav
%define _pkglibdir %(%{_sbindir}/apxs -q LIBEXECDIR)
%setup -q -n mod_%{mod_name}-%{version}-%{apache_version}
%build
-%configure \
+%configure2_13 \
--with-apxs=%{_sbindir}/apxs
%{__make} APXS=%{_sbindir}/apxs
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT%{_pkglibdir}
-install *.so $RPM_BUILD_ROOT%{_pkglibdir}
+install lib%{mod_name}.so $RPM_BUILD_ROOT%{_pkglibdir}/
+
+gzip -9nf README CHANGES INSTALL
+
+%post
+%{_sbindir}/apxs -e -a -n %{mod_name} %{_pkglibdir}/lib%{mod_name}.so 1>&2
+if [ -f /var/lock/subsys/httpd ]; then
+ %{_sysconfdir}/rc.d/init.d/httpd restart 1>&2
+fi
-gzip -9nf README CHANGES INSTALL LICENSE.html
+%preun
+if [ "$1" = "0" ]; then
+ /usr/sbin/apxs -e -A -n %{mod_name} %{_pkglibdir}/lib%{mod_name}.so 1>&2
+ 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
+%doc *.gz LICENSE.html
%attr(755,root,root) %{_pkglibdir}/*