summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-skywalking.spec80
-rw-r--r--skywalking-php85.patch102
2 files changed, 136 insertions, 46 deletions
diff --git a/php-pecl-skywalking.spec b/php-pecl-skywalking.spec
index 93e2286..3b4b45a 100644
--- a/php-pecl-skywalking.spec
+++ b/php-pecl-skywalking.spec
@@ -1,8 +1,8 @@
# remirepo spec file for php-pecl-skywalking
#
-# Copyright (c) 2019-2022 Remi Collet
-# License: CC-BY-SA
-# http://creativecommons.org/licenses/by-sa/4.0/
+# SPDX-FileCopyrightText: Copyright 2019-2025 Remi Collet
+# SPDX-License-Identifier: CECILL-2.1
+# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
# Please, preserve the changelog entries
#
@@ -16,25 +16,23 @@
# not supported by upstream
%global with_zts 0
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: The PHP instrument agent for Apache SkyWalking
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 5.0.1
-Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: ASL 2.0
+Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+License: Apache-2.0
URL: https://pecl.php.net/package/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
# awfull hack, use a bundled rust registry
Source1: makedeps.sh
Source2: https://pecl.php.net/get/%{pecl_name}-deps-%{version}.tgz
-%if 0%{?rhel} == 7 && 0%{?dtsversion} == 0
-BuildRequires: devtoolset-6-toolchain
-%global dtsversion 6
-%global dtsenable source /opt/rh/devtoolset-6/enable
-%global dtsprefix devtoolset-6-
-%endif
+Patch0: %{pecl_name}-php85.patch
+
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
@@ -75,7 +73,6 @@ Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-curl
Requires: %{?scl_prefix}php-json
Requires: %{?scl_prefix}php-pcre
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -92,18 +89,20 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c -a2
-mv %{pecl_name}-%{version} NTS
# Don't install/register tests
sed -e 's/role="test"/role="src"/' \
- %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
+ -e '/LICENSE/s/role="doc"/role="src"/' \
-i package.xml
-pushd NTS
+pushd %{sources}
+%patch -P0 -p1
+
# Create cargo configuration to use vendor directory
mkdir .cargo
cat << EOF | tee .cargo/config.toml
[build]
+jobs = %(echo %{?_smp_mflags} | sed 's/\-j//')
rustc = "%{_root_bindir}/rustc"
[env]
@@ -129,9 +128,10 @@ if test "x${extver}" != "x%{version}%{?prever}"; then
fi
popd
+mkdir NTS
+
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -170,19 +170,22 @@ grep -h rust-version mycargo/*/Cargo.toml NTS/Cargo.toml | sort -u | tail -n 4
export CARGO_HOME=$PWD/mycargo
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+cp -r ../%{sources}/.cargo .cargo
%configure \
--enable-skywalking \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
+cp -r ../%{sources}/.cargo .cargo
%configure \
--enable-skywalking \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -205,31 +208,10 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
-cd NTS
+cd %{sources}
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%{!?_licensedir:install -Dpm 644 LICENSE %{buildroot}%{pecl_docdir}/%{pecl_name}/LICENSE}
-
-
-%if 0%{?fedora} < 24 && 0%{?rhel} < 8
-# when pear installed alone, after us
-%triggerin -- %{?scl_prefix}php-pear
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-# posttrans as pear can be installed after us
-%posttrans
-if [ -x %{__pecl} ] ; then
- %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
-fi
-
-%postun
-if [ $1 -eq 0 -a -x %{__pecl} ] ; then
- %{pecl_uninstall} %{pecl_name} >/dev/null || :
-fi
-%endif
%check
@@ -249,7 +231,7 @@ OPT="-n -d extension=curl.so -d extension=json.so"
%files
-%{?_licensedir:%license NTS/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -263,6 +245,12 @@ OPT="-n -d extension=curl.so -d extension=json.so"
%changelog
+* Wed Jul 30 2025 Remi Collet <remi@remirepo.net> - 5.0.1-4
+- re-license spec file to CECILL-2.1
+
+* Mon Sep 4 2023 Remi Collet <remi@remirepo.net> - 5.0.1-3
+- build out of sources tree
+
* Fri Jul 1 2022 Remi Collet <remi@remirepo.net> - 5.0.1-2
- use cargo vendor feature to reduce sources size
diff --git a/skywalking-php85.patch b/skywalking-php85.patch
new file mode 100644
index 0000000..aa14312
--- /dev/null
+++ b/skywalking-php85.patch
@@ -0,0 +1,102 @@
+From 7202ec37c4205b84b4df217436ab0e6a64a79d86 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Wed, 30 Jul 2025 14:35:24 +0200
+Subject: [PATCH] use Zend/zend_smart_string.h
+
+---
+ src/sky_core_log.c | 1 -
+ src/sky_core_segment.c | 2 +-
+ src/sky_core_span.c | 1 -
+ src/sky_core_tag.c | 3 +--
+ src/sky_plugin_redis.c | 1 -
+ src/sky_util_php.h | 5 +++++
+ 6 files changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/src/sky_core_log.c b/src/sky_core_log.c
+index cff9081..8b43c2d 100644
+--- a/src/sky_core_log.c
++++ b/src/sky_core_log.c
+@@ -20,7 +20,6 @@
+ #include "php.h"
+ #include <sys/time.h>
+ #include "sky_util_php.h"
+-#include "ext/standard/php_smart_string.h"
+
+ sky_core_log_t *sky_core_log_new() {
+ sky_core_log_t *log = (sky_core_log_t *) emalloc(sizeof(sky_core_log_t));
+diff --git a/src/sky_core_segment.c b/src/sky_core_segment.c
+index fd5d9dc..5503cec 100644
+--- a/src/sky_core_segment.c
++++ b/src/sky_core_segment.c
+@@ -23,7 +23,7 @@
+ #include "sky_core_cross_process.h"
+ #include "sky_core_segment_reference.h"
+ #include "sky_core_report.h"
+-#include "ext/standard/php_smart_string.h"
++#include "sky_util_php.h"
+
+ sky_core_segment_t *sky_core_segment_new(char *protocol) {
+ sky_core_segment_t *segment = (sky_core_segment_t *) emalloc(sizeof(sky_core_segment_t));
+diff --git a/src/sky_core_span.c b/src/sky_core_span.c
+index dba3c63..0abbb88 100644
+--- a/src/sky_core_span.c
++++ b/src/sky_core_span.c
+@@ -22,7 +22,6 @@
+ #include <string.h>
+ #include <sys/time.h>
+ #include "sky_util_php.h"
+-#include "ext/standard/php_smart_string.h"
+
+ sky_core_span_t *sky_core_span_new(sky_core_span_type type, sky_core_span_layer layer, int componentId) {
+ sky_core_span_t *span = (sky_core_span_t *) emalloc(sizeof(sky_core_span_t));
+diff --git a/src/sky_core_tag.c b/src/sky_core_tag.c
+index 228afa6..62559df 100644
+--- a/src/sky_core_tag.c
++++ b/src/sky_core_tag.c
+@@ -20,7 +20,6 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include "sky_util_php.h"
+-#include "ext/standard/php_smart_string.h"
+
+ sky_core_tag_t *sky_core_tag_new(char *key, char *value) {
+ sky_core_tag_t *tag = (sky_core_tag_t *) emalloc(sizeof(sky_core_tag_t));
+@@ -44,4 +43,4 @@ int sky_core_tag_to_json(char **json, sky_core_tag_t *tag) {
+ efree(tag);
+ *json = str.c;
+ return str.len;
+-}
+\ No newline at end of file
++}
+diff --git a/src/sky_plugin_redis.c b/src/sky_plugin_redis.c
+index bd3838b..5918d2e 100644
+--- a/src/sky_plugin_redis.c
++++ b/src/sky_plugin_redis.c
+@@ -19,7 +19,6 @@
+ #include "sky_plugin_redis.h"
+ #include "sky_util_php.h"
+ #include "sky_utils.h"
+-#include "ext/standard/php_smart_string.h"
+
+ // strings
+ zif_handler origin_redis_append = NULL;
+diff --git a/src/sky_util_php.h b/src/sky_util_php.h
+index aeb2694..ffc5503 100644
+--- a/src/sky_util_php.h
++++ b/src/sky_util_php.h
+@@ -27,7 +27,12 @@ typedef void (*zif_handler)(INTERNAL_FUNCTION_PARAMETERS);
+
+ #endif
+
++
++#if PHP_VERSION_ID < 70200
+ #include "ext/standard/php_smart_string.h"
++#else
++#include "Zend/zend_smart_string.h"
++#endif
+
+ void *sky_util_find_obj_func(const char *obj, const char *name);
+
+--
+2.50.1
+