%define name mod_auth_external %define version 2.1.18 %define apache_version 1.3.33 %define release 4mdk Summary: Apache authentication using external program Name: %{name} Version: %{version} Release: %{release} Group: System/Servers License: Apache License URL: http://www.unixpapa.com/mod_auth_external.html Source0: http://www.unixpapa.com/software/mod_auth_external-%{version}.tar.bz2 Source1: mod_auth_external.conf Source2: pwauth.pam Patch0: mod_auth_external-2.1.14-pam.patch.bz2 Patch1: mod_auth_external-2.1.18-conf.patch.bz2 Patch2: mod_auth_external-2.1.18-server.patch.bz2 Patch3: mod_auth_external-2.1.18-apache.patch.bz2 Patch4: mod_auth_external-2.1.15-64bit-fixes.patch.bz2 Prereq: apache = %{apache_version} Prereq: apache-common >= %{apache_version} Prereq: apache-conf >= %{apache_version} BuildRequires: pam-devel BuildRequires: apache-devel BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root/ %description Apache external authentication module - uses PAM. %prep %setup -q %patch0 -p0 %patch1 -p1 %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 [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} install -d %{buildroot}%{_libdir}/apache-extramodules install -d %{buildroot}%{_libdir}/apache install -d %{buildroot}%{_sysconfdir}/pam.d install -d %{buildroot}%{_sysconfdir}/httpd/conf/addon-modules # 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}%{_sysconfdir}/httpd/conf/addon-modules # 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 install -d %{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 install -d %{buildroot}%{_var}/www/html/addon-modules pushd %{buildroot}%{_var}/www/html/addon-modules ln -s ../../../..%{_docdir}/%{name}-%{version} %{name} popd %pre #Check config file sanity if [ -e %{_sbindir}/ap13chkconfig ]; then %{_sbindir}/ap13chkconfig;fi %post if [ $1 = "1" ]; then #We're in Install mode, add module to the config files for config in %{_sysconfdir}/httpd/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 if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi 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 %{_sysconfdir}/httpd/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 if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi fi %postun if [ $1 = "0" ]; then for config in %{_sysconfdir}/httpd/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 if [ -e %{_sbindir}/ADVXctl ]; then %{_sbindir}/ADVXctl update;fi fi %clean [ "%{buildroot}" != "/" ] && rm -rf %{buildroot} %files %defattr(-,root,root) %attr(0555,root,root) %{_libdir}/apache-extramodules/mod_auth_external.so %config(noreplace) %{_sysconfdir}/httpd/conf/addon-modules/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}/* %{_var}/www/html/addon-modules/* %changelog * Tue Feb 15 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 2.1.18-4mdk - spec file cleanups, remove the ADVX-build stuff * Sun Nov 21 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.1.18-3mdk - built for apache 1.3.33 * Tue Jul 13 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.1.18-2mdk - remove redundant provides * Thu Jun 10 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 2.1.18-1mdk - 2.1.18 - rediff P1-P3 - built for apache 1.3.31 * Sun Nov 09 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 2.1.15-10mdk - built for apache 1.3.29 * Tue Sep 16 2003 Jean-Michel Dault <jmdault@mandrakesoft.com> 2.1.15-9mdk - rebuild with apache 1.3.28 * 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.