]> git.pld-linux.org Git - packages/php-pecl-msgpack.git/blob - php-pecl-msgpack.spec
5402a31e5090e5b983e44f118bed6379a9640803
[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 %package devel
40 Summary:        MessagePack developer files (header)
41 Group:          Development/Libraries
42 Requires:       %{php_name}-devel
43 # does not require base
44
45 %description devel
46 These are the files needed to compile programs using MessagePack.
47
48 %prep
49 %setup -qc
50 mv %{modname}-%{version}/* .
51 %patch0 -p1
52
53 # https://github.com/msgpack/msgpack-php/issues/110
54 %ifarch %{ix86}
55 rm tests/040*.phpt
56 %endif
57
58 %build
59 phpize
60 %configure
61 %{__make}
62
63 %if %{with tests}
64 # simple module load test
65 %{__php} -n -q \
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 \
71         -m > modules.log
72 grep %{modname} modules.log
73
74 cat <<'EOF' > run-tests.sh
75 #!/bin/sh
76 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
77 exec %{__make} test \
78         PHP_EXECUTABLE=%{__php} \
79         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
80         RUN_TESTS_SETTINGS="-q $*"
81 EOF
82 chmod +x run-tests.sh
83
84 ./run-tests.sh
85 %endif
86
87 %install
88 rm -rf $RPM_BUILD_ROOT
89 %{__make} install \
90         EXTENSION_DIR=%{php_extensiondir} \
91         INSTALL_ROOT=$RPM_BUILD_ROOT
92
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
97 EOF
98
99 %clean
100 rm -rf $RPM_BUILD_ROOT
101
102 %post
103 %php_webserver_restart
104
105 %postun
106 if [ "$1" = 0 ]; then
107         %php_webserver_restart
108 fi
109
110 %files
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
115
116 %files devel
117 %defattr(644,root,root,755)
118 %{_includedir}/php/ext/%{modname}
This page took 0.085833 seconds and 2 git commands to generate.