]>
Commit | Line | Data |
---|---|---|
69095720 ER |
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 | %if %{with tests} | |
25 | BuildRequires: %{php_name}-cli | |
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 | ||
43 | %build | |
44 | phpize | |
45 | %configure \ | |
46 | --with-zlib-dir=shared,/usr \ | |
47 | ||
48 | %{__make} | |
49 | ||
50 | # simple module load test | |
51 | %{__php} -n -q \ | |
52 | -d extension_dir=modules \ | |
53 | -d extension=%{modname}.so \ | |
54 | -m > modules.log | |
55 | grep %{modname} modules.log | |
56 | ||
57 | %if %{with tests} | |
58 | export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2 | |
59 | %{__make} test \ | |
60 | PHP_EXECUTABLE=%{__php} \ | |
61 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="" \ | |
62 | %endif | |
63 | ||
64 | %install | |
65 | rm -rf $RPM_BUILD_ROOT | |
66 | %{__make} install \ | |
67 | EXTENSION_DIR=%{php_extensiondir} \ | |
68 | INSTALL_ROOT=$RPM_BUILD_ROOT | |
69 | ||
70 | install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d | |
71 | cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini | |
72 | ; Enable %{modname} extension module | |
73 | extension=%{modname}.so | |
74 | EOF | |
75 | ||
76 | %clean | |
77 | rm -rf $RPM_BUILD_ROOT | |
78 | ||
79 | %post | |
80 | %php_webserver_restart | |
81 | ||
82 | %postun | |
83 | if [ "$1" = 0 ]; then | |
84 | %php_webserver_restart | |
85 | fi | |
86 | ||
87 | %files | |
88 | %defattr(644,root,root,755) | |
89 | %doc CREDITS LICENSE | |
90 | %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini | |
91 | %attr(755,root,root) %{php_extensiondir}/%{modname}.so |