summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-02-23 15:16:56 +0100
committerRemi Collet <remi@php.net>2022-02-23 15:16:56 +0100
commit5802be8400b50620be042bddc27e2dd708af682a (patch)
tree9cd9d56b7eefb22854b24fcd4ec9f1a238382e11
parentf60886198c922fadd2c159a8a6aeb65a2d062e37 (diff)
retrieve tzdata version
use oracle client library version 21.5
-rw-r--r--php-7.3.3-systzdata-v19.patch (renamed from php-7.3.3-systzdata-v18.patch)86
-rw-r--r--php.spec22
2 files changed, 80 insertions, 28 deletions
diff --git a/php-7.3.3-systzdata-v18.patch b/php-7.3.3-systzdata-v19.patch
index eac3cc3..866729b 100644
--- a/php-7.3.3-systzdata-v18.patch
+++ b/php-7.3.3-systzdata-v19.patch
@@ -5,6 +5,7 @@ Add support for use of the system timezone database, rather
than embedding a copy. Discussed upstream but was not desired.
History:
+r19: retrieve tzdata version from /usr/share/zoneinfo/tzdata.zi
r18: adapt for autotool change in 7.3.3RC1
r17: adapt for timelib 2018.01 (in 7.3.2RC1)
r16: adapt for timelib 2017.06 (in 7.2.3RC1)
@@ -29,10 +30,11 @@ r3: fix a crash if /usr/share/zoneinfo doesn't exist (Raphael Geissert)
r2: add filesystem trawl to set up name alias index
r1: initial revision
-diff -up php-7.3.3RC1/ext/date/config0.m4.systzdata php-7.3.3RC1/ext/date/config0.m4
---- php-7.3.3RC1/ext/date/config0.m4.systzdata 2019-02-19 14:57:51.314601701 +0100
-+++ php-7.3.3RC1/ext/date/config0.m4 2019-02-19 14:58:29.050812587 +0100
-@@ -9,6 +9,19 @@ io.h
+diff --git a/ext/date/config0.m4 b/ext/date/config0.m4
+index 20e4164aaa..a61243646d 100644
+--- a/ext/date/config0.m4
++++ b/ext/date/config0.m4
+@@ -4,6 +4,19 @@ AC_CHECK_HEADERS([io.h])
dnl Check for strtoll, atoll
AC_CHECK_FUNCS(strtoll atoll)
@@ -52,10 +54,11 @@ diff -up php-7.3.3RC1/ext/date/config0.m4.systzdata php-7.3.3RC1/ext/date/config
PHP_DATE_CFLAGS="-I@ext_builddir@/lib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DHAVE_TIMELIB_CONFIG_H=1"
timelib_sources="lib/astro.c lib/dow.c lib/parse_date.c lib/parse_tz.c
lib/timelib.c lib/tm2unixtime.c lib/unixtime2tm.c lib/parse_iso_intervals.c lib/interval.c"
-diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/lib/parse_tz.c
---- php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata 2019-02-19 12:18:27.000000000 +0100
-+++ php-7.3.3RC1/ext/date/lib/parse_tz.c 2019-02-19 14:57:20.397428931 +0100
-@@ -25,8 +25,21 @@
+diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
+index 020da3135e..12e68ef043 100644
+--- a/ext/date/lib/parse_tz.c
++++ b/ext/date/lib/parse_tz.c
+@@ -26,8 +26,21 @@
#include "timelib.h"
#include "timelib_private.h"
@@ -77,7 +80,7 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
#if (defined(__APPLE__) || defined(__APPLE_CC__)) && (defined(__BIG_ENDIAN__) || defined(__LITTLE_ENDIAN__))
# if defined(__LITTLE_ENDIAN__)
-@@ -87,6 +100,11 @@ static int read_php_preamble(const unsig
+@@ -88,6 +101,11 @@ static int read_php_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
{
uint32_t version;
@@ -89,7 +92,7 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
/* read ID */
version = (*tzf)[3] - '0';
*tzf += 4;
-@@ -411,7 +429,429 @@ void timelib_dump_tzinfo(timelib_tzinfo
+@@ -412,7 +430,467 @@ void timelib_dump_tzinfo(timelib_tzinfo *tz)
}
}
@@ -320,6 +323,44 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
+}
+
+
++/* Retrieve tzdata version. */
++static void retrieve_zone_version(timelib_tzdb *db)
++{
++ static char buf[30];
++ char path[PATH_MAX];
++ FILE *fp;
++
++ strncpy(path, ZONEINFO_PREFIX "/tzdata.zi", sizeof(path));
++
++ fp = fopen(path, "r");
++ if (fp) {
++ if (fgets(buf, sizeof(buf), fp)) {
++ if (!memcmp(buf, "# version ", 10) &&
++ isdigit(buf[10]) &&
++ isdigit(buf[11]) &&
++ isdigit(buf[12]) &&
++ isdigit(buf[13]) &&
++ islower(buf[14])) {
++ if (buf[14] >= 't') { /* 2022t = 2022.20 */
++ buf[17] = 0;
++ buf[16] = buf[14] - 't' + '0';
++ buf[15] = '2';
++ } else if (buf[14] >= 'j') { /* 2022j = 2022.10 */
++ buf[17] = 0;
++ buf[16] = buf[14] - 'j' + '0';
++ buf[15] = '1';
++ } else { /* 2022a = 2022.1 */
++ buf[16] = 0;
++ buf[15] = buf[14] - 'a' + '1';
++ }
++ buf[14] = '.';
++ db->version = buf+10;
++ }
++ }
++ fclose(fp);
++ }
++}
++
+/* Create the zone identifier index by trawling the filesystem. */
+static void create_zone_index(timelib_tzdb *db)
+{
@@ -520,7 +561,7 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
{
int left = 0, right = tzdb->index_size - 1;
-@@ -437,9 +877,48 @@ static int seek_to_tz_position(const uns
+@@ -438,9 +916,49 @@ static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const
return 0;
}
@@ -557,6 +598,7 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
+ tmp->version = "0.system";
+ tmp->data = NULL;
+ create_zone_index(tmp);
++ retrieve_zone_version(tmp);
+ system_location_table = create_location_table();
+ fake_data_segment(tmp, system_location_table);
+ timezonedb_system = tmp;
@@ -569,7 +611,7 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
}
const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_tzdb *tzdb, int *count)
-@@ -451,7 +930,30 @@ const timelib_tzdb_index_entry *timelib_
+@@ -452,7 +970,30 @@ const timelib_tzdb_index_entry *timelib_timezone_identifiers_list(const timelib_
int timelib_timezone_id_is_valid(char *timezone, const timelib_tzdb *tzdb)
{
const unsigned char *tzf;
@@ -601,7 +643,7 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
}
static int skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz)
-@@ -493,12 +995,14 @@ static timelib_tzinfo* timelib_tzinfo_ct
+@@ -494,12 +1035,14 @@ static timelib_tzinfo* timelib_tzinfo_ctor(char *name)
timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, int *error_code)
{
const unsigned char *tzf;
@@ -617,7 +659,7 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
tmp = timelib_tzinfo_ctor(timezone);
version = read_preamble(&tzf, tmp, &type);
-@@ -537,11 +1041,36 @@ timelib_tzinfo *timelib_parse_tzfile(cha
+@@ -534,11 +1077,36 @@ timelib_tzinfo *timelib_parse_tzfile(char *timezone, const timelib_tzdb *tzdb, i
}
skip_posix_string(&tzf, tmp);
@@ -654,3 +696,19 @@ diff -up php-7.3.3RC1/ext/date/lib/parse_tz.c.systzdata php-7.3.3RC1/ext/date/li
} else {
*error_code = TIMELIB_ERROR_NO_SUCH_TIMEZONE;
tmp = NULL;
+diff --git a/ext/date/php_date.c b/ext/date/php_date.c
+index e1a427c5ca..465906fa2b 100644
+--- a/ext/date/php_date.c
++++ b/ext/date/php_date.c
+@@ -951,7 +951,11 @@ PHP_MINFO_FUNCTION(date)
+ php_info_print_table_row(2, "date/time support", "enabled");
+ php_info_print_table_row(2, "timelib version", TIMELIB_ASCII_VERSION);
+ php_info_print_table_row(2, "\"Olson\" Timezone Database Version", tzdb->version);
++#ifdef HAVE_SYSTEM_TZDATA
++ php_info_print_table_row(2, "Timezone Database", "system");
++#else
+ php_info_print_table_row(2, "Timezone Database", php_date_global_timezone_db_enabled ? "external" : "internal");
++#endif
+ php_info_print_table_row(2, "Default timezone", guess_timezone(tzdb));
+ php_info_print_table_end();
+
diff --git a/php.spec b/php.spec
index 42ecbc5..9bc5871 100644
--- a/php.spec
+++ b/php.spec
@@ -55,7 +55,7 @@
%global mysql_sock %(mysql_config --socket 2>/dev/null || echo /var/lib/mysql/mysql.sock)
-%global oraclever 21.3
+%global oraclever 21.5
%global oraclelib 21.1
# Build for LiteSpeed Web Server (LSAPI)
@@ -126,7 +126,7 @@
Summary: PHP scripting language for creating dynamic web sites
Name: %{?scl_prefix}php
Version: %{upver}%{?rcver:~%{rcver}}
-Release: 1%{?dist}
+Release: 2%{?dist}
# All files licensed under PHP version 3.01, except
# Zend is licensed under Zend
# TSRM is licensed under BSD
@@ -170,7 +170,7 @@ Patch10: php-net-snmp.patch
# Functional changes
Patch40: php-7.2.4-dlopen.patch
-Patch42: php-7.3.3-systzdata-v18.patch
+Patch42: php-7.3.3-systzdata-v19.patch
# See http://bugs.php.net/53436
Patch43: php-7.3.0-phpize.patch
# Use -lldap_r for OpenLDAP
@@ -741,12 +741,7 @@ Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release}
BuildRequires: libjpeg-devel, libpng-devel, freetype-devel
BuildRequires: libXpm-devel
%if %{with_libgd}
-BuildRequires: gd-devel >= 2.1.1
-%if 0%{?fedora} <= 19 && 0%{?rhel} <= 7
-Requires: gd-last%{?_isa} >= 2.1.1
-%else
-Requires: gd%{?_isa} >= 2.1.1
-%endif
+BuildRequires: gd-devel >= 2.3
%else
BuildRequires: libwebp-devel
Provides: bundled(gd) = 2.0.35
@@ -999,14 +994,9 @@ mkdir \
# ----- Manage known as failed test -------
# affected by systzdata patch
rm ext/date/tests/timezone_location_get.phpt
-rm ext/date/tests/timezone_version_get.phpt
-rm ext/date/tests/timezone_version_get_basic1.phpt
-%if 0%{?fedora} < 28
-# need tzdata 2018i
rm ext/date/tests/bug33414-1.phpt
rm ext/date/tests/bug33415-2.phpt
rm ext/date/tests/date_modify-1.phpt
-%endif
# too fast builder
rm ext/date/tests/bug73837.phpt
# fails sometime
@@ -1919,6 +1909,10 @@ fi
%changelog
+* Wed Feb 23 2022 Remi Collet <remi@remirepo.net> - 7.3.33-2
+- retrieve tzdata version
+- use oracle client library version 21.5
+
* Tue Nov 16 2021 Remi Collet <remi@remirepo.net> - 7.3.33-1
- Update to 7.3.33 - http://www.php.net/releases/7_3_33.php