Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 4212bbd0660c1ef1e3493a0b6374760d > files > 4

mod_dav-1.0.3-16mdk.src.rpm

#New ADVX macros
%define ADVXdir %{_datadir}/ADVX
%{expand:%(cat %{ADVXdir}/ADVX-build)}

%{expand:%%define apache_version %(rpm -q apache-devel|sed 's/apache-devel-\([0-9].*\)-.*$/\1/')}
%{expand:%%define apache_release %(rpm -q apache-devel|sed 's/apache-devel-[0-9].*-\(.*\)$/\1/')}

%{expand:%%define mm_major %(mm-config --version|sed 's/MM \([0-9]\)\.\([0-9.].*\) \(.*\)$/\1/')}
%{expand:%%define mm_minor %(mm-config --version|sed 's/MM \([0-9]\)\.\([0-9.].*\) \(.*\)$/\2/')}
%define mm_version %{mm_major}.%{mm_minor}

%define name mod_dav
%define version 1.0.3
%define release 16mdk
%define srcver %{version}-1.3.6
%define expat_version 1.95.2

Summary: DAV module for Apache
Name: %{name}
Version: %{version}
Release: %{release}
Source0: http://www.webdav.org/mod_dav/%{name}-%{srcver}.tar.bz2
URL: http://www.webdav.org/mod_dav/
Source1: mod_dav.conf
Patch: mod_dav-shared-expat.patch.bz2
License: Apache License
Group: System/Servers
BuildRoot: %{_tmppath}/%{name}-buildroot
Prefix: %{_prefix}

Prereq: apache = %{apache_version}
Prereq:	apache-common >= %{apache_version}
Prereq:	apache-conf >= %{apache_version}
Prereq: mm = %{mm_major}.%{mm_minor}

Requires: libexpat1_95
BuildRequires: ADVX-build >= 1.2
BuildRequires: apache-devel = %{apache_version} 
BuildRequires: libexpat1_95-devel
PreReq: rpm-helper
Provides: 	ADVXpackage
Provides:	AP13package

%description
mod_dav enables Apache to understand DAV protocol (extensions to
HTTP). DAV stands for "Distributed Authoring and Versioning", and is
defined by RFC 2518. DAV is intended to replace proprietary authoring
protocols such as those used by Frontpage or NetObjects' Fusion, but
is also a complete set of protocols for manipulating a webserver's
files and directories, and their properties.

%prep
%setup -q -n %{name}-%{srcver}

%patch -p1

%build


#Do not use serverbuild here...
#Use same flags as the rest of Apache
#Otherwise it segfaults
#%serverbuild
#%configure --with-apxs=%{_sbindir}/apxs
#%make
%configure
%make

%install

rm -rf %{buildroot}
mkdir -p %{buildroot}%{_libdir}/apache-extramodules
mkdir -p %{buildroot}%{ap_base}/conf/addon-modules

# Files installation
install -m 755 libdav.so %{buildroot}%{_libdir}/apache-extramodules
install -m 644 %{SOURCE1} %{buildroot}%{ap_base}/conf/addon-modules

# Lock installation
mkdir -p %{buildroot}/var/lock/mod_dav
chmod o-rwx %{buildroot}/var/lock/mod_dav

# Doc installation
mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}
cp README %{buildroot}%{_docdir}/%{name}-%{version}/mod_dav.txt
cp CHANGES INSTALL LICENSE.html %{buildroot}%{_docdir}/%{name}-%{version}

# Doc linking
mkdir -p %{buildroot}%{ap_webdoc}
pushd %{buildroot}%{ap_webdoc}
ln -s ../../../..%{_docdir}/%{name}-%{version} %{name}
popd

%pre
%_pre_useradd apache /var/www /bin/sh
#Check config file sanity
%AP13pre

%post
if [ $1 = "1" ]; then
   #We're in Install mode, add module to the config files
   for config in %{ap_base}/conf/{httpd,httpd-perl}.conf; do
     if [ -x %{_sbindir}/advxaddmod -a -e $config ]; then
       %{_sbindir}/advxaddmod $config \
        extramodules/libdav.so mod_dav.c dav_module \
        define=HAVE_DAV addconf=conf/addon-modules/mod_dav.conf
     fi
   done
   %ADVXpost
fi

if [ $1 -gt 1 ]; then
   #We're in *upgrade mode*. Since we can't be sure the configuration files
   #are sane, remove module from the conf files to clean them, re-add again 
   #in a way that the older module we're replacing won't try to erase (the 
   #post scripts were broken on some packages), and finally clean the module
   #specific config file so it's compatible with the upgrade.
   for config in %{ap_base}/conf/{httpd,httpd-perl}.conf; do
     if [ -x %{_sbindir}/advxdelmod -a -e $config ]; then
       %{_sbindir}/advxdelmod $config \
       extramodules/libdav.so mod_dav.c dav_module \
       define=HAVE_DAV addconf=conf/addon-modules/mod_dav.conf
     fi
     if [ -x %{_sbindir}/advxaddmod -a -e $config ]; then
       %{_sbindir}/advxaddmod $config \
        extramodules/libdav.so mod_dav.c dav_module \
        define=HAVE_DAV addconf=conf/addon-modules/mod_dav.conf
     fi
   done
   %ADVXpost
fi

%postun
if [ $1 = "0" ]; then
   for config in %{ap_base}/conf/{httpd,httpd-perl}.conf; do
     if [ -x %{_sbindir}/advxdelmod -a -e $config ]; then
       %{_sbindir}/advxdelmod $config \
        extramodules/libdav.so mod_dav.c dav_module \
        define=HAVE_DAV addconf=conf/addon-modules/mod_dav.conf
     fi
   done
   %ADVXpost
fi

%_postun_userdel apache

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{_libdir}/apache-extramodules/libdav.so
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/*
%config(noreplace) %{ap_base}/conf/addon-modules/mod_dav.conf
%attr(-,apache,apache) %dir /var/lock/mod_dav
%{ap_webdoc}/*

%changelog
* Sun Nov 09 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 1.0.3-16mdk
- built for apache 1.3.29

* Tue Sep 16 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 1.0.3-15mdk
- rebuild with apache 1.3.28

* Thu Feb 13 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 1.0.3-14mdk
- new macros from ADVX-build

* Mon Jan 06 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 1.0.3-13mdk
- rebuilt for new mm version
- Add Provides: ADVXpackage, all ADVX package will have this tag, 
  so we can easily do a rpm --whatprovides ADVXpackage to find out
  what ADVX packages a user has installed on his system. 

* Fri Nov  8 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 1.0.3-12mdk
- Rebuild for Cooker

* Mon Oct 28 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 1.0.3-11mdk
- Rebuild with new apache

* Fri Jul 12 2002 Frederic Lepied <flepied@mandrakesoft.com> 1.0.3-10mdk
- add apache user

* Tue Jul  9 2002 Pixel <pixel@mandrakesoft.com> 1.0.3-9mdk
- rebuild (so that it builds with "-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64")
  => fix segfault

* Wed Jun 26 2002 Christian Belisle <cbelisle@mandrakesoft.com> 1.0.3-8mdk
- rebuild against latest apache.
- use %%configure and %%make.

* Sat May 18 2002 Christian Belisle <cbelisle@mandrakesoft.com> 1.0.3-7mdk
- Build with gcc 3.1.

* Mon Apr 15 2002 Christian Belisle <cbelisle@mandrakesoft.com> 1.0.3-6mdk
- Apache 1.3.24.

* Mon Mar 04 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 1.0.3-5mdk
- Recompile for new expat policy (ie, always use dynamic library instead of
  each apache application linking its static one.
- Fix segfaults

* Wed Feb 06 2002 Christian Belisle <cbelisle@mandrakesoft.com> 1.0.3-4mdk
- Add documentation %{apachecontent}/addon-modules

* Wed Feb 06 2002 Christian Belisle <cbelisle@mandrakesoft.com> 1.0.3-3mdk
- Add apache in the Requires.
- Add expat in the Requires and BuildRequires.
- Remake post and postun to respect apache modules installation standard.
- Change module folder in config file to reflect changes in package.

* Mon Feb 04 2002 Christian Belisle <cbelisle@mandrakesoft.com> 1.0.3-2mdk
- Rebuild against last apache.
- Make setup quiet

* Thu Nov  8 2001 Frederic Lepied <flepied@mandrakesoft.com> 1.0.3-1mdk
- 1.0.3

* Tue Oct 16 2001 Christian Belisle <cbelisle@mandrakesoft.com> 1.0.2-3mdk
- s/Copyright/License/.
- apache 1.3.22.

* Mon Oct  1 2001 Frederic Lepied <flepied@mandrakesoft.com> 1.0.2-2mdk
- append a trailing / to the default lock dir.

* Sun Sep 30 2001 Frederic Lepied <flepied@mandrakesoft.com> 1.0.2-1mdk
- first Mandrake Linux version

# end of file