Search
j0ke.net Open Build Service
>
Projects
>
server:php:applications
>
php5-pear-xml_serializer
> Changes
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
Changes of Revision 3
[-]
[+]
Added
php5-pear-xml_serializer.spec
@@ -0,0 +1,107 @@ +# +# spec file for package php5-pearl-xml_serializer +# +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# + + +# norootforbuild + + +Name: php5-pear-xml_serializer +Version: 0.18.0 +Release: 0 +Summary: Swiss-army knife for reading and writing XML files. Creates XML files from data structures and vice versa +License: PHP License +Group: Development/Libraries/PHP +Url: http://pear.php.net/package/XML_Serializer +Source0: http://download.pear.php.net/package/XML_Serializer-%version.tgz +BuildArch: noarch +PreReq: php5-pear +BuildRequires: php5-pear +BuildRoot: %{_tmppath}/%{name}-%{version}-build +%define peardir %(pear config-get php_dir 2> /dev/null) +%define xmldir %{_var}/lib/pear + +%description +XML_Serializer serializes complex data structures like arrays or object as XML +documents. + +This class helps you generating any XML document you require without the need +for DOM. + +Furthermore this package can be used as a replacement to serialize() and +unserialize() as it comes with a matching XML_Unserializer that is able to +create PHP data structures (like arrays and objects) from XML documents, if +type hints are available. + +If you use the XML_Unserializer on standard XML files, it will try to guess +how it has to be unserialized. In most cases it does exactly what you expect +it to do. Try reading a RSS file with XML_Unserializer and you have the whole +RSS file in a structured array or even a collection of objects, +similar to XML_RSS. + +Since version 0.8.0 the package is able to treat XML documents similar to the +simplexml extension of PHP 5. + +Author: +------- + Stephan Schmidt + + +%prep +%setup -c -T +pear -v -c pearrc \ + -d php_dir=%{peardir} \ + -d doc_dir=%_defaultdocdir/%name \ + -d bin_dir=%{_bindir} \ + -d data_dir=%{peardir}/data \ + -d test_dir=%{peardir}/tests \ + -d ext_dir=%{_libdir} \ + -s + +%build + + +%install +pear -c pearrc install --offline --nodeps --packagingroot %buildroot %{SOURCE0} +%__rm -rf %buildroot/%peardir/.{filemap,lock,registry,channels,depdb,depdblock} + +# Install XML package description +%__mkdir_p %buildroot%{xmldir} +%__tar -xzf %{SOURCE0} package.xml +%__cp package.xml %buildroot%xmldir/XML_Serializer.xml + +# fix todo: move it to defaultdocdir +mkdir -p %buildroot%_defaultdocdir/%name +mv %buildroot%peardir/data/XML_Serializer/doc/todo.txt %buildroot%_defaultdocdir/%name/ +rm -rf %buildroot%peardir/data +# fix defaultdocdir +mv %buildroot%_defaultdocdir/%name/XML_Serializer/* %buildroot%_defaultdocdir/%name/ +rm -rf %buildroot%_defaultdocdir/%name/XML_Serializer + +%clean +%__rm -rf %{buildroot} + + +%post +pear install --nodeps --soft --force --register-only %{xmldir}/XML_Serializer.xml + + +%postun +if [ "$1" -eq "0" ]; then + pear uninstall --nodeps --ignore-errors --register-only pear.php.net/XML_Serializer +fi + + +%files +%defattr(-, root, root) +%doc %_defaultdocdir/%name +%dir %peardir/XML +%peardir/XML/Serializer.php +%peardir/XML/Unserializer.php +%xmldir/XML_Serializer.xml + + +%changelog