]>
Commit | Line | Data |
---|---|---|
69095720 ER |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without tests # build without tests | |
4 | ||
481269c1 | 5 | %define rel 2 |
69095720 ER |
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 | |
7eed6baf | 24 | BuildRequires: xmlrpc-epi-devel >= 0.54.1 |
69095720 ER |
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 | ||
7eed6baf ER |
44 | %{__sed} -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' config.m4 |
45 | ||
516fbba7 ER |
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] | |
0c3dc19a ER |
75 | %ifarch %{ix86} |
76 | Bug #40576 (double values are truncated to 6 decimal digits when encoding) [tests/bug40576.phpt] | |
77 | %endif | |
516fbba7 ER |
78 | EOF |
79 | ||
69095720 | 80 | %build |
7eed6baf ER |
81 | export CPPFLAGS="%{rpmcppflags} -I%{_includedir}/xmlrpc-epi" |
82 | ||
69095720 ER |
83 | phpize |
84 | %configure \ | |
7eed6baf | 85 | --with-xmlrpc=shared,/usr \ |
69095720 ER |
86 | |
87 | %{__make} | |
88 | ||
89 | # simple module load test | |
90 | %{__php} -n -q \ | |
91 | -d extension_dir=modules \ | |
92 | -d extension=%{modname}.so \ | |
93 | -m > modules.log | |
94 | grep %{modname} modules.log | |
95 | ||
96 | %if %{with tests} | |
516fbba7 | 97 | ./run-tests.sh --show-diff |
69095720 ER |
98 | %endif |
99 | ||
100 | %install | |
101 | rm -rf $RPM_BUILD_ROOT | |
102 | %{__make} install \ | |
103 | EXTENSION_DIR=%{php_extensiondir} \ | |
104 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
105 | ||
106 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
107 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini | |
108 | ; Enable %{modname} extension module | |
109 | extension=%{modname}.so | |
110 | EOF | |
111 | ||
112 | %clean | |
113 | rm -rf $RPM_BUILD_ROOT | |
114 | ||
115 | %post | |
116 | %php_webserver_restart | |
117 | ||
118 | %postun | |
119 | if [ "$1" = 0 ]; then | |
120 | %php_webserver_restart | |
121 | fi | |
122 | ||
123 | %files | |
124 | %defattr(644,root,root,755) | |
125 | %doc CREDITS LICENSE | |
126 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
127 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |