]> git.pld-linux.org Git - packages/php-pecl-msgpack.git/blame - php-pecl-msgpack.spec
drop tests/040*.phpt
[packages/php-pecl-msgpack.git] / php-pecl-msgpack.spec
CommitLineData
1637b078
ER
1#
2# Conditional build:
3%bcond_without tests # build without tests
4
5%define php_name php%{?php_suffix}
6%define modname msgpack
7Summary: PHP extension for interfacing with MessagePack
8Name: %{php_name}-pecl-%{modname}
901929e2 9# For PHP < 7, see 0.5.x branch
89bb337c 10Version: 2.0.1
1637b078
ER
11Release: 1
12License: PHP 3.01
13Group: Development/Languages/PHP
14Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz
89bb337c 15# Source0-md5: 4d1db4592ffa4101601aefc794191de5
8ba04bf5 16Patch0: test041.patch
1637b078 17URL: http://pecl.php.net/package/msgpack/
901929e2 18BuildRequires: %{php_name}-devel >= 4:7.0.0
1637b078
ER
19BuildRequires: rpmbuild(macros) >= 1.666
20%if %{with tests}
21BuildRequires: %{php_name}-cli
658f8502 22BuildRequires: %{php_name}-pcre
1637b078
ER
23BuildRequires: %{php_name}-session
24BuildRequires: %{php_name}-spl
25%endif
26%{?requires_php_extension}
27Requires: %{php_name}-session
28Provides: php(msgpack) = %{version}
29BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31%description
32This extension provide API for communicating with MessagePack
33serialization.
34
35MessagePack is a binary-based efficient object serialization library.
36It enables to exchange structured objects between many languages like
37JSON. But unlike JSON, it is very fast and small.
38
39%prep
40%setup -qc
41mv %{modname}-%{version}/* .
8ba04bf5 42%patch0 -p1
1637b078 43
69958554
ER
44# https://github.com/msgpack/msgpack-php/issues/110
45%ifarch %{ix86}
46rm tests/040*.phpt
47%endif
48
1637b078
ER
49%build
50phpize
51%configure
52%{__make}
53
54%if %{with tests}
55# simple module load test
56%{__php} -n -q \
57 -d extension_dir=modules \
658f8502 58 -d extension=%{php_extensiondir}/pcre.so \
1637b078
ER
59 -d extension=%{php_extensiondir}/spl.so \
60 -d extension=%{php_extensiondir}/session.so \
61 -d extension=%{modname}.so \
62 -m > modules.log
63grep %{modname} modules.log
64
0a9c573e
ER
65cat <<'EOF' > run-tests.sh
66#!/bin/sh
1637b078 67export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
0a9c573e 68exec %{__make} test \
1637b078 69 PHP_EXECUTABLE=%{__php} \
0a9c573e
ER
70 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
71 RUN_TESTS_SETTINGS="-q $*"
72EOF
73chmod +x run-tests.sh
74
75./run-tests.sh
1637b078
ER
76%endif
77
78%install
79rm -rf $RPM_BUILD_ROOT
80%{__make} install \
81 EXTENSION_DIR=%{php_extensiondir} \
82 INSTALL_ROOT=$RPM_BUILD_ROOT
83
84install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
85cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
86; Enable %{modname} extension module
87extension=%{modname}.so
88EOF
89
90# no -devel package yet
91%{__rm} $RPM_BUILD_ROOT%{_includedir}/php/ext/msgpack/php_msgpack.h
92
93%clean
94rm -rf $RPM_BUILD_ROOT
95
96%post
97%php_webserver_restart
98
99%postun
100if [ "$1" = 0 ]; then
101 %php_webserver_restart
102fi
103
104%files
105%defattr(644,root,root,755)
106%doc CREDITS EXPERIMENTAL
107%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
108%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.084259 seconds and 4 git commands to generate.