diff options
Diffstat (limited to 'php-pecl-skywalking-agent.spec')
-rw-r--r-- | php-pecl-skywalking-agent.spec | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/php-pecl-skywalking-agent.spec b/php-pecl-skywalking-agent.spec index f68ee8a..21e248f 100644 --- a/php-pecl-skywalking-agent.spec +++ b/php-pecl-skywalking-agent.spec @@ -6,6 +6,7 @@ # # Please, preserve the changelog entries # + %if 0%{?scl:1} %scl_package php-pecl-skywalking-agent %else @@ -16,29 +17,27 @@ # 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 ## TODO: issues -# bad role for documentation (role="src" instead of role="doc") -# => fixed in prep -# broken build with rust 1.62 (RHEL-8 and RHEL-9) -# => fixed using stream (rust 1.66) # no support for offline build # => workaround with "cargo vendor" Summary: Apache SkyWalking PHP Agent Name: %{?scl_prefix}php-pecl-skywalking-agent -Version: 0.5.0 +Version: 0.6.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} -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 +Source2: %{pecl_name}-deps-%{version}.tgz %if 0%{?rhel} == 7 && 0%{?dtsversion} == 0 BuildRequires: devtoolset-6-toolchain @@ -61,7 +60,6 @@ BuildRequires: rust-packaging Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} -%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}} Provides: %{?scl_prefix}php-%{pecl_name} = %{version} Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version} @@ -80,21 +78,18 @@ 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"/' } \ -i package.xml -pushd NTS -# parallel build -sed -e '/CARGO_MODE_FLAGS/s/--release/%{?_smp_mflags} --release/' -i config.m4 - +pushd %{sources} # 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] @@ -117,9 +112,10 @@ grep '^version' Cargo.toml grep '^version = "%{version}"' Cargo.toml popd +mkdir NTS %if %{with_zts} # Duplicate source tree for NTS / ZTS build -cp -pr NTS ZTS +mkdir ZTS %endif # Create configuration file @@ -143,10 +139,14 @@ extension=%{pecl_name}.so ;skywalking_agent.ssl_cert_chain_path = ;skywalking_agent.heartbeat_period = 30 ;skywalking_agent.properties_report_period_factor = 10 +;skywalking_agent.enable_zend_observer = 0 +;skywalking_agent.reporter_type = grpc +;skywalking_agent.kafka_bootstrap_servers = +;skywalking_agent.kafka_producer_config = {} EOF : Required rust version -grep -h rust-version mycargo/*/Cargo.toml NTS/Cargo.toml | sort -u | tail -n 8 +grep -h rust-version mycargo/*/Cargo.toml %{sources}/Cargo.toml | sort -u | tail -n 8 %build @@ -154,19 +154,24 @@ grep -h rust-version mycargo/*/Cargo.toml NTS/Cargo.toml | sort -u | tail -n 8 export CARGO_HOME=$PWD/mycargo -cd NTS -%{_bindir}/phpize +cd %{sources} +%{__phpize} + +cd ../NTS +cp -r ../%{sources}/.cargo .cargo %configure \ --enable-skywalking_agent \ - --with-php-config=%{_bindir}/php-config + --enable-kafka-reporter \ + --with-php-config=%{__phpconfig} make %{?_smp_mflags} %if %{with_zts} cd ../ZTS -%{_bindir}/zts-phpize +cp -r ../%{sources}/.cargo .cargo %configure \ --enable-skywalking_agent \ - --with-php-config=%{_bindir}/zts-php-config + --enable-kafka-reporter \ + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} %endif @@ -189,7 +194,7 @@ 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 @@ -233,7 +238,7 @@ OPT="-n -d extension=curl.so -d extension=json.so" %files -%{?_licensedir:%license NTS/LICENSE NTS/dist-material/licenses/LICENSE*} +%{?_licensedir:%license %{sources}/LICENSE %{sources}/dist-material/licenses/LICENSE*} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -247,6 +252,10 @@ OPT="-n -d extension=curl.so -d extension=json.so" %changelog +* Fri Aug 25 2023 Remi Collet <remi@remirepo.net> - 0.6.0-1 +- update to 0.6.0 +- build out of sources tree + * Tue May 9 2023 Remi Collet <remi@remirepo.net> - 0.5.0-1 - update to 0.5.0 |