]> git.pld-linux.org Git - packages/php-pecl-mongodb.git/blame - php-pecl-mongodb.spec
up to 1.2.11
[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
e6a2fe32 15URL: https://pecl.php.net/package/mongodb
78f25fe6 16BuildRequires: %{php_name}-devel >= 4:5.4.0
e6a2fe32
ER
17BuildRequires: rpmbuild(macros) >= 1.666
18%if %{with tests}
19BuildRequires: %{php_name}-json
20%endif
21BuildRequires: cyrus-sasl-devel
78f25fe6
ER
22BuildRequires: libbson-devel >= 1.5
23BuildRequires: mongo-c-driver-devel >= 1.5
e6a2fe32 24BuildRequires: openssl-devel
e6a2fe32
ER
25Requires: %{php_name}-json
26%{?requires_php_extension}
27Provides: php(%{modname}) = %{version}
28BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30%description
31The purpose of this driver is to provide exceptionally thin glue
32between MongoDB and PHP, implementing only fundemental and
33performance-critical components necessary to build a fully-functional
34MongoDB driver.
35
36%prep
37%setup -qc
38mv %{modname}-%{version}/* .
39
40# Create configuration file
41cat << 'EOF' > %{modname}.ini
42; Enable %{summary} extension module
43extension=%{modname}.so
44
45; Configuration
46;mongodb.debug=''
47EOF
48
49%build
50# Sanity check, really often broken
51extver=$(sed -n '/#define PHP_MONGODB_VERSION/{s/.* "//;s/".*$//;p}' php_phongo.h)
52if test "x${extver}" != "x%{version}"; then
53 : Error: Upstream extension version is ${extver}, expecting %{version}.
54 exit 1
55fi
56
57phpize
58# Ensure we use system library
59# Need to be removed only after phpize because of m4_include
60%{__rm} -r src/libbson
61%{__rm} -r src/libmongoc
62
63%configure \
64 --with-libbson \
65 --with-libmongoc \
66 --enable-mongodb
67
68%{__make}
69
70%if %{with tests}
71# simple module load test
72%{__php} -n -q \
73 -d extension_dir=modules \
74 -d extension=%{php_extensiondir}/json.so \
75 -d extension=%{modname}.so \
76 -m > modules.log
77grep %{modname} modules.log
78
79export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
80%{__make} test \
81 PHP_EXECUTABLE=%{__php} \
82 PHP_TEST_SHARED_SYSTEM_EXTENSIONS="json"
83%endif
84
85%install
86rm -rf $RPM_BUILD_ROOT
87%{__make} install \
88 EXTENSION_DIR=%{php_extensiondir} \
89 INSTALL_ROOT=$RPM_BUILD_ROOT
90
78f25fe6 91install -d $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
e6a2fe32
ER
92cp -p %{modname}.ini $RPM_BUILD_ROOT%{php_sysconfdir}/conf.d
93
94%clean
95rm -rf $RPM_BUILD_ROOT
96
97%files
98%defattr(644,root,root,755)
e6a2fe32
ER
99%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/%{modname}.ini
100%attr(755,root,root) %{php_extensiondir}/%{modname}.so
This page took 0.159491 seconds and 4 git commands to generate.