Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-backports-src > by-pkgid > 86958a75b28c0bb0a18d7faccf0c97ea > files > 2

php-pear-Services_JSON-1.0.2-1mdv2010.1.src.rpm

%define		_class		Services
%define		_subclass	JSON
%define		upstream_name	%{_class}_%{_subclass}

Name:		php-pear-%{upstream_name}
Version:	1.0.2
Release:	%mkrel 1
Summary:	PHP implementaion of json_encode/decode
License:	PHP License
Group:		Development/PHP
URL:		http://pear.php.net/package/%{upstream_name}
Source0:	http://download.pear.php.net/package/%{upstream_name}-%{version}.tgz
Requires(post): php-pear
Requires(preun): php-pear
Requires:	php-pear
BuildRequires:	php-pear
BuildArch:	noarch
BuildRoot:	%{_tmppath}/%{name}-%{version}

%description
This package provides a simple encoder and decoder for JSON notation. It is
intended for use with client-side Javascript applications that make use of
HTTPRequest to perform server communication functions - data can be encoded
into JSON notation for use in a client-side javascript, or decoded from
incoming Javascript requests. JSON format is native to Javascript, and can be
directly eval()'ed with no further parsing overhead.

%prep
%setup -q -c
mv package.xml %{upstream_name}-%{version}/%{upstream_name}.xml

%install
rm -rf %{buildroot}

cd %{upstream_name}-%{version}
pear install --nodeps --packagingroot %{buildroot} %{upstream_name}.xml
rm -rf %{buildroot}%{_datadir}/pear/.??*

rm -rf %{buildroot}%{_datadir}/pear/docs
rm -rf %{buildroot}%{_datadir}/pear/tests

install -d %{buildroot}%{_datadir}/pear/packages
install -m 644 %{upstream_name}.xml %{buildroot}%{_datadir}/pear/packages

%clean
rm -rf %{buildroot}

%post
pear install --nodeps --soft --force --register-only \
    %{_datadir}/pear/packages/%{upstream_name}.xml >/dev/null || :

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

%files
%defattr(-,root,root)
%{_datadir}/pear/%{_class}
%{_datadir}/pear/packages/%{upstream_name}.xml



%changelog
* Wed Oct 27 2010 Guillaume Rousse <guillomovitch@mandriva.org> 1.0.2-1mdv2011.0
+ Revision: 589589
- import php-pear-Services_JSON