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