summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-uuid.spec18
-rw-r--r--uuid-workaround.patch55
2 files changed, 54 insertions, 19 deletions
diff --git a/php-pecl-uuid.spec b/php-pecl-uuid.spec
index b765a82..a84efd0 100644
--- a/php-pecl-uuid.spec
+++ b/php-pecl-uuid.spec
@@ -24,7 +24,7 @@
Summary: Universally Unique Identifier extension for PHP
Name: %{?scl_prefix}php-pecl-uuid
Version: 1.2.0
-Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 9%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: LGPL-2.1-or-later
URL: https://pecl.php.net/package/uuid
Source: https://pecl.php.net/get/%{sources}.tgz
@@ -33,7 +33,7 @@ Patch0: %{pecl_name}-workaround.patch
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel > 7
+BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: libuuid-devel
@@ -94,13 +94,15 @@ export PHP_RPATH=no
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure \
--with-php-config=%{__phpconfig} \
--with-libdir=%{_lib} \
--with-uuid
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
@@ -108,7 +110,7 @@ cd ../ZTS
--with-php-config=%{__ztsphpconfig} \
--with-libdir=%{_lib} \
--with-uuid
-make %{?_smp_mflags}
+%make_build
%endif
@@ -116,12 +118,12 @@ make %{?_smp_mflags}
%{?dtsenable}
# Install the NTS stuff
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
%if %{with_zts}
# Install the ZTS stuff
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -182,6 +184,10 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Sep 30 2024 Remi Collet <remi@remirepo.net> - 1.2.0-9
+- fix workaround for recent util-linux
+ see https://bugzilla.redhat.com/2315645
+
* Tue Aug 27 2024 Remi Collet <remi@remirepo.net> - 1.2.0-8
- workaround for recent util-linux
diff --git a/uuid-workaround.patch b/uuid-workaround.patch
index 71a6147..430f54f 100644
--- a/uuid-workaround.patch
+++ b/uuid-workaround.patch
@@ -1,6 +1,16 @@
-diff -up ./uuid.c.orig ./uuid.c
---- ./uuid.c.orig 2020-10-06 12:50:46.000000000 +0200
-+++ ./uuid.c 2024-08-27 15:57:06.551255840 +0200
+From 3080c0be6da7477954862e1ed9a267ce39b268ad Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Tue, 27 Aug 2024 16:04:16 +0200
+Subject: [PATCH 1/2] workround with define uuid_time uuid_time64
+
+---
+ uuid.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/uuid.c b/uuid.c
+index ae024e7..73136f0 100644
+--- a/uuid.c
++++ b/uuid.c
@@ -27,6 +27,12 @@
#ifdef HAVE_UUID
@@ -14,15 +24,34 @@ diff -up ./uuid.c.orig ./uuid.c
#if PHP_VERSION_ID < 80000
#define VALUE_ERROR(n,name,msg) php_error_docref(NULL, E_WARNING, "Argument #%d (%s) %s", n, name, msg); RETURN_FALSE
#define RETURN_THROWS() return
-@@ -374,7 +380,11 @@ PHP_FUNCTION(uuid_time)
- VALUE_ERROR(1, "$uuid", "UUID DCE TIME expected");
- }
+--
+2.46.2
+
+From 77720b2b4c2c57cd18ffc5dbf32a247b6952abed Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Mon, 30 Sep 2024 11:45:34 +0200
+Subject: [PATCH 2/2] fix workaround
+
+---
+ uuid.c | 7 ++-----
+ 1 file changed, 2 insertions(+), 5 deletions(-)
+
+diff --git a/uuid.c b/uuid.c
+index 73136f0..c45aa2a 100644
+--- a/uuid.c
++++ b/uuid.c
+@@ -28,9 +28,10 @@
+ #ifdef HAVE_UUID
-+#ifdef HAVE_TIME64
-+ RETURN_LONG(uuid_time64(u, NULL));
-+#else
- RETURN_LONG(uuid_time(u, NULL));
-+#endif
- }
- /* }}} uuid_time */
+ /* workround with define uuid_time uuid_time64 */
++/* Also see https://bugzilla.redhat.com/2315645 */
+ #ifdef uuid_time
+ #undef uuid_time
+-#define HAVE_TIME64
++extern time_t uuid_time(const uuid_t uu, struct timeval *ret_tv);
+ #endif
+ #if PHP_VERSION_ID < 80000
+--
+2.46.2
+