!46 use lmdb instead of Berkeley DB for package dba

From: @panxh_purple
Reviewed-by: @overweight
Signed-off-by: @overweight
This commit is contained in:
openeuler-ci-bot 2021-03-26 17:18:27 +08:00 committed by Gitee
commit 25fc6428c6
2 changed files with 13 additions and 113 deletions

View File

@ -1,92 +0,0 @@
diff -up ./ext/dba/config.m4.libdb ./ext/dba/config.m4
--- ./ext/dba/config.m4.libdb 2020-04-09 14:06:11.000000000 +0200
+++ ./ext/dba/config.m4 2020-04-09 14:35:08.208605065 +0200
@@ -375,61 +375,13 @@ if test "$PHP_DB4" != "no"; then
dbdp4="/usr/local/BerkeleyDB.4."
dbdp5="/usr/local/BerkeleyDB.5."
for i in $PHP_DB4 ${dbdp5}1 ${dbdp5}0 ${dbdp4}8 ${dbdp4}7 ${dbdp4}6 ${dbdp4}5 ${dbdp4}4 ${dbdp4}3 ${dbdp4}2 ${dbdp4}1 ${dbdp}0 /usr/local /usr; do
- if test -f "$i/db5/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/db5/db.h
- break
- elif test -f "$i/db4/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/db4/db.h
- break
- elif test -f "$i/include/db5.3/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db5.3/db.h
- break
- elif test -f "$i/include/db5.1/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db5.1/db.h
- break
- elif test -f "$i/include/db5.0/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db5.0/db.h
- break
- elif test -f "$i/include/db4.8/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db4.8/db.h
- break
- elif test -f "$i/include/db4.7/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db4.7/db.h
- break
- elif test -f "$i/include/db4.6/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db4.6/db.h
- break
- elif test -f "$i/include/db4.5/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db4.5/db.h
- break
- elif test -f "$i/include/db4/db.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db4/db.h
- break
- elif test -f "$i/include/db/db4.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db/db4.h
- break
- elif test -f "$i/include/db4.h"; then
- THIS_PREFIX=$i
- THIS_INCLUDE=$i/include/db4.h
- break
- elif test -f "$i/include/db.h"; then
+ if test -f "$i/include/db.h"; then
THIS_PREFIX=$i
THIS_INCLUDE=$i/include/db.h
break
fi
done
- PHP_DBA_DB_CHECK(4, db-5.3 db-5.1 db-5.0 db-4.8 db-4.7 db-4.6 db-4.5 db-4.4 db-4.3 db-4.2 db-4.1 db-4.0 db-4 db4 db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
+ PHP_DBA_DB_CHECK(4, db, [(void)db_create((DB**)0, (DB_ENV*)0, 0)])
fi
PHP_DBA_STD_RESULT(db4,Berkeley DB4)
diff -up ./ext/dba/dba.c.libdb ./ext/dba/dba.c
--- ./ext/dba/dba.c.libdb 2020-04-09 14:06:11.000000000 +0200
+++ ./ext/dba/dba.c 2020-04-09 14:36:30.593275190 +0200
@@ -50,6 +50,10 @@
#include "php_lmdb.h"
#include "dba_arginfo.h"
+#ifdef DB4_INCLUDE_FILE
+#include DB4_INCLUDE_FILE
+#endif
+
PHP_MINIT_FUNCTION(dba);
PHP_MSHUTDOWN_FUNCTION(dba);
PHP_MINFO_FUNCTION(dba);
@@ -459,6 +463,10 @@ PHP_MINFO_FUNCTION(dba)
php_info_print_table_start();
php_info_print_table_row(2, "DBA support", "enabled");
+#ifdef DB_VERSION_STRING
+ php_info_print_table_row(2, "libdb header version", DB_VERSION_STRING);
+ php_info_print_table_row(2, "libdb library version", db_version(NULL, NULL, NULL));
+#endif
if (handlers.s) {
smart_str_0(&handlers);
php_info_print_table_row(2, "Supported handlers", ZSTR_VAL(handlers.s));

View File

@ -22,12 +22,11 @@
%global with_freetds 0
%global with_sodium 0
%global with_pspell 0
%global with_lmdb 0
%global upver 8.0.0
Name: php
Version: %{upver}%{?rcver:~%{rcver}}
Release: 1
Release: 2
Summary: PHP scripting language for creating dynamic web sites
License: PHP and Zend-2.0 and BSD and MIT and ASL 1.0 and NCSA
URL: http://www.php.net/
@ -51,13 +50,12 @@ Source52: 20-ffi.ini
Patch0: php-7.4.0-httpd.patch
Patch1: php-7.2.0-includedir.patch
Patch2: php-8.0.0-embed.patch
Patch3: php-7.4.0-libdb.patch
Patch4: php-8.0.0-systzdata-v19.patch
Patch5: php-7.4.0-phpize.patch
Patch6: php-7.4.0-ldap_r.patch
Patch7: php-8.0.0-phpinfo.patch
Patch8: php-7.4.0-datetests.patch
Patch9: backport-CVE-2020-7071-Fix-bug-77423.patch
Patch3: php-8.0.0-systzdata-v19.patch
Patch4: php-7.4.0-phpize.patch
Patch5: php-7.4.0-ldap_r.patch
Patch6: php-8.0.0-phpinfo.patch
Patch7: php-7.4.0-datetests.patch
Patch8: backport-CVE-2020-7071-Fix-bug-77423.patch
BuildRequires: bzip2-devel, curl-devel >= 7.9, httpd-devel >= 2.0.46-1, pam-devel, httpd-filesystem, nginx-filesystem
BuildRequires: libstdc++-devel, openssl-devel, sqlite-devel >= 3.6.0, zlib-devel, smtpdaemon, libedit-devel
@ -380,10 +378,7 @@ using the GNU MP library.
%package dba
Summary: A database abstraction layer module for PHP applications
License: PHP
BuildRequires: libdb-devel, tokyocabinet-devel
%if %{with_lmdb}
BuildRequires: lmdb-devel
%endif
BuildRequires: lmdb-devel, tokyocabinet-devel
Requires: php-common%{?_isa} = %{version}-%{release}
%description dba
@ -619,10 +614,7 @@ build --libdir=%{_libdir}/php --enable-pcntl --enable-opcache --enable-phpdbg \
%endif
--with-external-gd \
--with-gmp=shared --enable-calendar=shared --enable-bcmath=shared --with-bz2=shared --enable-ctype=shared \
--enable-dba=shared --with-db4=%{_prefix} --with-tcadb=%{_prefix} \
%if %{with_lmdb}
--with-lmdb=%{_prefix} \
%endif
--enable-dba=shared --with-tcadb=%{_prefix} --with-lmdb=%{_prefix} \
--enable-exif=shared --enable-ftp=shared --with-gettext=shared --with-iconv=shared --enable-sockets=shared \
--enable-tokenizer=shared --with-ldap=shared --with-ldap-sasl --enable-mysqlnd=shared \
--with-mysqli=shared,mysqlnd --with-mysql-sock=%{mysql_sock} \
@ -700,10 +692,7 @@ build --includedir=%{_includedir}/php-zts --libdir=%{_libdir}/php-zts --enable-m
%endif
--with-external-gc \
--with-gmp=shared --enable-calendar=shared --enable-bcmath=shared --with-bz2=shared --enable-ctype=shared \
--enable-dba=shared --with-db4=%{_prefix} --with-tcadb=%{_prefix} \
%if %{with_lmdb}
--with-lmdb=%{_prefix} \
%endif
--enable-dba=shared --with-tcadb=%{_prefix} --with-lmdb=%{_prefix} \
--with-gettext=shared --with-iconv=shared --enable-sockets=shared --enable-tokenizer=shared --enable-exif=shared \
--enable-ftp=shared --with-ldap=shared --with-ldap-sasl --enable-mysqlnd=shared \
--with-mysqli=shared,mysqlnd --with-mysql-sock=%{mysql_sock} --enable-mysqlnd-threading \
@ -1095,6 +1084,9 @@ systemctl try-restart php-fpm.service >/dev/null 2>&1 || :
%{_mandir}/*
%changelog
* Thu Mar 25 2021 panxiaohe <panxiaohe@huawei.com> - 8.0.0-2
- use lmdb instead of Berkeley DB for package dba
* Thu Feb 4 2021 panxiaohe <panxiaohe@huawei.com> - 8.0.0-1
- Update to 8.0.0
- Fix CVE-2020-7060 CVE-2020-7069 CVE-2020-7070