summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-handlebars.spec67
1 files changed, 34 insertions, 33 deletions
diff --git a/php-pecl-handlebars.spec b/php-pecl-handlebars.spec
index 33fb80d..a79b327 100644
--- a/php-pecl-handlebars.spec
+++ b/php-pecl-handlebars.spec
@@ -1,32 +1,31 @@
# remirepo spec file for php-pecl-handlebars
#
-# Copyright (c) 2017-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2017-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%scl_package php-pecl-handlebars
-%endif
+%{?scl:%scl_package php-pecl-handlebars}
-%bcond_without tests
+%bcond_without tests
-%global pecl_name handlebars
-%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global pecl_name handlebars
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
# After 40-psr.ini
-%global ini_name 50-%{pecl_name}.ini
-
+%global ini_name 50-%{pecl_name}.ini
%global upstream_version 1.0.0
#global upstream_prever RC2
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Handlebars templating language
Name: %{?scl_prefix}php-pecl-%{pecl_name}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-License: BSD
+Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: BSD-2-Clause
URL: https://pecl.php.net/package/%{pecl_name}
-Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
+Source0: https://pecl.php.net/get/%{sources}.tgz
Patch0: upstream.patch
@@ -39,7 +38,6 @@ BuildRequires: libtalloc-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}}
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
Recommends: %{?scl_prefix}php-psr%{?_isa}
%endif
@@ -69,14 +67,13 @@ These are the files needed to compile programs using %{name}.
%prep
%setup -q -c
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
# Don't install/register License
%{?_licensedir:sed -e '/LICENSE/s/role="doc"/role="src"/' -i package.xml}
-cd NTS
-%patch0 -p1 -b .up
+cd %{sources}
+%patch -P0 -p1 -b .up
# Honours RPM build options
sed -e '/ LDFLAGS=/d;/ CFLAGS=/d;' -i config.m4
@@ -89,9 +86,9 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_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
@@ -115,26 +112,27 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--enable-handlebars \
--disable-handlebars-psr \
--enable-handlebars-ast \
--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 \
--enable-handlebars \
--disable-handlebars-psr \
--enable-handlebars-ast \
--with-libdir=%{_lib} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -159,10 +157,10 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Test & Documentation
for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
done
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
@@ -187,10 +185,11 @@ fi
%check
+cd %{sources}
+
: Minimal load test for NTS extension
-cd NTS
%{__php} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=../NTS/modules/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%if %{with tests}
@@ -200,21 +199,20 @@ OPT="$OPT %{?_smp_mflags}"
%endif
# Upstream test suite
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php $OPT
%endif
%if %{with_zts}
: Minimal load test for ZTS extension
-cd ../ZTS
%{__ztsphp} --no-php-ini \
- --define extension=modules/%{pecl_name}.so \
+ --define extension=../ZTS/modules/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%if %{with tests}
# Upstream test suite
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__ztsphp} -n run-tests.php $OPT
%endif
@@ -223,7 +221,7 @@ REPORT_EXIT_STATUS=1 \
%files
%{!?_licensedir:%global license %%doc}
-%license NTS/LICENSE.md
+%license %{sources}/LICENSE.md
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -246,6 +244,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 1.0.0-3
+- build out of sources tree
+
* Tue Nov 29 2022 Remi Collet <remi@remirepo.net> - 1.0.0-2
- add upstream patch for https://github.com/jbboehr/php-handlebars/issues/77