Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > b4b56540e28a2504d322ad9989598fe5 > files > 2

php-pear-Validate-0.8.3-1.fc13.src.rpm

%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global pear_name Validate

Name:           php-pear-Validate
Version:        0.8.3
Release:        1%{?dist}
Summary:        Validation Class for Various Data Types

Group:          Development/Libraries
License:        BSD
URL:            http://pear.php.net/package/Validate
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:       php-pear(Date)
# Not yet available Requires: php-pear(Net_IDNA)
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:       php-pear(%{pear_name}) = %{version}

%description
Package to validate various data. It includes :
- numbers (min/max, decimal or not)
- email (syntax, domain check, rfc822)
- string (predefined type alpha upper and/or lowercase, numeric,...)
- date (min, max)
- uri (RFC2396)
- possibility valid multiple data with a single method call (::multiple)


%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

# Move documentation
mkdir -p docdir
mv $RPM_BUILD_ROOT%{pear_docdir}/* docdir

# 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}


%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,-)
%doc %{pear_name}-%{version}/docdir/%{pear_name}/*
%{pear_xmldir}/%{name}.xml
%{pear_testdir}/%{pear_name}
%{pear_phpdir}/Validate.php


%changelog
* Mon Aug 23 2010 Remi Collet <Fedora@FamilleCollet.com> - 0.8.3-1
- update to 0.8.3
- clean define
- rename Validate.xml to php-pear-Validate.xml
- set date.timezone during build

* Mon Sep 14 2009 Christopher Stone <chris.stone@gmail.com> 0.8.2-1
- Upstream sync

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

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

* Wed Feb 20 2008 Christopher Stone <chris.stone@gmail.com> 0.8.1-1
- Upstream sync

* Sun Jan 14 2007 Christopher Stone <chris.stone@gmail.com> 0.7.0-1
- Upstream sync

* Wed Sep 06 2006 Christopher Stone <chris.stone@gmail.com> 0.6.4-1
- Upstream sync

* Fri Jun 30 2006 Christopher Stone <chris.stone@gmail.com> 0.6.3-1
- Initial Release