]> git.pld-linux.org Git - packages/php-pecl-msgpack.git/blob - php-pecl-msgpack.spec
drop tests/040*.phpt
[packages/php-pecl-msgpack.git] / php-pecl-msgpack.spec
1 #
2 # Conditional build:
3 %bcond_without  tests           # build without tests
4
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
10 Version:        2.0.1
11 Release:        1
12 License:        PHP 3.01
13 Group:          Development/Languages/PHP
14 Source0:        http://pecl.php.net/get/%{modname}-%{version}.tgz
15 # Source0-md5:  4d1db4592ffa4101601aefc794191de5
16 Patch0:         test041.patch
17 URL:            http://pecl.php.net/package/msgpack/
18 BuildRequires:  %{php_name}-devel >= 4:7.0.0
19 BuildRequires:  rpmbuild(macros) >= 1.666
20 %if %{with tests}
21 BuildRequires:  %{php_name}-cli
22 BuildRequires:  %{php_name}-pcre
23 BuildRequires:  %{php_name}-session
24 BuildRequires:  %{php_name}-spl
25 %endif
26 %{?requires_php_extension}
27 Requires:       %{php_name}-session
28 Provides:       php(msgpack) = %{version}
29 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30
31 %description
32 This extension provide API for communicating with MessagePack
33 serialization.
34
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.
38
39 %prep
40 %setup -qc
41 mv %{modname}-%{version}/* .
42 %patch0 -p1
43
44 # https://github.com/msgpack/msgpack-php/issues/110
45 %ifarch %{ix86}
46 rm tests/040*.phpt
47 %endif
48
49 %build
50 phpize
51 %configure
52 %{__make}
53
54 %if %{with tests}
55 # simple module load test
56 %{__php} -n -q \
57         -d extension_dir=modules \
58         -d extension=%{php_extensiondir}/pcre.so \
59         -d extension=%{php_extensiondir}/spl.so \
60         -d extension=%{php_extensiondir}/session.so \
61         -d extension=%{modname}.so \
62         -m > modules.log
63 grep %{modname} modules.log
64
65 cat <<'EOF' > run-tests.sh
66 #!/bin/sh
67 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
68 exec %{__make} test \
69         PHP_EXECUTABLE=%{__php} \
70         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
71         RUN_TESTS_SETTINGS="-q $*"
72 EOF
73 chmod +x run-tests.sh
74
75 ./run-tests.sh
76 %endif
77
78 %install
79 rm -rf $RPM_BUILD_ROOT
80 %{__make} install \
81         EXTENSION_DIR=%{php_extensiondir} \
82         INSTALL_ROOT=$RPM_BUILD_ROOT
83
84 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
85 cat <<'EOF' > $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d/%{modname}.ini
86 ; Enable %{modname} extension module
87 extension=%{modname}.so
88 EOF
89
90 # no -devel package yet
91 %{__rm} $RPM_BUILD_ROOT%{_includedir}/php/ext/msgpack/php_msgpack.h
92
93 %clean
94 rm -rf $RPM_BUILD_ROOT
95
96 %post
97 %php_webserver_restart
98
99 %postun
100 if [ "$1" = 0 ]; then
101         %php_webserver_restart
102 fi
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.034784 seconds and 3 git commands to generate.