xulchris 875447e
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
b9b5805
%global pear_name File
xulchris 875447e
xulchris 875447e
Name:           php-pear-File
xulchris aeff3c7
Version:        1.3.0
b9b5805
Release:        4%{?dist}
xulchris 875447e
Summary:        Common file and directory routines
xulchris 875447e
xulchris 875447e
Group:          Development/Languages
xulchris aeff3c7
License:        PHP
xulchris 875447e
URL:            http://pear.php.net/package/File
xulchris 875447e
Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
b9b5805
xulchris 875447e
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
xulchris 875447e
xulchris 875447e
BuildArch:      noarch
b9b5805
BuildRequires:  php-pear(PEAR) >= 1.5.3
b9b5805
Requires:       php-pear(PEAR) >= 1.5.3
xulchris 875447e
Requires(post): %{__pear}
xulchris 875447e
Requires(postun): %{__pear}
xulchris 875447e
Provides:       php-pear(%{pear_name}) = %{version}
xulchris 875447e
xulchris 875447e
%description
xulchris 875447e
Provides easy access to read/write to files along with some common routines
xulchris 875447e
to deal with paths. Also provides interface for handling CSV files.
xulchris 875447e
xulchris 875447e
xulchris 875447e
%prep
xulchris aeff3c7
%setup -qc
b9b5805
b9b5805
# Create a "localized" php.ini to avoid build warning
b9b5805
cp /etc/php.ini .
b9b5805
echo "date.timezone=UTC" >>php.ini
b9b5805
xulchris 875447e
cd %{pear_name}-%{version}
b9b5805
# Package is V2
b9b5805
mv ../package.xml %{name}.xml
xulchris 875447e
xulchris 875447e
xulchris 875447e
%build
xulchris 875447e
cd %{pear_name}-%{version}
xulchris 875447e
# Empty build section, most likely nothing required.
xulchris 875447e
xulchris 875447e
xulchris 875447e
%install
xulchris 875447e
cd %{pear_name}-%{version}
xulchris 875447e
rm -rf $RPM_BUILD_ROOT docdir
b9b5805
PHPRC=../php.ini %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
xulchris 875447e
xulchris 875447e
# Clean up unnecessary files
xulchris 875447e
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
xulchris 875447e
xulchris 875447e
# Install XML package description
xulchris aeff3c7
install -d $RPM_BUILD_ROOT%{pear_xmldir}
b9b5805
install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
b9b5805
b9b5805
b9b5805
%check
b9b5805
# For documentation purpose
b9b5805
# After install, run (as root)
b9b5805
# pear run-tests -p File
b9b5805
# Shoud return
b9b5805
# 36 PASSED TESTS
b9b5805
# 0 SKIPPED TESTS
xulchris 875447e
xulchris 875447e
xulchris 875447e
%clean
xulchris 875447e
rm -rf $RPM_BUILD_ROOT
xulchris 875447e
xulchris 875447e
xulchris 875447e
%post
xulchris 875447e
%{__pear} install --nodeps --soft --force --register-only \
b9b5805
    %{pear_xmldir}/%{name}.xml >/dev/null || :
xulchris 875447e
xulchris 875447e
%postun
xulchris 875447e
if [ $1 -eq 0 ] ; then
xulchris 875447e
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
xulchris 875447e
        %{pear_name} >/dev/null || :
xulchris 875447e
fi
xulchris 875447e
xulchris 875447e
xulchris 875447e
%files
xulchris 875447e
%defattr(-,root,root,-)
b9b5805
%{pear_xmldir}/%{name}.xml
xulchris 875447e
%{pear_testdir}/%{pear_name}
xulchris 875447e
%{pear_phpdir}/%{pear_name}*
xulchris 875447e
xulchris 875447e
xulchris 875447e
%changelog
b9b5805
* Sun Aug 15 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.3.0-4
b9b5805
- clean spec
b9b5805
- rename File.xml to php-pear-File.xml
b9b5805
- add %%check for documentation
b9b5805
20835d7
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-3
20835d7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
20835d7
6f94cd0
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.0-2
6f94cd0
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
6f94cd0
xulchris aeff3c7
* Sat Sep 08 2007 Christopher Stone <chris.stone@gmail.com> 1.3.0-1
xulchris aeff3c7
- Upstream sync
xulchris aeff3c7
xulchris 875447e
* Wed Dec 13 2006 Christopher Stone <chris.stone@gmail.com> 1.2.2-1
xulchris 875447e
- Initial Release