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

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

Group:          Development/Languages
License:        PHP
URL:            http://pear.php.net/package/File_Passwd
Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz

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}

Requires: php-pear(Crypt_CHAP) >= 1.0.0


%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
# Create a "localized" php.ini to avoid build warning
cp /etc/php.ini .
echo "date.timezone=UTC" >>php.ini

cd %{pear_name}-%{version}
# package.xml is V2
mv ../package.xml %{name}.xml


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


%install
cd %{pear_name}-%{version}
rm -rf $RPM_BUILD_ROOT docdir
PHPRC=../php.ini %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{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 %{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}/%{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,-)
%{pear_xmldir}/%{name}.xml
%{pear_testdir}/%{pear_name}
%dir %{pear_phpdir}/File
%{pear_phpdir}/File/Passwd*


%changelog
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Thu Aug 26 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.1.7-2
- clean define
- remove LICENSE (not provided by upstream)
- rename File_Passwd.xml to php-pear-File-Passwd.xml
- set date.timezone during build

* Sat Sep 05 2009 Christopher Stone <chris.stone@gmail.com> 1.1.7-1
- Upstream sync

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Jun 14 2008 Christopher Stone <chris.stone@gmail.com> 1.1.6-3
- Rebuild for vendor tag (bz #451361)

* 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