]> git.pld-linux.org Git - SPECS.git/blob - php-pecl-pthreads.spec
SPECS updated Wed 28 Jul 14:48:01 CEST 2021
[SPECS.git] / php-pecl-pthreads.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
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}
9 Version:        2.0.10
10 Release:        0.1
11 License:        PHP 3.01
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)
23
24 %description
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.
30
31 %prep
32 %setup -qc
33 mv %{modname}-%{version}/* .
34
35 %build
36 phpize
37 %configure
38 %{__make}
39
40 %if %{with tests}
41 # simple module load test
42 %{__php} -n -q \
43         -d extension_dir=modules \
44         -d extension=%{modname}.so \
45         -m > modules.log
46 grep %{modname} modules.log
47
48 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
49 %{__make} test \
50         PHP_EXECUTABLE=%{__php}
51 %endif
52
53 %install
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}}
58
59 %{__make} install \
60         EXTENSION_DIR=%{php_extensiondir} \
61         INSTALL_ROOT=$RPM_BUILD_ROOT
62
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
67 EOF
68
69 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
70 cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
71
72 %clean
73 rm -rf $RPM_BUILD_ROOT
74
75 %post
76 %php_webserver_restart
77
78 %postun
79 if [ "$1" = 0 ]; then
80         %php_webserver_restart
81 fi
82
83 %files
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}
This page took 0.167467 seconds and 3 git commands to generate.