diff options
Diffstat (limited to 'php-pecl-skywalking-agent.spec')
-rw-r--r-- | php-pecl-skywalking-agent.spec | 116 |
1 files changed, 33 insertions, 83 deletions
diff --git a/php-pecl-skywalking-agent.spec b/php-pecl-skywalking-agent.spec index 7baf023..2743bbd 100644 --- a/php-pecl-skywalking-agent.spec +++ b/php-pecl-skywalking-agent.spec @@ -1,8 +1,8 @@ # remirepo spec file for php-pecl-skywalking-agent # -# Copyright (c) 2022-2023 Remi Collet -# License: CC-BY-SA-4.0 -# http://creativecommons.org/licenses/by-sa/4.0/ +# SPDX-FileCopyrightText: Copyright 2024 Remi Collet +# SPDX-License-Identifier: CECILL-2.1 +# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt # # Please, preserve the changelog entries # @@ -13,24 +13,17 @@ %global _root_bindir %{_bindir} %endif +# notice: ZTS not supported by upstream %global pecl_name skywalking_agent -# not supported by upstream -%global with_zts 0 %global ini_name 40-%{pecl_name}.ini %global sources %{pecl_name}-%{version} -%global _configure ../%{sources}/configure ## BUILD: Fedora / EL-8 and EL-9 using --enablerepo=stream if needed -## EL-7 not supported (This crate only supports `libclang` 3.5 and later) - -## TODO: issues -# no support for offline build -# => workaround with "cargo vendor" Summary: Apache SkyWalking PHP Agent Name: %{?scl_prefix}php-pecl-skywalking-agent -Version: 0.7.0 +Version: 0.8.0 Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: Apache-2.0 URL: https://pecl.php.net/package/%{pecl_name} @@ -40,12 +33,6 @@ Source0: https://pecl.php.net/get/%{sources}.tgz Source1: makedeps.sh Source2: %{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 BuildRequires: make BuildRequires: %{?dtsprefix}gcc BuildRequires: %{?dtsprefix}gcc-c++ @@ -55,6 +42,11 @@ BuildRequires: cargo >= 1.65 BuildRequires: rustfmt BuildRequires: protobuf-compiler BuildRequires: clang-devel +BuildRequires: pkgconfig(libsasl2) +BuildRequires: openssl-devel +%if 0%{?fedora} >= 41 +BuildRequires: openssl-devel-engine +%endif %if 0%{?fedora} >= 27 || 0%{?rhel} >= 9 BuildRequires: rust-packaging %endif @@ -82,7 +74,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO # 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 # Create cargo configuration to use vendor directory @@ -113,12 +105,6 @@ grep '^version' Cargo.toml grep '^version = "%{version}"' Cargo.toml popd -mkdir NTS -%if %{with_zts} -# Duplicate source tree for NTS / ZTS build -mkdir ZTS -%endif - # Create configuration file cat > %{ini_name} << 'EOF' ; Enable %{pecl_name} extension module @@ -128,6 +114,7 @@ extension=%{pecl_name}.so ;skywalking_agent.enable = 0 ;skywalking_agent.skywalking_version = 8 ;skywalking_agent.server_addr = 127.0.0.1:11800 +;skywalking_agent.instance_name = ;skywalking_agent.service_name = hello-skywalking ;skywalking_agent.worker_threads = 0 ;skywalking_agent.log_level = OFF @@ -144,6 +131,8 @@ extension=%{pecl_name}.so ;skywalking_agent.reporter_type = grpc ;skywalking_agent.kafka_bootstrap_servers = ;skywalking_agent.kafka_producer_config = {} +;skywalking_agent.inject_context = 0 +;skywalking_agent.standalone_socket_path = EOF : Required rust version @@ -154,103 +143,64 @@ grep -h rust-version mycargo/*/Cargo.toml %{sources}/Cargo.toml | sort -u | tail %{?dtsenable} export CARGO_HOME=$PWD/mycargo +export RUSTFLAGS="%{?build_rustflags}%{!?build_rustflags:-Copt-level=3 -Cdebuginfo=2 -Ccodegen-units=1 -Cstrip=none -Cforce-frame-pointers=yes --cap-lints=warn}" cd %{sources} %{__phpize} -cd ../NTS %configure \ --enable-skywalking_agent \ +%if 0%{?rhel} == 10 + --disable-kafka-reporter \ +%else --enable-kafka-reporter \ +%endif --with-php-config=%{__phpconfig} -make %{?_smp_mflags} -%if %{with_zts} -cd ../ZTS -%configure \ - --enable-skywalking_agent \ - --enable-kafka-reporter \ - --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} -%endif %install %{?dtsenable} -make -C NTS install INSTALL_ROOT=%{buildroot} +cd %{sources} +make install INSTALL_ROOT=%{buildroot} # install config file -install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} +install -D -m 644 ../%{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install XML package description -install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml - -%if %{with_zts} -make -C ZTS install INSTALL_ROOT=%{buildroot} - -install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} -%endif +install -D -m 644 ../package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml # Documentation -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 -OPT="-n -d extension=curl.so -d extension=json.so" - -# Minimal load test for NTS extension -%{__php} $OPT \ - --define extension=$PWD/NTS/modules/%{pecl_name}.so \ +# Minimal load test for the extension +%{__php} -n \ + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' -%if %{with_zts} -# Minimal load test for ZTS extension -%{__ztsphp} $OPT \ - --define extension=$PWD/ZTS/modules/%{pecl_name}.so \ - --modules | grep '^%{pecl_name}$' -%endif - %files -%{?_licensedir:%license %{sources}/LICENSE %{sources}/dist-material/licenses/LICENSE*} +%license %{sources}/LICENSE %{sources}/dist-material/licenses/LICENSE* %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so -%if %{with_zts} -%config(noreplace) %{php_ztsinidir}/%{ini_name} -%{php_ztsextdir}/%{pecl_name}.so -%endif - %changelog +* Mon Dec 9 2024 Remi Collet <remi@remirepo.net> - 0.8.0-1 +- update to 0.8.0 +- EL-10 disable kafka reporter - broken build with OPENSSL_NO_ENGINE + resported as https://github.com/apache/skywalking/issues/12837 +- re-license spec file to CECILL-2.1 + * Thu Sep 28 2023 Remi Collet <remi@remirepo.net> - 0.7.0-1 - update to 0.7.0 |