summaryrefslogtreecommitdiffstats
path: root/php-pecl-solr2.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-07-19 16:21:29 +0200
committerRemi Collet <remi@php.net>2023-07-19 16:21:29 +0200
commit3a2a625f39f02809fae901200791c93899bbf5c6 (patch)
tree5ad29c1614644ace297ec10c91969c95ce22acd1 /php-pecl-solr2.spec
parent9099cba8e88047d3431ce3fc3c2f844fb90a5a99 (diff)
build out of sources tree
Diffstat (limited to 'php-pecl-solr2.spec')
-rw-r--r--php-pecl-solr2.spec61
1 files changed, 34 insertions, 27 deletions
diff --git a/php-pecl-solr2.spec b/php-pecl-solr2.spec
index 986524d..d069987 100644
--- a/php-pecl-solr2.spec
+++ b/php-pecl-solr2.spec
@@ -10,26 +10,28 @@
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-solr2
-%endif
+%{?scl:%scl_package php-pecl-solr2}
-%global pecl_name solr
-#global prever b
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name solr
+#global prever b
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
# After 20-curl, 40-json
-%global ini_name 50-%{pecl_name}.ini
-# For full test (using localhost server) use --with tests
+%global ini_name 50-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}%{?prever}
+%global _configure ../%{sources}/configure
+
+# For full test (using localhost server) use --with fulltests
# retrieve: docker pull omars/solr53
# create: docker run -d -p 8983:8983 --name solr5 -t omars/solr53
# cleanup: docker stop solr5 && docker rm solr5
-%bcond_with tests
+%bcond_without tests
+%bcond_with fulltests
Summary: Object oriented API to Apache Solr
Summary(fr): API orientée objet pour Apache Solr
Name: %{?scl_prefix}php-pecl-solr2
Version: 2.6.0
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: PHP
Group: Development/Languages
URL: https://pecl.php.net/package/solr
@@ -50,7 +52,6 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-curl%{?_isa}
Requires: %{?scl_prefix}php-json%{?_isa}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -94,9 +95,7 @@ sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-mv %{pecl_name}-%{version}%{?prever} NTS
-
-cd NTS
+cd %{sources}
: Check version
DIR=src/php7
extver=$(sed -n '/#define PHP_SOLR_VERSION /{s/.* "//;s/".*$//;p}' $DIR/php_solr_version.h)
@@ -113,23 +112,25 @@ cat > %{ini_name} << 'EOF'
extension=%{pecl_name}.so
EOF
+mkdir NTS
%if %{with_zts}
-cp -r NTS ZTS
+mkdir ZTS
%endif
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+%configure --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -153,7 +154,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
@@ -178,13 +179,14 @@ fi
%check
-%if %{with tests}
+cd %{sources}
+%if %{with fulltests}
sed -e '/SOLR_SERVER_CONFIGURED/s/false/true/' \
-e '/SOLR_SERVER_HOSTNAME/s/solr.test/localhost/' \
- -i ?TS/tests/test.config.inc
+ -i tests/test.config.inc
%else
sed -e '/SOLR_SERVER_CONFIGURED/s/true/false/' \
- -i ?TS/tests/test.config.inc
+ -i tests/test.config.inc
%endif
@@ -202,12 +204,13 @@ OPT="$OPT -d error_reporting=24575"
-d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
-m | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for NTS extension
-cd NTS
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="$OPT -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php -q --show-diff
+%endif
%if %{with_zts}
: Minimal load test for ZTS installed extension
@@ -215,17 +218,18 @@ REPORT_EXIT_STATUS=1 \
-d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
-m | grep '^%{pecl_name}$'
+%if %{with tests}
: Upstream test suite for ZTS extension
-cd ../ZTS
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="$OPT -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php -q --show-diff
%endif
+%endif
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -239,6 +243,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Wed Jul 19 2023 Remi Collet <remi@remirepo.net> - 2.6.0-2
+- build out of sources tree
+
* Wed Nov 9 2022 Remi Collet <remi@remirepo.net> - 2.6.0-1
- update to 2.6.0
- drop patch merged upstream