3 %bcond_without tests # build without tests
5 %define php_name php%{?php_suffix}
6 %define modname msgpack
7 Summary: PHP extension for interfacing with MessagePack
8 Name: %{php_name}-pecl-%{modname}
9 # For PHP < 7, see 0.5.x branch
13 Group: Development/Languages/PHP
14 Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
15 # Source0-md5: 4d1db4592ffa4101601aefc794191de5
17 URL: http://pecl.php.net/package/msgpack/
18 BuildRequires: %{php_name}-devel >= 4:7.0.0
19 BuildRequires: rpmbuild(macros) >= 1.666
21 BuildRequires: %{php_name}-cli
22 BuildRequires: %{php_name}-pcre
23 BuildRequires: %{php_name}-session
24 BuildRequires: %{php_name}-spl
26 %{?requires_php_extension}
27 Requires: %{php_name}-session
28 Provides: php(msgpack) = %{version}
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 This extension provide API for communicating with MessagePack
35 MessagePack is a binary-based efficient object serialization library.
36 It enables to exchange structured objects between many languages like
37 JSON. But unlike JSON, it is very fast and small.
40 Summary: MessagePack developer files (header)
41 Group: Development/Libraries
42 Requires: %{php_name}-devel
43 # does not require base
46 These are the files needed to compile programs using MessagePack.
50 mv %{modname}-%{version}/* .
53 # https://github.com/msgpack/msgpack-php/issues/110
64 # simple module load test
66 -d extension_dir=modules \
67 -d extension=%{php_extensiondir}/pcre.so \
68 -d extension=%{php_extensiondir}/spl.so \
69 -d extension=%{php_extensiondir}/session.so \
70 -d extension=%{modname}.so \
72 grep %{modname} modules.log
74 cat <<'EOF' > run-tests.sh
76 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
78 PHP_EXECUTABLE=%{__php} \
79 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
80 RUN_TESTS_SETTINGS="-q $*"
88 rm -rf $RPM_BUILD_ROOT
90 EXTENSION_DIR=%{php_extensiondir} \
91 INSTALL_ROOT=$RPM_BUILD_ROOT
93 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
94 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
95 ; Enable %{modname} extension module
96 extension=%{modname}.so
100 rm -rf $RPM_BUILD_ROOT
103 %php_webserver_restart
106 if [ "$1" = 0 ]; then
107 %php_webserver_restart
111 %defattr(644,root,root,755)
112 %doc CREDITS EXPERIMENTAL
113 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
114 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
117 %defattr(644,root,root,755)
118 %{_includedir}/php/ext/%{modname}