]> git.pld-linux.org Git - SPECS.git/blob - php-pecl-msgpack.spec
SPECS updated Sun 1 Aug 20:28:02 CEST 2021
[SPECS.git] / php-pecl-msgpack.spec
1 # TODO
2 #  - bundles msgpack headers to 3.2.0
3 #
4 # Conditional build:
5 %bcond_without  tests           # build without tests
6
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
12 Version:        2.1.0
13 Release:        1
14 License:        PHP 3.01
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
21 %if %{with tests}
22 BuildRequires:  %{php_name}-cli
23 BuildRequires:  %{php_name}-pcre
24 BuildRequires:  %{php_name}-session
25 BuildRequires:  %{php_name}-spl
26 %endif
27 %{?requires_php_extension}
28 Requires:       %{php_name}-session
29 Provides:       php(msgpack) = %{version}
30 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31
32 %description
33 This extension provide API for communicating with MessagePack
34 serialization.
35
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.
39
40 %package devel
41 Summary:        MessagePack developer files (header)
42 Group:          Development/Libraries
43 Requires:       %{php_name}-devel
44 # does not require base
45
46 %description devel
47 These are the files needed to compile programs using MessagePack.
48
49 %prep
50 %setup -qc
51 mv %{modname}-%{version}/* .
52
53 # https://github.com/msgpack/msgpack-php/issues/110
54 rm tests/040*.phpt
55
56 %build
57 phpize
58 %configure
59 %{__make}
60
61 %if %{with tests}
62 # simple module load test
63 %{__php} -n -q \
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 \
69         -m > modules.log
70 grep %{modname} modules.log
71
72 cat <<'EOF' > run-tests.sh
73 #!/bin/sh
74 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
75 exec %{__make} test \
76         PHP_EXECUTABLE=%{__php} \
77         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" \
78         RUN_TESTS_SETTINGS="-q $*"
79 EOF
80 chmod +x run-tests.sh
81
82 ./run-tests.sh
83 %endif
84
85 %install
86 rm -rf $RPM_BUILD_ROOT
87 %{__make} install \
88         EXTENSION_DIR=%{php_extensiondir} \
89         INSTALL_ROOT=$RPM_BUILD_ROOT
90
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
95 EOF
96
97 %clean
98 rm -rf $RPM_BUILD_ROOT
99
100 %post
101 %php_webserver_restart
102
103 %postun
104 if [ "$1" = 0 ]; then
105         %php_webserver_restart
106 fi
107
108 %files
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
113
114 %files devel
115 %defattr(644,root,root,755)
116 %{_includedir}/php/ext/%{modname}
This page took 0.499238 seconds and 3 git commands to generate.