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