]> git.pld-linux.org Git - packages/php-pecl-mongodb.git/blob - php-pecl-mongodb.spec
disable 32bit arches - broken
[packages/php-pecl-mongodb.git] / php-pecl-mongodb.spec
1 # TODO
2 # - ix86/x32 (php -m) prints::
3 #   src/mongoc/mongoc-handshake.c:478 _append_and_truncate(): precondition failed: space_for_suffix >= 0
4 #   Aborted
5 #
6 # Conditional build:
7 %bcond_without  tests           # build without tests
8
9 %define         php_name        php%{?php_suffix}
10 %define         modname mongodb
11 Summary:        MongoDB driver for PHP
12 Name:           %{php_name}-pecl-%{modname}
13 Version:        1.2.11
14 Release:        1
15 License:        Apache v2.0
16 Group:          Development/Languages/PHP
17 Source0:        https://pecl.php.net/get/%{modname}-%{version}.tgz
18 # Source0-md5:  c3b36a24b7e47e3b4148cd9bc4d163b2
19 Source1:        mongodb.ini
20 Patch0:         tests.patch
21 URL:            https://pecl.php.net/package/mongodb
22 BuildRequires:  %{php_name}-cli
23 BuildRequires:  %{php_name}-devel >= 4:5.4.0
24 BuildRequires:  %{php_name}-json
25 BuildRequires:  %{php_name}-pcre
26 BuildRequires:  %{php_name}-spl
27 BuildRequires:  cyrus-sasl-devel
28 BuildRequires:  libbson-devel >= 1.5
29 BuildRequires:  mongo-c-driver-devel >= 1.5
30 BuildRequires:  openssl-devel
31 BuildRequires:  rpmbuild(macros) >= 1.666
32 Requires:       %{php_name}-json
33 Requires:       %{php_name}-pcre
34 Requires:       %{php_name}-spl
35 %{?requires_php_extension}
36 Provides:       php(%{modname}) = %{version}
37 ExcludeArch:    %{ix86} x32
38 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
39
40 %description
41 The purpose of this driver is to provide exceptionally thin glue
42 between MongoDB and PHP, implementing only fundemental and
43 performance-critical components necessary to build a fully-functional
44 MongoDB driver.
45
46 %prep
47 %setup -qc
48 mv %{modname}-%{version}/* .
49 %patch0 -p1
50
51 %build
52 # Sanity check, really often broken
53 extver=$(sed -n '/#define PHP_MONGODB_VERSION/{s/.* "//;s/".*$//;p}' php_phongo.h)
54 if test "x${extver}" != "x%{version}"; then
55         : Error: Upstream extension version is ${extver}, expecting %{version}.
56         exit 1
57 fi
58
59 phpize
60 # Ensure we use system library
61 # Need to be removed only after phpize because of m4_include
62 %{__rm} -r src/libbson
63 %{__rm} -r src/libmongoc
64
65 %configure \
66         --with-libbson \
67         --with-libmongoc \
68         --enable-mongodb
69
70 %{__make}
71
72 # simple module load test, always enabled
73 %{__php} -n -q \
74         -d extension_dir=modules \
75         -d extension=%{php_extensiondir}/pcre.so \
76         -d extension=%{php_extensiondir}/spl.so \
77         -d extension=%{php_extensiondir}/json.so \
78         -d extension=%{modname}.so \
79         -m > modules.log
80 grep %{modname} modules.log
81
82 %if %{with tests}
83 cat <<'EOF' > run-tests.sh
84 #!/bin/sh
85 export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
86 exec %{__make} test \
87         PHP_EXECUTABLE=%{__php} \
88         PHP_TEST_SHARED_SYSTEM_EXTENSIONS="pcre spl json" \
89         RUN_TESTS_SETTINGS="-q $*"
90 EOF
91 chmod +x run-tests.sh
92
93 ./run-tests.sh
94 %endif
95
96 %install
97 rm -rf $RPM_BUILD_ROOT
98 %{__make} install \
99         EXTENSION_DIR=%{php_extensiondir} \
100         INSTALL_ROOT=$RPM_BUILD_ROOT
101
102 install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
103 cp -p %{SOURCE1} $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
104
105 %clean
106 rm -rf $RPM_BUILD_ROOT
107
108 %files
109 %defattr(644,root,root,755)
110 %config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
111 %attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.06385 seconds and 4 git commands to generate.