Sophie

Sophie

distrib > Mandriva > 9.1 > i586 > by-pkgid > 39b4c07b5da0265a3d36f3b17ae80825 > files > 8

mod_auth_external-2.1.15-8mdk.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 version 2.1.15
%define release 8mdk
%define name    mod_auth_external

Summary: Apache authentication using external program
Name: %{name}
Version: %{version}
Release: %{release}
Group: System/Servers
License: Apache License
Source0: http://www.unixpapa.com/software/mod_auth_external-%{version}.tar.bz2
Source1: mod_auth_external.conf
Source2: pwauth.pam
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root/
URL: http://www.unixpapa.com/mod_auth_external.html
Patch0: mod_auth_external-2.1.14-pam.patch.bz2
Patch1: mod_auth_external-2.1.14-conf.patch.bz2
Patch2: mod_auth_external-2.1.14-server.patch.bz2
Patch3: mod_auth_external-2.1.15-apache.patch.bz2
Patch4: mod_auth_external-2.1.15-64bit-fixes.patch.bz2
Prefix: %{_prefix}

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

BuildRequires: ADVX-build >= 1.2
BuildRequires: pam-devel, apache-devel
Provides: 	ADVXpackage
Provides:	AP13package

%description
Apache external authentication module - uses PAM.

%prep
%setup -q
%patch0
%patch1
%patch2 -p1
%patch3 -p1
%patch4 -p1 -b .64bit-fixes

%build
/usr/sbin/apxs -c mod_auth_external.c
cd pwauth
make LIB="-lpam -ldl  -DEAPI"

%install

rm -rf %{buildroot}
mkdir -p %{buildroot}%{_libdir}/apache-extramodules
mkdir -p %{buildroot}%{_libdir}/apache
mkdir -p %{buildroot}%{_sysconfdir}/pam.d
mkdir -p %{buildroot}%{ap_addonconf}

# Files installation
install -s mod_auth_external.so %{buildroot}%{_libdir}/apache-extramodules
install -s pwauth/pwauth %{buildroot}%{_libdir}/apache
install -s pwauth/unixgroup %{buildroot}%{_libdir}/apache
install -m 644 %{SOURCE1} %{buildroot}%{ap_addonconf}

# for PAM Auth
install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/pwauth
install -m 644 %{SOURCE2} ${RPM_BUILD_ROOT}%{_sysconfdir}/pam.d/unixgroup

# Doc installation
mkdir -p %{buildroot}%{_docdir}/%{name}-%{version}
cp pwauth/README %{buildroot}%{_docdir}/%{name}-%{version}/pwauth.txt
cp pwauth/FORM_AUTH %{buildroot}%{_docdir}/%{name}-%{version}
# Doc permissions fix
chmod a+r INSTALL*
chmod a+r README
cp README %{buildroot}%{_docdir}/%{name}-%{version}/mod_auth_external.txt
cp INSTALL* CHANGES TODO AUTHENTICATORS %{buildroot}%{_docdir}/%{name}-%{version}

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

%pre
#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/mod_auth_external.so mod_auth_external.c external_auth_module \
        define=HAVE_AUTH_EXTERNAL addconf=conf/addon-modules/mod_auth_external.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/mod_auth_external.so mod_auth_external.c external_auth_module \
        define=HAVE_AUTH_EXTERNAL addconf=conf/addon-modules/mod_auth_external.conf
     fi
     if [ -x %{_sbindir}/advxaddmod -a -e $config ]; then
       %{_sbindir}/advxaddmod $config \
        extramodules/mod_auth_external.so mod_auth_external.c external_auth_module \
        define=HAVE_AUTH_EXTERNAL addconf=conf/addon-modules/mod_auth_external.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/mod_auth_external.so mod_auth_external.c external_auth_module \
        define=HAVE_AUTH_EXTERNAL addconf=conf/addon-modules/mod_auth_external.conf
     fi
   done
   %ADVXpost
fi

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root)
%attr(0555,root,root) %{_libdir}/apache-extramodules/mod_auth_external.so
%config(noreplace) %{ap_addonconf}/mod_auth_external.conf
%attr(04550,root,apache) %{_libdir}/apache/pwauth
%attr(04550,root,apache) %{_libdir}/apache/unixgroup
%attr(0644,root,root) %config(noreplace)  /etc/pam.d/pwauth
%attr(0644,root,root) %config(noreplace)  /etc/pam.d/unixgroup
%dir %{_docdir}/%{name}-%{version}
%doc %{_docdir}/%{name}-%{version}/*
%{ap_webdoc}/*

%changelog
* Thu Feb 13 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.1.15-8mdk
- new macroized libmm version
- add AP13pre macro to make sure about the sanity of the conf files

* Mon Jan  6 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.1.15-7mdk
- 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. 

* Wed Nov 27 2002 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> 2.1.15-6mdk
- Make it lib64 aware
- Patch4: 64-bit fixes

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

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

* Tue Jul  9 2002 Pixel <pixel@mandrakesoft.com> 2.1.15-3mdk
- 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> 2.1.15-2mdk
- rebuild against latest apache.

* Sat May 18 2002 Christian Belisle <cbelisle@mandrakesoft.com> 2.1.15-1mdk
- new version.
- build with gcc 3.1.
- updated Patch3 to show new version.

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

* Mon Mar 04 2002 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.1.14-9mdk
- Patched so we know easily if the module is loaded.

* Thu Feb 28 2002 Christian Belisle <cbelisle@mandrakesoft.com> 2.1.14-8mdk
- Fix documentation permissions.

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

* Wed Feb 06 2002 Christian Belisle <cbelisle@mandrakesoft.com> 2.1.14-6mdk
- Remake the post and postun sections (now like other apache modules).
- Spec cleanup.
- Correct config file for the new location of the module.

* Mon Feb 04 2002 Christian Belisle <cbelisle@mandrakesoft.com> 2.1.14-5mdk
- Rebuild against last apache.

* Wed Jan 30 2002 Philippe Libat <philippe@mandrakesoft.com> 2.1.14-4mdk
- Patch2: fix server_uid
- include unixgroup auth.

* Tue Jan 29 2002 Christian Belisle <cbelisle@mandrakesoft.com> 2.1.14-3mdk
- Fix doc permission

* Tue Jan 29 2002 Christian Belisle <cbelisle@mandrakesoft.com> 2.1.14-2mdk
- Fix typo in the pam patch.

* Thu Jan 17 2002 Christian Belisle <cbelisle@mandrakesoft.com> 2.1.14-1mdk
- Fix %%apachebase var (so fix %%post and %%postun).
- Release 2.1.14
- Update patches

* Fri Jul 13 2001 Philippe Libat <philippe@mandrakesoft.com> 2.1.12-1mdk
- New version

* Thu Jun 28 2001 Philippe Libat <philippe@mandrakesoft.com> 2.1.11-1mdk
- update version

* Thu Aug 31 2000 Philippe Libat <philippe@mandrakesoft.com> 2.1.2-1mdk
- Linux-Mandrake adaptations

* Sat Jun 10 2000 Charlie Brady <charlieb@e-smith.net>
- Make sure that "www" group exists before installing.

* Wed May 31 2000 Charlie Brady <charlieb@e-smith.net>
- Fix permissions/ownership - don't want build time group, want install time.