3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname pthreads
7 Summary: A compatible Threading API for PHP5.3+
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Languages/PHP
13 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5: 6a753b418f9dd0953c77d3b90af48b5f
15 URL: http://pecl.php.net/package/pthreads/
16 %{?with_tests:BuildRequires: %{php_name}-cli}
17 BuildRequires: %{php_name}-devel >= 4:5.3.0
18 BuildRequires: %{php_name}(thread-safety) = 1
19 BuildRequires: rpmbuild(macros) >= 1.666
20 %{?requires_php_extension}
21 Provides: php(pthreads) = %{version}
22 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
25 pthreads is an Object Orientated API that allows user-land
26 multi-threading in PHP. It includes all the tools you need to create
27 multi-threaded applications targeted at the Web or the Console. PHP
28 applications can create, read, write, execute and synchronize with
29 Threads, Workers and Threaded objects.
33 mv %{modname}-%{version}/* .
41 # simple module load test
43 -d extension_dir=modules \
44 -d extension=%{modname}.so \
46 grep %{modname} modules.log
48 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
50 PHP_EXECUTABLE=%{__php}
54 rm -rf $RPM_BUILD_ROOT
55 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
56 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
57 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
60 EXTENSION_DIR=%{php_extensiondir} \
61 INSTALL_ROOT=$RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
64 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
65 ; Enable %{modname} extension module
66 extension=%{modname}.so
69 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
70 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
73 rm -rf $RPM_BUILD_ROOT
76 %php_webserver_restart
80 %php_webserver_restart
84 %defattr(644,root,root,755)
85 %doc CREDITS EXPERIMENTAL
86 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
87 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
88 %{_examplesdir}/%{name}-%{version}