]>
Commit | Line | Data |
---|---|---|
1637b078 ER |
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} | |
27ede28f | 9 | Version: 0.5.6 |
1637b078 ER |
10 | Release: 1 |
11 | License: PHP 3.01 | |
12 | Group: Development/Languages/PHP | |
13 | Source0: http://pecl.php.net/get/%{modname}-%{version}.tgz | |
27ede28f | 14 | # Source0-md5: 895b90dc4bfdf2c7575b166ca68cbfc5 |
1637b078 ER |
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 | |
658f8502 | 20 | BuildRequires: %{php_name}-pcre |
1637b078 ER |
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 \ | |
658f8502 | 50 | -d extension=%{php_extensiondir}/pcre.so \ |
1637b078 ER |
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} \ | |
658f8502 | 60 | PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl session" |
1637b078 ER |
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 |