Sophie

Sophie

distrib > Mandriva > 2008.0 > i586 > by-pkgid > e714664e00fc7cd29bce818a2a1a5797 > files > 2

php-pam-1.0.0-6mdv2008.0.src.rpm

%define modname pam
%define dirname %{modname}
%define soname %{modname}.so
%define inifile A55_%{modname}.ini

Summary:	PAM integration for PHP
Name:		php-%{modname}
Version:	1.0.0
Release:	%mkrel 6
Group:		Development/PHP
License:	PHP License
URL:		http://pecl.php.net/package/pam
Source0:	http://pecl.php.net/get/%{modname}-%{version}.tar.bz2
BuildRequires:	php-devel >= 3:5.2.0
BuildRequires:	pam-devel
BuildRoot:	%{_tmppath}/%{name}-%{version}-buildroot

%description
This extension provides PAM (Pluggable Authentication Modules) integration. PAM
is a system of libraries that handle the authentication tasks of applications
and services. The library provides a stable API for applications to defer to
for authentication tasks.

%prep

%setup -q -n %{modname}-%{version}
[ "../package*.xml" != "/" ] && mv ../package*.xml .

# lib64 fix
perl -pi -e "s|/lib\b|/%{_lib}|g" config.m4

%build
%serverbuild

# the autofoo stuff is too borked at the moment...
#phpize
#%%configure2_5x --with-libdir=%{_lib} \
#    --with-%{modname}=shared,/%{_lib}
#
#%make
#mv modules/*.so .

%{_usrsrc}/php-devel/buildext %{modname} "pam.c" \
    "-L/%{_lib}/security -L/%{_lib} -I%{_includedir}/security -lpam -ldl" \
    "-DCOMPILE_DL_PAM -DHAVE_PAM -DHAVE_SECURITY_PAM_APPL_H"

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot} 

install -d %{buildroot}%{_sysconfdir}/php.d
install -d %{buildroot}%{_sysconfdir}/pam.d
install -d %{buildroot}%{_libdir}/php/extensions

install -m755 %{soname} %{buildroot}%{_libdir}/php/extensions/

cat > %{buildroot}%{_sysconfdir}/php.d/%{inifile} << EOF
extension = %{soname}

[pam]
pam.servicename = "%{name}";
EOF

# fix conditional pam config file
%if %{mdkversion} < 200610
cat > %{buildroot}%{_sysconfdir}/pam.d/%{name} <<EOF
auth	sufficient	pam_pwdb.so shadow nodelay
account	sufficient	pam_pwdb.so
EOF
%else
cat > %{buildroot}%{_sysconfdir}/pam.d/%{name} <<EOF
#%PAM-1.0
auth	include	system-auth
account	include	system-auth
EOF
%endif

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files 
%defattr(-,root,root)
%doc README CREDITS package*.xml 
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/pam.d/%{name}
%config(noreplace) %attr(0644,root,root) %{_sysconfdir}/php.d/%{inifile}
%attr(0755,root,root) %{_libdir}/php/extensions/%{soname}


%changelog
* Sat Sep 01 2007 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-6mdv2008.0
+ Revision: 77565
- rebuilt against php-5.2.4

* Thu Jun 14 2007 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-5mdv2008.0
+ Revision: 39513
- use distro conditional -fstack-protector

* Fri Jun 01 2007 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-4mdv2008.0
+ Revision: 33867
- rebuilt against new upstream version (5.2.3)

* Thu May 03 2007 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-3mdv2008.0
+ Revision: 21347
- rebuilt against new upstream version (5.2.2)


* Thu Feb 08 2007 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-2mdv2007.0
+ Revision: 117604
- rebuilt against new upstream version (5.2.1)

* Mon Nov 13 2006 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-1mdv2007.0
+ Revision: 83617
- Import php-pam

* Mon Nov 13 2006 Oden Eriksson <oeriksson@mandriva.com> 1.0.0-1mdv2007.1
- initial Mandriva package