summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-09-01 10:25:03 +0200
committerRemi Collet <remi@php.net>2023-09-01 10:25:03 +0200
commit9f6d6109f1a508e4c0c02a695d56a123da8c93d3 (patch)
tree61d93946458b4bab711cd8c8c08a96f67e0f85b6
parentb500389883551cb6e09dc11c07295eb270570641 (diff)
build out of sources treeHEADmaster
-rw-r--r--php-pecl-leveldb.spec63
1 files changed, 34 insertions, 29 deletions
diff --git a/php-pecl-leveldb.spec b/php-pecl-leveldb.spec
index 568eceb..f9bec60 100644
--- a/php-pecl-leveldb.spec
+++ b/php-pecl-leveldb.spec
@@ -1,28 +1,29 @@
# remirepo spec file for php-pecl-leveldb
#
-# Copyright (c) 2013-2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2013-2023 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-leveldb}
-%{?scl: %scl_package php-pecl-ssdeep}
+%bcond_without tests
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
-%global pecl_name leveldb
-%global ini_name 40-%{pecl_name}.ini
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name leveldb
+%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: LevelDB PHP bindings
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: 0.3.0
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
-License: BSD
+Release: 2%{?dist}%{!?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/%{pecl_name}-%{version}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
@@ -32,7 +33,6 @@ BuildRequires: leveldb-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}
@@ -63,14 +63,13 @@ 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"/' } \
-i package.xml
-cd NTS
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_LEVELDB_VERSION/{s/.* "//;s/".*$//;p}' php_leveldb.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
@@ -79,9 +78,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
@@ -94,19 +93,20 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -129,7 +129,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# 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
@@ -154,41 +154,43 @@ fi
%check
+cd %{sources}
# ignore test suite output for now, see:
# https://github.com/reeze/php-leveldb/issues/36 raise assert in test suite
# https://bugzilla.redhat.com/1881369 leveldb is a debug build
: Minimal load test for NTS extension
-cd NTS
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="-n -d extension_dir=$PWD/../NTS/modules -d extension=%{pecl_name}.so" \
REPORT_EXIT_STATUS=0 \
-%{__php} -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
+%endif
%if %{with_zts}
: Minimal load test for ZTS extension
-cd ../ZTS
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for ZTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension_dir=$PWD/../ZTS/modules -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=0 \
%{__ztsphp} -n run-tests.php --show-diff
%endif
+%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -202,6 +204,9 @@ REPORT_EXIT_STATUS=0 \
%changelog
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 0.3.0-2
+- build out of sources tree
+
* Thu Feb 18 2021 Remi Collet <remi@remirepo.net> - 0.3.0-1
- update to 0.3.0
- drop patches merged upstream