]> git.pld-linux.org Git - packages/php-pecl-mongodb.git/blobdiff - php-pecl-mongodb.spec
up to 1.5.2
[packages/php-pecl-mongodb.git] / php-pecl-mongodb.spec
index db9f43c0e696bca2eaf54a79331ebbd55dfce79f..cda92ccd84587b8944ce27daeaa4de1b6b62516c 100644 (file)
@@ -5,32 +5,36 @@
 #
 # Conditional build:
 %bcond_without tests           # build without tests
-%bcond_without sasl            # Include Cyrus SASL support
+%bcond_with    sasl            # Include Cyrus SASL support (for bundled only)
+%bcond_without ssl             # Enable TLS connections and SCRAM-SHA-1 authentication (for bundled only)
+%bcond_with    bundled         # Use bundled libbson, libmongoc
 
 %define                php_name        php%{?php_suffix}
 %define                modname mongodb
 Summary:       MongoDB driver for PHP
 Name:          %{php_name}-pecl-%{modname}
-Version:       1.2.11
+Version:       1.5.2
 Release:       1
 License:       Apache v2.0
 Group:         Development/Languages/PHP
 Source0:       https://pecl.php.net/get/%{modname}-%{version}.tgz
-# Source0-md5: c3b36a24b7e47e3b4148cd9bc4d163b2
+# Source0-md5: 3569a12839c9908a25dac15df1ae9d18
 Source1:       mongodb.ini
-Patch0:                tests.patch
 URL:           https://pecl.php.net/package/mongodb
 BuildRequires: %{php_name}-cli
-BuildRequires: %{php_name}-devel >= 4:5.4.0
+BuildRequires: %{php_name}-devel >= 4:5.5.0
 BuildRequires: %{php_name}-json
 BuildRequires: %{php_name}-pcre
 BuildRequires: %{php_name}-spl
 %{?with_sasl:BuildRequires:    cyrus-sasl-devel}
-BuildRequires: libbson-devel >= 1.5.0
-BuildRequires: mongo-c-driver-devel >= 1.5.0
+%if %{without bundled}
+BuildRequires: libbson-devel >= 1.11.0
+BuildRequires: mongo-c-driver-devel >= 1.9
+%endif
 BuildRequires: openssl-devel
 BuildRequires: rpmbuild(macros) >= 1.666
 Requires:      %{php_name}-json
+Requires:      mongo-c-driver-libs >= 1.9.3-2
 Requires:      %{php_name}-pcre
 Requires:      %{php_name}-spl
 %{?requires_php_extension}
@@ -47,18 +51,23 @@ MongoDB driver.
 %prep
 %setup -qc
 mv %{modname}-%{version}/* .
-%patch0 -p1
 
+%if %{without bundled}
 # Ensure we use system library
 # remove only C sources, m4 resources needed for phpize via m4_include
 find \
        src/libbson \
        src/libmongoc \
        -name '*.[ch]' | xargs %{__rm} -v
+%endif
 
 %build
+get_version() {
+       local define="$1" filename="$2"
+       awk -vdefine="$define" '/#define/ && $2 == define {print $3}' "$filename" | xargs
+}
 # Sanity check, really often broken
-extver=$(sed -n '/#define PHP_MONGODB_VERSION/{s/.* "//;s/".*$//;p}' php_phongo.h)
+extver=$(get_version PHP_MONGODB_VERSION phongo_version.h)
 if test "x${extver}" != "x%{version}"; then
        : Error: Upstream extension version is ${extver}, expecting %{version}.
        exit 1
@@ -67,8 +76,9 @@ fi
 phpize
 
 %configure \
-       --with-libbson \
-       --with-libmongoc \
+       --with-libbson=%{?with_bundled:no}%{!?with_bundled:yes} \
+       --with-libmongoc=%{?with_bundled:no}%{!?with_bundled:yes} \
+       --with-mongodb-ssl=%{!?with_ssl:no}%{?with_ssl:openssl} \
        --with-mongodb-sasl=%{!?with_sasl:no}%{?with_sasl:yes} \
        --enable-mongodb
 
This page took 1.985051 seconds and 4 git commands to generate.