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