%define _class Tree %define modname %{_class} Summary: Generic tree management Name: php-pear-%{modname} Version: 0.3.7 Release: 12 License: PHP License Group: Development/PHP Url: http://pear.php.net/package/Tree/ Source0: http://download.pear.php.net/package/Tree-%{version}.tgz BuildArch: noarch BuildRequires: php-pear Requires(post,preun): php-pear Requires: php-pear %description Provides methods to read and manipulate trees, which are stored in the DB or an XML file. The trees can be stored in the DB either as nested trees or as simple trees ('brain dead method'), which use parentId-like structure. Currently XML data can only be read from a file and accessed. The package offers a big number of methods to access and manipulate trees. For example methods like: getRoot, getChild[ren], getParent, getPath and many more. There are two ways of retrieving the data from the place where they are stored, one is by reading the entire tree into the memory - the Memory way. The other is reading the tree nodes as needed (very useful in combination with huge trees and the nested set model). The package is designed that way that it is possible to convert/copy tree data from either structure to another (from XML into DB). %prep %setup -qc mv package.xml %{modname}-%{version}/%{modname}.xml %install cd %{modname}-%{version} pear install --nodeps --packagingroot %{buildroot} %{modname}.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 %{modname}.xml %{buildroot}%{_datadir}/pear/packages %files %doc %{modname}-%{version}/docs/* %{_datadir}/pear/%{_class} %{_datadir}/pear/packages/%{modname}.xml %{_datadir}//pear/doc/Tree/docs/* %{_datadir}//pear/test/Tree/tests/*