3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
7 Summary: %{modname} - ZeroMQ messaging
8 Name: %{php_name}-pecl-%{modname}
12 Group: Development/Languages/PHP
13 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
14 # Source0-md5: 74da2fc1aa83e6fa27acffb9a37596b9
15 URL: http://pecl.php.net/package/zmq/
16 BuildRequires: %{php_name}-devel
17 BuildRequires: pkgconfig
18 BuildRequires: rpmbuild(macros) >= 1.666
19 BuildRequires: zeromq-devel
21 BuildRequires: %{php_name}-cli
22 BuildRequires: %{php_name}-pcre
24 %{?requires_php_extension}
25 Provides: php(zmq) = %{version}
26 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29 ZeroMQ is a software library that lets you quickly design and
30 implement a fast message-based applications.
34 mv %{modname}-%{version}/* .
36 # fix new default of MAX_SOCKETS
37 # Using current version, so this can be checked in next version and removed
38 # if appropriate. (still not fixed in 1.1.2, maybe later)
39 sed -i "s/int(1024)/int(1023)/g" tests/032-contextopt.phpt
45 --with-php-config=%{_bindir}/php-config
49 # simple module load test
51 -d extension_dir=modules \
52 -d extension=%{modname}.so \
54 grep %{modname} modules.log
56 # run upstream test suite
58 PHP_EXECUTABLE=%{__php}
62 rm -rf $RPM_BUILD_ROOT
64 EXTENSION_DIR=%{php_extensiondir} \
65 INSTALL_ROOT=$RPM_BUILD_ROOT
67 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
68 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
69 ; Enable %{modname} extension module
70 extension=%{modname}.so
74 rm -rf $RPM_BUILD_ROOT
77 %php_webserver_restart
81 %php_webserver_restart
85 %defattr(644,root,root,755)
86 %doc README.md LICENSE
87 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
88 %attr(755,root,root) %{php_extensiondir}/%{modname}.so