diff options
author | Remi Collet <remi@remirepo.net> | 2024-10-29 14:57:44 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-10-29 14:57:44 +0100 |
commit | 8e9a184952971e6f9aab3b6eca93e86c56b1d4bd (patch) | |
tree | 4cb2da28699fc136695a93a9bdf346c31a662410 /php-pecl-yac.spec | |
parent | affb10aa25018065c82ffa48ed180332b2766145 (diff) |
Diffstat (limited to 'php-pecl-yac.spec')
-rw-r--r-- | php-pecl-yac.spec | 61 |
1 files changed, 15 insertions, 46 deletions
diff --git a/php-pecl-yac.spec b/php-pecl-yac.spec index 3367713..1aba772 100644 --- a/php-pecl-yac.spec +++ b/php-pecl-yac.spec @@ -3,7 +3,7 @@ # # Fedora spec file for php-pecl-yac (previously php-yac) # -# Copyright (c) 2013-2023 Remi Collet +# Copyright (c) 2013-2024 Remi Collet # License: CC-BY-SA-4.0 # http://creativecommons.org/licenses/by-sa/4.0/ # @@ -21,16 +21,11 @@ %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner laruence %global gh_project yac -#global gh_date 20150908 %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} %global pecl_name yac # after 20-json, 40-igbinary and 40-msgpack %global ini_name 50-%{pecl_name}.ini -%if 0%{?gh_date:1} -%global sources %{gh_project}-%{gh_commit} -%else %global sources %{pecl_name}-%{version} -%endif %global _configure ../%{sources}/configure Summary: Lockless user data cache @@ -38,13 +33,8 @@ Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 2.3.1 License: PHP-3.01 URL: https://pecl.php.net/package/%{pecl_name} -%if 0%{?gh_date:1} -Release: 0.15.%{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}/%{pecl_name}-%{version}-%{gh_short}.tar.gz -%else Release: 7%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} -Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz -%endif +Source0: https://pecl.php.net/get/%{sources}.tgz BuildRequires: make BuildRequires: %{?dtsprefix}gcc @@ -86,13 +76,10 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -qc -%if 0%{?gh_date:1} -mv %{sources}/package.xml . -%endif # Don't install (register) the 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 %{sources} @@ -103,8 +90,8 @@ rm -r compressor/fastlz # Check version as upstream often forget to update this extver=$(sed -n '/#define PHP_YAC_VERSION/{s/.* "//;s/".*$//;p}' php_yac.h) -if test "x${extver}" != "x%{version}%{?prever}%{?gh_date:-dev}"; then - : Error: Upstream YAC version is ${extver}, expecting %{version}%{?prever}%{?gh_date:-dev}. +if test "x${extver}" != "x%{version}%{?prever}"; then + : Error: Upstream YAC version is ${extver}, expecting %{version}%{?prever}. exit 1 fi cd .. @@ -145,16 +132,18 @@ peclconf() { } cd %{sources} -%{_bindir}/phpize +%{__phpize} +[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global +sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL cd ../NTS peclconf %{__phpconfig} -make %{?_smp_mflags} +%make_build %if %{with_zts} cd ../ZTS peclconf %{__ztsphpconfig} -make %{?_smp_mflags} +%make_build %endif @@ -162,15 +151,15 @@ make %{?_smp_mflags} %{?dtsenable} # Install the NTS stuff -make -C NTS install INSTALL_ROOT=%{buildroot} +%make_install -C NTS install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install XML package description install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml -# Install the ZTS stuff %if %{with_zts} -make -C ZTS install INSTALL_ROOT=%{buildroot} +# Install the ZTS stuff +%make_install -C ZTS install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif @@ -188,7 +177,7 @@ OPTS="-n" [ -f %{php_extdir}/msgpack.so ] && OPTS="$OPTS -d extension=msgpack.so" : Minimal load test for NTS extension -%{_bindir}/php $OPTS \ +%{__php} $OPTS \ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ --modules | grep '^%{pecl_name}$' @@ -220,28 +209,8 @@ REPORT_EXIT_STATUS=1 \ %endif -%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 - - %files -%{?_licensedir:%license %{sources}/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml |