summaryrefslogtreecommitdiffstats
path: root/php-pecl-ssh2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2022-06-26 18:16:55 +0200
committerRemi Collet <remi@php.net>2022-06-26 18:16:55 +0200
commit5f7f7c3a0a06d00eda99e635cb29dda42d2c86ad (patch)
tree9072c45d707725a7935caeba01267337e969286a /php-pecl-ssh2.spec
parent885e1b11ec377d6f15eca8d184173e772857a69e (diff)
rebuild againt remi-libssh2 on EL-7 and EL-8
Diffstat (limited to 'php-pecl-ssh2.spec')
-rw-r--r--php-pecl-ssh2.spec45
1 files changed, 38 insertions, 7 deletions
diff --git a/php-pecl-ssh2.spec b/php-pecl-ssh2.spec
index 793c44c..098d168 100644
--- a/php-pecl-ssh2.spec
+++ b/php-pecl-ssh2.spec
@@ -1,7 +1,7 @@
# remirepo spec file for php-pecl-ssh2
# with SCL compatibility
#
-# Copyright (c) 2011-2021 Remi Collet
+# Copyright (c) 2011-2022 Remi Collet
#
# Fedora spec file for php-pecl-ssh2
#
@@ -32,7 +32,7 @@ Version: 1.3.1
Release: 0.9.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}%{?prever}-%{gh_short}.tar.gz
%else
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
%endif
@@ -40,14 +40,25 @@ License: PHP
URL: https://pecl.php.net/package/%{pecl_name}
BuildRequires: make
-BuildRequires: libssh2-devel >= 1.2
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
+%if 0%{?vendeur:1} && 0%{?fedora} < 35 && 0%{?rhel} < 9
+%global move_to_opt 1
+BuildRequires: %{vendeur}-libssh2-devel >= 1.10
+Requires: %{vendeur}-libssh2%{?_isa} >= 1.10
+# Disable RPATH check
+%global __arch_install_post /bin/true
+%global __brp_check_rpaths /bin/true
+%else
+%global move_to_opt 0
+BuildRequires: libssh2-devel >= 1.10
+Requires: libssh2%{?_isa} >= %{buildver}
+%endif
+
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-Requires: libssh2%{?_isa} >= %{buildver}
%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
@@ -82,6 +93,11 @@ Obsoletes: php81-pecl-%{pecl_name} <= %{version}
%endif
%endif
+%if %{move_to_opt}
+%{?filter_requires_in: %filter_requires_in %{_libdir}/.*\.so$}
+%endif
+%{?filter_setup}
+
%description
Bindings to the libssh2 library which provide access to resources
@@ -114,6 +130,9 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd NTS
+: fix lib usage
+sed -e 's:SSH2_DIR/lib:SSH2_DIR/$PHP_LIBDIR:' -i config.m4
+
extver=$(sed -n '/#define PHP_SSH2_VERSION/{s/.*\t"//;s/".*$//;p}' php_ssh2.h)
if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
: Error: Upstream version is now ${extver}, expecting %{version}%{?gh_date:-dev}.
@@ -135,16 +154,25 @@ cp -pr NTS ZTS
%build
%{?dtsenable}
-
cd NTS
%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+%configure \
+%if %{move_to_opt}
+ --with-ssh2=/opt/%{vendeur}/libssh2 \
+%endif
+ --with-libdir=%{_lib} \
+ --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure \
+%if %{move_to_opt}
+ --with-ssh2=/opt/%{vendeur}/libssh2 \
+%endif
+ --with-libdir=%{_lib} \
+ --with-php-config=%{_bindir}/zts-php-config
make %{?_smp_mflags}
%endif
@@ -226,6 +254,9 @@ fi
%changelog
+* Sun Jun 26 2022 Remi Collet <remi@remirepo.net> - 1.3.1-3
+- rebuild againt remi-libssh2 on EL-7 and EL-8
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 1.3.1-2
- rebuild for 8.1.0RC1