summaryrefslogtreecommitdiffstats
path: root/php-phalcon4.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2020-01-13 08:53:35 +0100
committerRemi Collet <remi@remirepo.net>2020-01-13 08:53:35 +0100
commit5c4ca5de4cd5dcebb63d17a5cea18ce182e310a2 (patch)
tree04bb3ac48ada7ca18f55a0dcd2b7510c8be46568 /php-phalcon4.spec
parentfbcb5eaff9d97d4093449ccea082f6ed5c2c9c8d (diff)
update to 4.0.2
sources from pecl
Diffstat (limited to 'php-phalcon4.spec')
-rw-r--r--php-phalcon4.spec116
1 files changed, 74 insertions, 42 deletions
diff --git a/php-phalcon4.spec b/php-phalcon4.spec
index f6f9047..aade475 100644
--- a/php-phalcon4.spec
+++ b/php-phalcon4.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-phalcon4
#
-# Copyright (c) 2014-2019 Remi Collet
+# Copyright (c) 2014-2020 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -23,12 +23,12 @@
%global gh_project cphalcon
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global with_tests 0%{?_with_tests:1}
-%global ext_name phalcon
+%global pecl_name phalcon
# See ext/php_phalcon.h
-#global zephir_ver 0.12.10
+#global zephir_ver 0.12.15
# after 40-json.ini, 20-pdo.ini, 40-psr.ini
-%global ini_name 50-%{ext_name}.ini
-%global upstream_ver 4.0.0
+%global ini_name 50-%{pecl_name}.ini
+%global upstream_ver 4.0.2
#global upstream_pre rc.3
Name: %{?sub_prefix}php-phalcon4
@@ -37,11 +37,12 @@ Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_
Summary: Phalcon Framework
License: MIT
-URL: https://github.com/%{gh_owner}/%{gh_project}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{upstream_ver}%{?upstream_pre:-%{upstream_pre}}-%{gh_short}.tar.gz
+URL: https://pecl.php.net/package/phalcon
+Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
BuildRequires: %{?dtsprefix}gcc
BuildRequires: %{?scl_prefix}php-devel > 7.2
+BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-hash
BuildRequires: %{?scl_prefix}php-json
BuildRequires: %{?scl_prefix}php-pdo
@@ -86,6 +87,11 @@ Conflicts: %{?scl_prefix}php-phalcon < 4
Conflicts: %{?scl_prefix}php-phalcon2 < 4
Conflicts: %{?scl_prefix}php-phalcon3 < 4
%endif
+# PECL
+Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
+Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
# Don't provides php-composer(phalcon/cphalcon), not registered on packagist
@@ -106,19 +112,28 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
-%setup -q -n %{gh_project}-%{gh_commit}
+%setup -qc
+mv %{pecl_name}-%{version}%{?upstream_pre} NTS
+
+cd NTS
# Sanity check, really often broken
-extver=$(sed -n '/#define PHP_PHALCON_VERSION/{s/.* "//;s/".*$//;p}' ext/php_phalcon.h)
+extver=$(sed -n '/#define PHP_PHALCON_VERSION/{s/.* "//;s/".*$//;p}' php_phalcon.h)
if test "x${extver}" != "x%{upstream_ver}%{?upstream_pre:-%{upstream_pre}}"; then
: Error: Upstream extension version is ${extver}, expecting %{upstream_ver}%{?upstream_pre:-%{upstream_pre}}.
exit 1
fi
+cd ..
+
+%if %{with_zts}
+# duplicate for ZTS build
+cp -pr NTS ZTS
+%endif
# Create configuration file
cat << 'EOF' | tee %{ini_name}
; Enable '%{summary}' extension module
-extension=%{ext_name}.so
+extension=%{pecl_name}.so
; Configuration
;phalcon.db.escape_identifiers = On
@@ -142,7 +157,7 @@ extension=%{ext_name}.so
EOF
: Check Zephir version
-grep PHP_PHALCON_ZEPVERSION ext/php_phalcon.h
+grep PHP_PHALCON_ZEPVERSION NTS/php_phalcon.h
%build
@@ -155,23 +170,8 @@ peclconf() {
--with-php-config=$1
}
-: Generate the SAFE sources - optimization seems no more needed
-
-%if 0%{?zephir_ver:1}
-%{_bindir}/zephir clean
-%{_bindir}/zephir fullclean
-%{_bindir}/zephir generate
-%endif
-%{__php} build/gen-build.php
-mv build/php7/safe build/NTS
-
-%if %{with_zts}
-: Duplicate source tree for NTS / ZTS build
-cp -r build/NTS build/ZTS
-%endif
-
: Build NTS extension
-cd build/NTS
+cd NTS
%{_bindir}/phpize
peclconf %{_bindir}/php-config
make %{?_smp_mflags}
@@ -188,16 +188,24 @@ make %{?_smp_mflags}
%install
%{?dtsenable}
-make -C build/NTS install INSTALL_ROOT=%{buildroot}
+# Install XML package description
+install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
-# install config file
+# Install the NTS stuff
+make -C NTS install INSTALL_ROOT=%{buildroot}
install -Dpm644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
%if %{with_zts}
-make -C build/ZTS install INSTALL_ROOT=%{buildroot}
+# Install the ZTS stuff
+make -C ZTS install INSTALL_ROOT=%{buildroot}
install -Dpm644 %{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
+done
+
%check
# Shared needed extensions
@@ -211,15 +219,15 @@ done
: Minimal load test for NTS extension
%{__php} --no-php-ini \
$modules \
- --define extension=%{buildroot}%{php_extdir}/%{ext_name}.so \
- --modules | grep -i %{ext_name}
+ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
+ --modules | grep -i %{pecl_name}
%if %{with_tests}
: Upstream test suite NTS extension
cd build/NTS
SKIP_ONLINE_TESTS=1 \
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{ext_name}.so" \
+TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php --show-diff
@@ -229,28 +237,52 @@ REPORT_EXIT_STATUS=1 \
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
$modules \
- --define extension=%{buildroot}%{php_ztsextdir}/%{ext_name}.so \
- --modules | grep -i %{ext_name}
+ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
+ --modules | grep -i %{pecl_name}
+%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:%global license %%doc}
-%license LICENSE*.txt
-%doc *.md
+%{?_licensedir:%license NTS/LICENSE.txt}
+%doc %{pecl_docdir}/%{pecl_name}
+%{pecl_xmldir}/%{name}.xml
%config(noreplace) %{php_inidir}/%{ini_name}
-%{php_extdir}/%{ext_name}.so
-%exclude %{php_incldir}/ext/%{ext_name}/php_phalcon.h
+%{php_extdir}/%{pecl_name}.so
+%exclude %{php_incldir}/ext/%{pecl_name}/php_phalcon.h
%if %{with_zts}
%config(noreplace) %{php_ztsinidir}/%{ini_name}
-%{php_ztsextdir}/%{ext_name}.so
-%exclude %{php_ztsincldir}/ext/%{ext_name}/php_phalcon.h
+%{php_ztsextdir}/%{pecl_name}.so
+%exclude %{php_ztsincldir}/ext/%{pecl_name}/php_phalcon.h
%endif
%changelog
+* Mon Jan 13 2020 Remi Collet <remi@remirepo.net> - 4.0.2-1
+- update to 4.0.2
+- sources from pecl
+
* Sun Dec 22 2019 Remi Collet <remi@remirepo.net> - 4.0.0-1
- update to 4.0.0