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