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