2 # - bundles msgpack headers to 3.2.0
5 %bcond_without tests # build without tests
7 %define php_name php%{?php_suffix}
8 %define modname msgpack
9 Summary: PHP extension for interfacing with MessagePack
10 Name: %{php_name}-pecl-%{modname}
11 # For PHP < 7, see 0.5.x branch
15 Group: Development/Languages/PHP
16 Source0: https://pecl.php.net/get/%{modname}-%{version}.tgz
17 # Source0-md5: 901960fda542dec313ab4d89bd63d06d
18 URL: https://pecl.php.net/package/msgpack/
19 BuildRequires: %{php_name}-devel >= 4:7.0.0
20 BuildRequires: rpmbuild(macros) >= 1.666
22 BuildRequires: %{php_name}-cli
23 BuildRequires: %{php_name}-pcre
24 BuildRequires: %{php_name}-session
25 BuildRequires: %{php_name}-spl
27 %{?requires_php_extension}
28 Requires: %{php_name}-session
29 Provides: php(msgpack) = %{version}
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
33 This extension provide API for communicating with MessagePack
36 MessagePack is a binary-based efficient object serialization library.
37 It enables to exchange structured objects between many languages like
38 JSON. But unlike JSON, it is very fast and small.
41 Summary: MessagePack developer files (header)
42 Group: Development/Libraries
43 Requires: %{php_name}-devel
44 # does not require base
47 These are the files needed to compile programs using MessagePack.
51 mv %{modname}-%{version}/* .
53 # https://github.com/msgpack/msgpack-php/issues/110
62 # simple module load test
64 -d extension_dir=modules \
65 -d extension=%{php_extensiondir}/pcre.so \
66 -d extension=%{php_extensiondir}/spl.so \
67 -d extension=%{php_extensiondir}/session.so \
68 -d extension=%{modname}.so \
70 grep %{modname} modules.log
72 cat <<'EOF' > run-tests.sh
74 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
76 PHP_EXECUTABLE=%{__php} \
77 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
78 RUN_TESTS_SETTINGS="-q $*"
86 rm -rf $RPM_BUILD_ROOT
88 EXTENSION_DIR=%{php_extensiondir} \
89 INSTALL_ROOT=$RPM_BUILD_ROOT
91 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
92 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
93 ; Enable %{modname} extension module
94 extension=%{modname}.so
98 rm -rf $RPM_BUILD_ROOT
101 %php_webserver_restart
104 if [ "$1" = 0 ]; then
105 %php_webserver_restart
109 %defattr(644,root,root,755)
110 %doc CREDITS EXPERIMENTAL
111 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
112 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
115 %defattr(644,root,root,755)
116 %{_includedir}/php/ext/%{modname}