summaryrefslogtreecommitdiffstats
path: root/php-pecl-crypto.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-crypto.spec')
-rw-r--r--php-pecl-crypto.spec187
1 files changed, 69 insertions, 118 deletions
diff --git a/php-pecl-crypto.spec b/php-pecl-crypto.spec
index ba29450..d775069 100644
--- a/php-pecl-crypto.spec
+++ b/php-pecl-crypto.spec
@@ -1,93 +1,50 @@
# remirepo spec file for php-pecl-crypto
#
-# Copyright (c) 2013-2018 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2013-2024 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
+%{?scl:%scl_package php-pecl-crypto}
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-crypto
-%endif
-
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global pecl_name crypto
-%global with_tests 0%{!?_without_tests:1}
+%bcond_without tests
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name crypto
%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
+%global ini_name %{pecl_name}.ini
%else
-%global ini_name 40-%{pecl_name}.ini
+%global ini_name 40-%{pecl_name}.ini
%endif
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: Wrapper for OpenSSL Crypto Library
-Name: %{?sub_prefix}php-pecl-%{pecl_name}
-Version: 0.3.1
-Release: 8%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-License: BSD
-URL: http://pecl.php.net/package/%{pecl_name}
-Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
+Name: %{?scl_prefix}php-pecl-%{pecl_name}
+Version: 0.3.2
+Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: PHP-3.01
+URL: https://pecl.php.net/package/%{pecl_name}
+Source0: https://pecl.php.net/get/%{sources}.tgz
+Patch0: 0001-Fix-Wincompatible-pointer-types.patch
+Patch1: 0001-fix-for-PHP-8.4.patch
+
+BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: %{?scl_prefix}php-devel > 5.3
+BuildRequires: %{?scl_prefix}php-devel
BuildRequires: %{?scl_prefix}php-pear
# don't use pkg-config to avoid compat-openssl10
BuildRequires: openssl-devel
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}
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 "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-Obsoletes: php53-pecl-%{pecl_name} <= %{version}
-Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php54-pecl-%{pecl_name} <= %{version}
-Obsoletes: php54w-pecl-%{pecl_name} <= %{version}
-%if "%{php_version}" > "5.5"
-Obsoletes: php55u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "5.6"
-Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.0"
-Obsoletes: php70u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php70w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.1"
-Obsoletes: php71u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php71w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.2"
-Obsoletes: php72u-pecl-%{pecl_name} <= %{version}
-Obsoletes: php72w-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
-%endif
-%endif
-
-%if 0%{?fedora} < 20 && 0%{?rhel} < 7
-# Filter shared private
-%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
-%{?filter_setup}
-%endif
%description
@@ -98,14 +55,15 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-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
-cd NTS
+cd %{sources}
+%patch -P0 -p1
+%patch -P1 -p1
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_CRYPTO_VERSION/{s/.* "//;s/".*$//;p}' php_crypto.h)
@@ -115,9 +73,9 @@ if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -130,27 +88,32 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
+
+cd ../NTS
%configure \
--with-crypto \
- --with-php-config=%{_bindir}/php-config
-make %{?_smp_mflags}
+ --with-php-config=%{__phpconfig}
+
+%make_build
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--with-crypto \
- --with-php-config=%{_bindir}/zts-php-config
-make %{?_smp_mflags}
+ --with-php-config=%{__ztsphpconfig}
+
+%make_build
%endif
%install
%{?dtsenable}
-make -C NTS install INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# install config file
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -159,80 +122,51 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make -C ZTS install INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
-%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
-%if 0%{?fedora} >= 29 || 0%{?rhel} >= 8
-: Ignore tests broken by new algo
-rm ?TS/tests/Cipher_getAlgorithms_all_basic.phpt
-rm ?TS/tests/Cipher_getAlgorithms_ccm_basic.phpt
-rm ?TS/tests/Hash_getAlgorithms_basic.phpt
-%endif
+cd %{sources}
-cd NTS
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
-%if %{with_tests}
+%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
%endif
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}//%{pecl_name}.so \
- --modules | grep %{pecl_name}
+ --modules | grep '^%{pecl_name}$'
-%if %{with_tests}
+%if %{with tests}
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="-n -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
+%license %{sources}/LICENSE
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
@@ -246,6 +180,23 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Wed Sep 25 2024 Remi Collet <remi@remirepo.net> - 0.3.2-4
+- fix build with PHP 8.4 using patch from
+ https://github.com/bukka/php-crypto/pull/42
+
+* Fri Feb 16 2024 Remi Collet <remi@remirepo.net> - 0.3.2-3
+- fix [-Wincompatible-pointer-types] using patch from
+ https://github.com/bukka/php-crypto/pull/40
+
+* Thu Aug 31 2023 Remi Collet <remi@remirepo.net> - 0.3.2-2
+- build out of sources tree
+
+* Mon Mar 8 2021 Remi Collet <remi@remirepo.net> - 0.3.2-1
+- update to 0.3.2
+
+* Tue Sep 03 2019 Remi Collet <remi@remirepo.net> - 0.3.1-9
+- rebuild for 7.4.0RC1
+
* Tue Jul 23 2019 Remi Collet <remi@remirepo.net> - 0.3.1-8
- rebuild for 7.4.0beta1