summaryrefslogtreecommitdiffstats
path: root/php-pear-XML-RPC.spec
blob: 7f343a199ed32bd1c89ec0844e970fb56ae9e459 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global pear_name XML_RPC

Name:           php-pear-XML-RPC
Version:        1.5.5
Release:        2%{?dist}
Summary:        PHP implementation of the XML-RPC protocol

Group:          Development/Libraries
# PHP License version 3.0.1
# http://pear.php.net/bugs/19368 request for License file.
License:        PHP
URL:            http://pear.php.net/package/XML_RPC
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.9.4-9
BuildRequires:  php-pear(PEAR)

Requires(post): %{__pear}
Requires(postun): %{__pear}
# previous version have XML_RPC bundled
Requires:       php-pear >= 1:1.9.4-9
Requires:       php-pear(PEAR)
# extensions detected by phpci
Requires:       php-date, php-mbstring, php-pcre
# also requires php-xml, which is provided by php-common, not php-xml

Provides:       php-pear(%{pear_name}) = %{version}

%description
A PEAR-ified version of Useful Inc's XML-RPC for PHP.

It has support for HTTP/HTTPS transport, proxies and authentication.


%prep
%setup -q -c
cd %{pear_name}-%{version}
# package.xml is V1, package2.xml is V2
mv ../package2.xml %{name}.xml


%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.


%install
cd %{pear_name}-%{version}
rm -rf %{buildroot}
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml

# Clean up unnecessary files
rm -rf %{buildroot}%{pear_phpdir}/.??*

# Install XML package description
mkdir -p %{buildroot}%{pear_xmldir}
install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}


%clean
rm -rf %{buildroot}


# use posttrans to register after removal of php-pear bundled version
# and of /usr/share/pear/.registry/xml_rpc.reg
%posttrans
%{__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.php.net/%{pear_name} >/dev/null || :
fi


%files
%defattr(-,root,root,-)
%{pear_xmldir}/%{name}.xml
%{pear_phpdir}/XML/RPC
%{pear_phpdir}/XML/RPC.php
# these are not real unit tests, can't be run in rpmbuild
%{pear_testdir}/%{pear_name}


%changelog
* Wed Aug 15 2012 Remi Collet <remi@fedoraproject.org> - 1.5.5-2
- rebuilt for new pear_testdir
- fix typo in comment
- add BR php-pear(PEAR)

* Mon Aug 13 2012 Remi Collet <remi@fedoraproject.org> - 1.5.5-1
- Version 1.5.5 (stable), API 1.5.0 (stable)
- Initial RPM