summaryrefslogtreecommitdiffstats
path: root/php-pecl-simple-kafka-client.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-simple-kafka-client.spec')
-rw-r--r--php-pecl-simple-kafka-client.spec74
1 files changed, 48 insertions, 26 deletions
diff --git a/php-pecl-simple-kafka-client.spec b/php-pecl-simple-kafka-client.spec
index 095ee39..e525efd 100644
--- a/php-pecl-simple-kafka-client.spec
+++ b/php-pecl-simple-kafka-client.spec
@@ -1,14 +1,27 @@
# remirepo/fedora spec file for php-pecl-simple-kafka-client
#
-# Copyright (c) 2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2021-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
+
+# use library installed in /opt
+%bcond_without move_to_opt
+
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-rdkafka
+%scl_package php-pecl-simple-kafka-client
+%endif
+
+%if %{with move_to_opt}
+# Disable RPATH check
+%global __arch_install_post /bin/true
+%global __brp_check_rpaths /bin/true
+
+%global buildver %(PKG_CONFIG_PATH=/opt/%{?vendeur:%{vendeur}/}librdkafka/%{_lib}/pkgconfig pkg-config --silence-errors --modversion rdkafka 2>/dev/null || echo 65536)
+%else
+%global buildver %(pkg-config --silence-errors --modversion rdkafka 2>/dev/null || echo 65536)
%endif
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
@@ -16,49 +29,40 @@
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
%global ini_name 40-%{pecl_name}.ini
-%global buildver %(pkg-config --silence-errors --modversion rdkafka 2>/dev/null || echo 65536)
Summary: Kafka client based on librdkafka
-Name: %{?sub_prefix}php-pecl-simple-kafka-client
+Name: %{?scl_prefix}php-pecl-simple-kafka-client
Version: 0.1.4
-Release: 3%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: BSD
+Release: 4%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+License: BSD-3-Clause
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: librdkafka1php-devel >= 1.7
+
+%if %{with move_to_opt}
+BuildRequires: %{?vendeur:%{vendeur}-}librdkafka-devel >= 2
+Requires: %{?vendeur:%{vendeur}-}librdkafka%{?_isa} >= %{buildver}
+%else
+BuildRequires: librdkafka-devel >= 1.4
+%endif
BuildRequires: %{?scl_prefix}php-devel >= 7.3
BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
-Requires: librdkafka1php%{?_isa} >= %{buildver}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-%{pecl_name} <= %{version}
-%endif
+%if %{with move_to_opt}
+%{?filter_requires_in: %filter_requires_in %{_libdir}/.*\.so$}
%endif
+%{?filter_setup}
%description
@@ -100,11 +104,21 @@ EOF
%build
%{?dtsenable}
+%if %{with move_to_opt}
+# not yet used
+export PKG_CONFIG_PATH=/opt/%{?vendeur:%{vendeur}/}librdkafka/%{_lib}/pkgconfig
+%endif
+
cd NTS
%{_bindir}/phpize
%configure \
--with-php-config=%{_bindir}/php-config \
+ --with-libdir=%{_lib} \
+%if %{with move_to_opt}
+ --with-simple-kafka-client=/opt/%{?vendeur:%{vendeur}/}librdkafka
+%else
--with-simple-kafka-client
+%endif
make %{?_smp_mflags}
%if %{with_zts}
@@ -112,7 +126,12 @@ cd ../ZTS
%{_bindir}/zts-phpize
%configure \
--with-php-config=%{_bindir}/zts-php-config \
+ --with-libdir=%{_lib} \
+%if %{with move_to_opt}
+ --with-simple-kafka-client=/opt/%{?vendeur:%{vendeur}/}librdkafka
+%else
--with-simple-kafka-client
+%endif
make %{?_smp_mflags}
%endif
@@ -197,6 +216,9 @@ cd ../ZTS
%changelog
+* Thu Jan 19 2023 Remi Collet <remi@remirepo.net> - 0.1.4-4
+- rebuild using remi-librdkafka 2.0.1
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 0.1.4-3
- rebuild for 8.1.0RC1