%define version 2.1.14 %define release 9mdk %define name mod_auth_external %define apachebase %{_sysconfdir}/httpd %define apachecontent /var/www/html Summary: Apache authentication using external program Name: %{name} Version: %{version} Release: %{release} Group: System/Servers License: Apache License Source0: mod_auth_external-%{version}.tar.bz2 Source1: mod_auth_external.conf Source2: pwauth.pam BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root/ URL: http://www.wwnet.net/~janc/mod_auth_external.html Patch0: mod_auth_external-%{version}-pam.patch.bz2 Patch1: mod_auth_external-%{version}-conf.patch.bz2 Patch2: mod_auth_external-%{version}-server.patch.bz2 Patch3: mod_auth_external.patch.bz2 Prefix: %{_prefix} Requires: apache BuildRequires: pam-devel, apache-devel %description Apache external authentication module - uses PAM. %prep %setup -q %patch0 %patch1 %patch2 -p1 %patch3 -p1 %build /usr/sbin/apxs -c mod_auth_external.c cd pwauth make LIB="-lpam -ldl -DEAPI" %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache-extramodules mkdir -p $RPM_BUILD_ROOT%{_libdir}/apache mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/pam.d mkdir -p $RPM_BUILD_ROOT%{apachebase}/conf/addon-modules # Files installation install -s mod_auth_external.so $RPM_BUILD_ROOT%{_libdir}/apache-extramodules install -s pwauth/pwauth $RPM_BUILD_ROOT%{_libdir}/apache install -s pwauth/unixgroup $RPM_BUILD_ROOT%{_libdir}/apache install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{apachebase}/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 mkdir -p $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} cp pwauth/README $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/pwauth.txt cp pwauth/FORM_AUTH $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} # Doc permissions fix chmod a+r INSTALL* chmod a+r README cp README $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version}/mod_auth_external.txt cp INSTALL* CHANGES TODO AUTHENTICATORS $RPM_BUILD_ROOT%{_docdir}/%{name}-%{version} # Doc linking mkdir -p $RPM_BUILD_ROOT%{apachecontent}/addon-modules pushd $RPM_BUILD_ROOT%{apachecontent}/addon-modules ln -s ../../../..%{_docdir}/%{name}-%{version} %{name} popd %post if [ $1 = "1" ]; then #We're in Install mode, add module to the config files for config in %{apachebase}/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 [ -x %{_sbindir}/AESctl ]; then %{_sbindir}/AESctl 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 %{apachebase}/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 [ -x %{_sbindir}/AESctl ]; then %{_sbindir}/AESctl update;fi fi #### (cb) 02/02/05 This code was there before. I keep it in case of problems. # for the NAAT configuration #if [ -e %{apachebase}/conf/httpd.conf ]; then #echo "Include conf/addon-modules/mod_auth_external.conf" >> %{apachebase}/conf/httpd.conf #/usr/sbin/AESctl update; fi %postun if [ $1 = "0" ]; then for config in %{apachebase}/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 [ -x %{_sbindir}/AESctl ]; then %{_sbindir}/AESctl update;fi fi #### (cb) 02/02/05 This code was there before. I keep it in case of problems. #if [ -e %{apachebase}/conf/httpd.conf ]; then #%{_bindir}/perl -pi -e "s|Include conf/addon-modules/mod_auth_external.conf\n||g;" \ # %{apachebase}/conf/httpd.conf #/usr/sbin/AESctl update; fi %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %attr(0555,root,root) %{_libdir}/apache-extramodules/mod_auth_external.so %config(noreplace) %{apachebase}/conf/addon-modules/mod_auth_external.conf %attr(04550,root,apache) /usr/lib/apache/pwauth %attr(04550,root,apache) /usr/lib/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}/* %{apachecontent}/addon-modules/* %changelog * 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.