]> git.pld-linux.org Git - packages/php-pecl-ev.git/blob - php-pecl-ev.spec
new, version 1.0.4
[packages/php-pecl-ev.git] / php-pecl-ev.spec
1 # TODO
2 # - undo libev embedding (use system libev)
3
4 # Conditional build:
5 %bcond_without  tests           # build without tests
6
7 %define         php_name        php%{?php_suffix}
8 %define         modname ev
9 Summary:        Provides interface to libev library
10 Name:           %{php_name}-pecl-%{modname}
11 Version:        1.0.4
12 Release:        0.1
13 License:        PHP 3.01
14 Group:          Development/Languages/PHP
15 Source0:        https://pecl.php.net/get/%{modname}-%{version}.tgz
16 # Source0-md5:  6670ad30d98a9b5a1bd5410285099689
17 URL:            https://pecl.php.net/package/ev/
18 %{?with_tests:BuildRequires:    %{php_name}-cli}
19 BuildRequires:  %{php_name}-devel
20 BuildRequires:  rpmbuild(macros) >= 1.666
21 %if %{with tests}
22 BuildRequires:  %{php_name}-cli
23 %endif
24 %{?requires_php_extension}
25 Provides:       php(%{modname}) = %{version}
26 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
27
28 %description
29 ev provides interface to libev library - high performance
30 full-featured event loop written in C.
31
32 %prep
33 %setup -qc
34 mv %{modname}-%{version}/* .
35
36 %build
37 phpize
38 %configure
39 %{__make}
40
41 %if %{with tests}
42 # simple module load test
43 %{__php} -n -q \
44         -d extension_dir=modules \
45         -d extension=%{modname}.so \
46         -m > modules.log
47 grep %{modname} modules.log
48
49 cat <<'EOF' > run-tests.sh
50 #!/bin/sh
51 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
52 exec %{__make} test \
53         PHP_EXECUTABLE=%{__php} \
54         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="" \
55         RUN_TESTS_SETTINGS="-q $*"
56 EOF
57 chmod +x run-tests.sh
58
59 ./run-tests.sh
60 %endif
61
62 %install
63 rm -rf $RPM_BUILD_ROOT
64 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
65 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir}}
66 install -d $RPM_BUILD_ROOT{%{php_sysconfdir}/conf.d,%{php_extensiondir},%{_examplesdir}/%{name}-%{version}}
67
68 %{__make} install \
69         EXTENSION_DIR=%{php_extensiondir} \
70         INSTALL_ROOT=$RPM_BUILD_ROOT
71
72 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
73 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
74 ; Enable %{modname} extension module
75 extension=%{modname}.so
76 EOF
77
78 %clean
79 rm -rf $RPM_BUILD_ROOT
80
81 %post
82 %php_webserver_restart
83
84 %postun
85 if [ "$1" = 0 ]; then
86         %php_webserver_restart
87 fi
88
89 %files
90 %defattr(644,root,root,755)
91 %doc README.md TODO.md LICENSE CREDITS
92 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
93 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.056455 seconds and 3 git commands to generate.