]> git.pld-linux.org Git - packages/php-pecl-zmq.git/blob - php-pecl-zmq.spec
new, version 1.1.2
[packages/php-pecl-zmq.git] / php-pecl-zmq.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
5 %define         php_name        php%{?php_suffix}
6 %define         modname zmq
7 Summary:        %{modname} - ZeroMQ messaging
8 Name:           %{php_name}-pecl-%{modname}
9 Version:        1.1.2
10 Release:        1
11 License:        BSD
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 %{?with_tests:BuildRequires:    %{php_name}-cli}
17 BuildRequires:  %{php_name}-devel
18 BuildRequires:  rpmbuild(macros) >= 1.666
19 BuildRequires:  zeromq-devel
20 %{?requires_php_extension}
21 Provides:       php(zmq) = %{version}
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 ZeroMQ is a software library that lets you quickly design and
26 implement a fast message-based applications.
27
28 %prep
29 %setup -qc
30 mv %{modname}-%{version}/* .
31
32 # fix new default of MAX_SOCKETS
33 # Using current version, so this can be checked in next version and removed
34 # if appropriate. (still not fixed in 1.1.2, maybe later)
35 sed -i "s/int(1024)/int(1023)/g" tests/032-contextopt.phpt
36
37 %build
38 phpize
39 %configure \
40         --with-zmq \
41         --with-php-config=%{_bindir}/php-config
42 %{__make}
43
44 %if %{with tests}
45 # simple module load test
46 %{__php} -n -q \
47         -d extension_dir=modules \
48         -d extension=%{modname}.so \
49         -m > modules.log
50 grep %{modname} modules.log
51
52 # run upstream test suite
53 %{__make} test \
54         PHP_EXECUTABLE=%{__php}
55 %endif
56
57 %install
58 rm -rf $RPM_BUILD_ROOT
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 %clean
70 rm -rf $RPM_BUILD_ROOT
71
72 %post
73 %php_webserver_restart
74
75 %postun
76 if [ "$1" = 0 ]; then
77         %php_webserver_restart
78 fi
79
80 %files
81 %defattr(644,root,root,755)
82 %doc README.md LICENSE
83 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
84 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.05514 seconds and 4 git commands to generate.