]> git.pld-linux.org Git - packages/php-pecl-xmlrpc.git/blob - php-pecl-xmlrpc.spec
Update failing test list (investigate later)
[packages/php-pecl-xmlrpc.git] / php-pecl-xmlrpc.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         rel             1
6 %define         commit  1ed83f2
7 %define         php_name        php%{?php_suffix}
8 %define         modname xmlrpc
9 Summary:        xmlrpc extension module for PHP
10 Summary(pl.UTF-8):      Moduł xmlrpc dla PHP
11 Name:           %{php_name}-pecl-%{modname}
12 Version:        1.0.0
13 Release:        0.%{rel}.%{commit}
14 License:        PHP 3.01
15 Group:          Development/Languages/PHP
16 # http://git.php.net/?p=pecl/networking/xmlrpc.git
17 # https://github.com/php/pecl-networking-xmlrpc
18 Source0:        https://github.com/php/pecl-networking-xmlrpc/archive/%{commit}/php-pecl-%{modname}-%{version}-%{commit}.tar.gz
19 # Source0-md5:  db89c3183934c874f4a242e184439d5c
20 URL:            https://www.php.net/manual/en/book.xmlrpc.php
21 %{?with_tests:BuildRequires:    %{php_name}-cli}
22 BuildRequires:  %{php_name}-devel >= 4:8.0.0
23 BuildRequires:  rpmbuild(macros) >= 1.666
24 BuildRequires:  xmlrpc-epi-devel >= 0.54.1
25 %if %{with tests}
26 BuildRequires:  %{php_name}-cli
27 BuildRequires:  %{php_name}-pcre
28 %endif
29 %{?requires_php_extension}
30 Provides:       php(xmlrpc) = %{version}
31 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32
33 %description
34 This is a dynamic shared object (DSO) for PHP that will add XMLRPC
35 support.
36
37 %description -l pl.UTF-8
38 Moduł PHP dodający obsługę XMLRPC.
39
40 %prep
41 %setup -qc
42 mv pecl-networking-%{modname}-*/* .
43
44 %{__sed} -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' config.m4
45
46 cat <<'EOF' > run-tests.sh
47 #!/bin/sh
48 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
49 exec %{__make} test \
50         PHP_EXECUTABLE=%{__php} \
51         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="" \
52         RUN_TESTS_SETTINGS="-q $*"
53 EOF
54 chmod +x run-tests.sh
55
56 xfail() {
57         local t=$1
58         test -f $t
59         cat >> $t <<-EOF
60
61         --XFAIL--
62         Skip
63         EOF
64 }
65
66 while read line; do
67         t=${line##*\[}; t=${t%\]}
68         xfail $t
69 done << 'EOF'
70 xmlrpc_encode() Simple test encode type double and String [tests/005.phpt]
71 Bug #40576 (double values are truncated to 6 decimal digits when encoding) [tests/bug40576_64bit.phpt]
72 Bug #45555 (Segfault with invalid non-string as register_introspection_callback) [tests/bug45555.phpt]
73 Bug #45556 (Return value from callback isn't freed) [tests/bug45556.phpt]
74 Bug #77242 (heap out of bounds read in xmlrpc_decode()) [tests/bug77242.phpt]
75 EOF
76
77 %build
78 export CPPFLAGS="%{rpmcppflags} -I%{_includedir}/xmlrpc-epi"
79
80 phpize
81 %configure \
82         --with-xmlrpc=shared,/usr \
83
84 %{__make}
85
86 # simple module load test
87 %{__php} -n -q \
88         -d extension_dir=modules \
89         -d extension=%{modname}.so \
90         -m > modules.log
91 grep %{modname} modules.log
92
93 %if %{with tests}
94 ./run-tests.sh --show-diff
95 %endif
96
97 %install
98 rm -rf $RPM_BUILD_ROOT
99 %{__make} install \
100         EXTENSION_DIR=%{php_extensiondir} \
101         INSTALL_ROOT=$RPM_BUILD_ROOT
102
103 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
104 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
105 ; Enable %{modname} extension module
106 extension=%{modname}.so
107 EOF
108
109 %clean
110 rm -rf $RPM_BUILD_ROOT
111
112 %post
113 %php_webserver_restart
114
115 %postun
116 if [ "$1" = 0 ]; then
117         %php_webserver_restart
118 fi
119
120 %files
121 %defattr(644,root,root,755)
122 %doc CREDITS LICENSE
123 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
124 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.072976 seconds and 3 git commands to generate.