Blob Blame History Raw
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%define pear_name File_Passwd

Name:           php-pear-File-Passwd
Version:        1.1.6
Release:        2%{?dist}
Summary:        Manipulate many kinds of password files

Group:          Development/Languages
License:        PHP License
URL:            http://pear.php.net/package/File_Passwd
Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
Source1:        PHP-LICENSE-3.01
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  php-pear >= 1:1.4.9-1.2
Requires:       php-pear(PEAR)
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:       php-pear(%{pear_name}) = %{version}

# Samba not required for RHEL
%if !0%{?rhel}
Requires: php-pear(Crypt_CHAP) >= 1.0.0
%endif

%description
Provides methods to manipulate and authenticate against standard Unix,
SMB server, AuthUser (.htpasswd), AuthDigest (.htdigest), CVS pserver
and custom formatted password files.


%prep
%setup -qc
[ -f package2.xml ] || mv package.xml package2.xml
mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml
install -pm 644 -c %{SOURCE1} LICENSE
cd %{pear_name}-%{version}


%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.


%install
cd %{pear_name}-%{version}
rm -rf $RPM_BUILD_ROOT docdir
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{pear_name}.xml

# Clean up unnecessary files
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*

# Install XML package description
install -d $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{pear_name}.xml $RPM_BUILD_ROOT%{pear_xmldir}

# Remove samba extension for RHEL
%if 0%{?rhel}
rm -f $RPM_BUILD_ROOT%{pear_phpdir}/File/Passwd/Smb.php
rm -f $RPM_BUILD_ROOT%{pear_testdir}/%{pear_name}/tests/*smb.*
%endif


%clean
rm -rf $RPM_BUILD_ROOT


%post
%{__pear} install --nodeps --soft --force --register-only \
    %{pear_xmldir}/%{pear_name}.xml >/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
        %{pear_name} >/dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc LICENSE
%{pear_xmldir}/%{pear_name}.xml
%{pear_testdir}/%{pear_name}
%dir %{pear_phpdir}/File
%{pear_phpdir}/File/Passwd*


%changelog
* Sun May 13 2007 Christopher Stone <chris.stone@gmail.com> 1.1.6-2
- Include samba extension as default for Fedora
- Exclude samba extension from Enterprise Linux

* Tue Mar 13 2007 Christopher Stone <chris.stone@gmail.com> 1.1.6-1
- Initial Fedora release