1 |
%define peardir %(pear config-get php_dir 2> /dev/null || echo %{_datadir}/pear) |
2 |
%define xmldir /var/lib/pear |
3 |
%global pear_name XML_Parser2 |
4 |
|
5 |
Summary: XML parsing class based on PHP's bundled expat |
6 |
Name: php-pear-XML-Parser2 |
7 |
Version: 0.1.0 |
8 |
Release: 2%{?dist} |
9 |
License: BSD License |
10 |
Group: Development/Libraries |
11 |
Source0: http://pear.php.net/get/XML_Parser2-%{version}.tgz |
12 |
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) |
13 |
URL: http://pear.php.net/package/XML_Parser2 |
14 |
|
15 |
BuildRequires: php-pear(PEAR) >= 1.4.7 |
16 |
Requires: php-pear(PEAR) >= 1.4.0b1 |
17 |
Provides: php-pear(%{pear_name}) = %{version} |
18 |
|
19 |
#BuildRequires: PEAR::PEAR >= 1.4.7 |
20 |
#Requires: PEAR::PEAR |
21 |
#Requires: PEAR::PEAR >= 1.4.0b1 |
22 |
|
23 |
BuildArch: noarch |
24 |
|
25 |
%description |
26 |
This is an XML parser based on PHPs built-in xml extension. |
27 |
It supports two basic modes of operation: "func" and "event". In "func" |
28 |
mode, it will look for a function named after each element (xmltag_ELEMENT |
29 |
for start tags and xmltag_ELEMENT_ for end tags), and in "event" mode it |
30 |
uses a set of generic callbacks. |
31 |
|
32 |
Since version 1.2.0 there's a new XML_Parser_Simple class that makes |
33 |
parsing of most XML documents easier, by automatically providing a stack |
34 |
for the elements. |
35 |
Furthermore its now possible to split the parser from the handler object, |
36 |
so you do not have to extend XML_Parser anymore in order to parse a |
37 |
document with it. |
38 |
|
39 |
%prep |
40 |
%setup -c -T |
41 |
pear -v -c pearrc \ |
42 |
-d php_dir=%{peardir} \ |
43 |
-d doc_dir=/docs \ |
44 |
-d bin_dir=%{_bindir} \ |
45 |
-d data_dir=%{peardir}/data \ |
46 |
-d test_dir=%{peardir}/tests \ |
47 |
-d ext_dir=%{_libdir} \ |
48 |
-s |
49 |
|
50 |
%build |
51 |
|
52 |
%install |
53 |
rm -rf %{buildroot} |
54 |
pear -c pearrc install --nodeps --packagingroot %{buildroot} %{SOURCE0} |
55 |
|
56 |
# Clean up unnecessary files |
57 |
rm pearrc |
58 |
rm %{buildroot}/%{peardir}/.filemap |
59 |
rm %{buildroot}/%{peardir}/.lock |
60 |
rm -rf %{buildroot}/%{peardir}/.registry |
61 |
rm -rf %{buildroot}%{peardir}/.channels |
62 |
rm %{buildroot}%{peardir}/.depdb |
63 |
rm %{buildroot}%{peardir}/.depdblock |
64 |
|
65 |
mv %{buildroot}/docs . |
66 |
|
67 |
|
68 |
# Install XML package description |
69 |
mkdir -p %{buildroot}%{xmldir} |
70 |
tar -xzf %{SOURCE0} package.xml |
71 |
cp -p package.xml %{buildroot}%{xmldir}/XML_Parser2.xml |
72 |
|
73 |
%clean |
74 |
rm -rf %{buildroot} |
75 |
|
76 |
%post |
77 |
pear install --nodeps --soft --force --register-only %{xmldir}/XML_Parser2.xml >/dev/null || : |
78 |
|
79 |
%postun |
80 |
if [ "$1" -eq "0" ]; then |
81 |
pear uninstall --nodeps --ignore-errors --register-only pear.php.net/XML_Parser2 >/dev/null || : |
82 |
fi |
83 |
|
84 |
%files |
85 |
%defattr(-,root,root) |
86 |
%doc docs/XML_Parser2/* |
87 |
%{peardir}/* |
88 |
%{xmldir}/XML_Parser2.xml |
89 |
|
90 |
%changelog |
91 |
* Mon May 6 2013 John H. Bennett III <bennettj@johnbennettservices.com> - 0.1.0-2 |
92 |
- updated spec file requires section, and left original info remarked. |
93 |
|
94 |
* Sun May 5 2013 John H. Bennett III <bennettj@johnbennettservices.com> - 0.1.0-1 |
95 |
- Original from pear-make-rpm-spec. |
96 |
|