summaryrefslogtreecommitdiffstats
path: root/zephir.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-11-19 16:24:19 +0100
committerRemi Collet <remi@remirepo.net>2018-11-19 16:24:19 +0100
commitdcef13ee1e4e097043565e7e7ec7f8d04269ff94 (patch)
tree461dc1e5ba7aaea7a1303e768450449f6804de71 /zephir.spec
parent4d2e0024a4ccff815dce711c57dd1365b4c1179e (diff)
update to 0.11.4
raise minimal PHP version to 5.6 add dependency on league/container 2.4 add dependency on league/flysystem 1.0 add dependency on symfony/console 3.4
Diffstat (limited to 'zephir.spec')
-rw-r--r--zephir.spec127
1 files changed, 103 insertions, 24 deletions
diff --git a/zephir.spec b/zephir.spec
index 3b7c8fe..2557a16 100644
--- a/zephir.spec
+++ b/zephir.spec
@@ -21,7 +21,7 @@
# Get commit from PHP_PHALCON_ZEPVERSION in
# https://github.com/phalcon/cphalcon/blob/master/ext/php_phalcon.h
-%global gh_commit ab3551da612b837cbeb2dc228052a6d35bec5778
+%global gh_commit d0a6a8af0b78240a0f3e1f05d39baf73699a5570
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
#global gh_date 20161126
%global gh_owner phalcon
@@ -30,7 +30,7 @@
%global parser_ver 1.1.1
Name: %{?scl_prefix}%{gh_project}
-Version: 0.11.1
+Version: 0.11.4
Release: 1%{?gh_date:.%{gh_date}.%{gh_short}}%{?dist}
Summary: Zephir language for creation of extensions for PHP.
@@ -43,46 +43,71 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit
Patch0: %{gh_project}-rpm.patch
BuildArch: noarch
-BuildRequires: %{?scl_prefix}php-devel > 5.5
+BuildRequires: %{?scl_prefix}php-devel > 5.6
BuildRequires: %{?scl_prefix}php-zephir-parser >= %{parser_ver}
%if %{with_tests}
BuildRequires: %{?scl_prefix}php-json
BuildRequires: %{?scl_prefix}php-hash
BuildRequires: %{?scl_prefix}php-ctype
+BuildRequires: %{?scl_prefix}php-psr
+BuildRequires: %{_bindir}/phpab
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(league/container) >= 2.4 with php-composer(league/container) < 3)
+BuildRequires: (php-composer(league/flysystem) >= 1.0 with php-composer(league/flysystem) < 1.1)
+BuildRequires: (php-composer(symfony/console) >= 3.4 with php-composer(symfony/console) < 4)
+%else
+BuildRequires: php-league-flysystem
+BuildRequires: php-league-container
+BuildRequires: php-symfony3-console
+%endif
# From composer.json, "require-dev"
# "ext-gmp": "*",
# "ext-pdo": "*",
# "ext-pdo_sqlite": "*",
-# "phpunit/phpunit": "^4.8 || ^5.7,
-# "squizlabs/php_codesniffer": "^3.2"
+# "phpunit/phpunit": "~5.7",
+# "squizlabs/php_codesniffer": "~3.2"
BuildRequires: %{?scl_prefix}php-gmp
BuildRequires: %{?scl_prefix}php-pdo
BuildRequires: %{?scl_prefix}php-pdo_sqlite
-BuildRequires: %{?scl_prefix}php-composer(phpunit/phpunit) >= 4.8
+BuildRequires: %{?scl_prefix}php-composer(phpunit/phpunit) >= 5.7
%endif
Requires: %{?scl_prefix}php-cli
Requires: %{?scl_prefix}php-zephir-parser >= %{parser_ver}
# From composer.json, "require"
-# "php": ">=5.5",
+# "php": ">=5.6.0 <8.0",
+# "ext-SPL": "*",
# "ext-ctype": "*",
# "ext-hash": "*",
# "ext-json": "*",
+# "ext-mbstring": "*",
+# "ext-pcre": "*",
# "ext-xml": "*"
-# "ext-mbstring": "*"
-Requires: %{?scl_prefix}php(language) >= 5.5
+# "league/container": "^2.4 || ^3.2",
+# "league/flysystem": "1.0.*",
+# "symfony/console": "3.4.*"
+Requires: %{?scl_prefix}php(language) >= 5.6
+Requires: %{?scl_prefix}php-spl
Requires: %{?scl_prefix}php-ctype
Requires: %{?scl_prefix}php-hash
Requires: %{?scl_prefix}php-json
-Requires: %{?scl_prefix}php-xml
Requires: %{?scl_prefix}php-mbstring
+Requires: %{?scl_prefix}php-pcre
+Requires: %{?scl_prefix}php-xml
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(league/container) >= 2.4 with php-composer(league/container) < 3)
+Requires: (php-composer(league/flysystem) >= 1.0 with php-composer(league/flysystem) < 1.1)
+Requires: (php-composer(symfony/console) >= 3.4 with php-composer(symfony/console) < 4)
+%else
+Requires: php-league-flysystem
+Requires: php-league-container
+Requires: php-symfony3-console
+%endif
# From phpcompatinfo
Requires: %{?scl_prefix}php-reflection
Requires: %{?scl_prefix}php-date
Requires: %{?scl_prefix}php-gmp
-Requires: %{?scl_prefix}php-pcre
Requires: %{?scl_prefix}php-pdo
-Requires: %{?scl_prefix}php-spl
Provides: %{?scl_prefix}php-composer(%{gh_owner}/%{gh_project}) = %{version}
@@ -111,14 +136,43 @@ Compiler design goals:
%setup -q -n %{gh_project}-%{gh_commit}
%patch0 -p0 -b .rpm
+
sed -e 's:@DATADIR@:%{_datadir}:;s:@BINDIR@:%{_bindir}:' \
- -i bin/%{gh_project}
+ -i %{gh_project}
+
+sed -e 's/\$Id\$/%{gh_short}/' \
+ -e 's/0.11.5/0.11.4/' \
+ -i Library/Zephir.php
find . -name \*.php -exec chmod -x {} \;
+cat << 'EOF' >autoload.php
+<?php
+/* Autoloader for %{name} and its dependencies */
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('Zephir\\', __DIR__ . '/Library');
+\Fedora\Autoloader\Dependencies::required([
+ __DIR__ . '/Library/functions.php',
+ '%{_datadir}/php/Symfony3/Component/Console/autoload.php',
+ '%{_datadir}/php/League/Flysystem/autoload.php',
+ '%{_datadir}/php/League/Container/autoload.php',
+]);
+EOF
+
+mv %{gh_project} %{gh_project}.php
+cat << 'EOF' | tee zephir.sh
+#!/bin/sh
+%{_bindir}/php -d memory_limit=2G -d extension=zephir_parser.so %{_datadir}/%{gh_project}/%{gh_project}.php $*
+
%build
-# nothing
+: test extension
+cd ext
+%{_bindir}/phpize
+%configure
+make %{?_smp_mflags}
+
%install
@@ -130,23 +184,41 @@ do
done
: Command
-install -Dpm 755 bin/%{gh_project} %{buildroot}%{_bindir}/%{gh_project}
+install -Dpm 755 %{gh_project}.sh %{buildroot}%{_bindir}/%{gh_project}
%check
-sed -e 's:%ZEPHIRDIR%:%{buildroot}%{_datadir}/%{gh_project}:g' \
- -e 's: php:%{_bindir}/php:' \
- bin/%{gh_project}.rpm > bin/%{gh_project}.test
-sh ./bin/%{gh_project}.test version
-sh ./bin/%{gh_project}.test version | grep %{version}
+sed -e 's:%{_datadir}:%{buildroot}%{_datadir}:' \
+ %{gh_project}.php > %{gh_project}.test
+%{_bindir}/php %{gh_project}.test --version
+%{_bindir}/php %{gh_project}.test --version | grep %{version}-%{gh_short}
+
+%{_bindir}/php %{_bindir}/phpab -o bs.php unit-tests/fixtures/mocks
+cat << 'EOF' | tee -a bs.php
+require '%{buildroot}%{_datadir}/%{gh_project}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('Zephir\\Test\\', __DIR__ . '/unit-tests/Zephir/Test/');
+\Fedora\Autoloader\Autoload::addPsr4('Zephir\\Support\\', __DIR__ . '/unit-tests/Zephir/Support/');
+\Fedora\Autoloader\Autoload::addPsr4('Extension\\', __DIR__ . '/unit-tests/Extension/');
+require __DIR__ . '/unit-tests/bootstrap.php';
+EOF
%if %{with_tests}
: Run test suite
-%{_bindir}/php -d extension=zephir_parser.so \
- %{_bindir}/phpunit \
- --bootstrap %{buildroot}%{_datadir}/%{gh_project}/bootstrap.php \
- --verbose unit-tests/Zephir
+%{_bindir}/php \
+ -d extension=zephir_parser.so \
+ -d extension=ext/modules/test.so \
+ %{_bindir}/phpunit \
+ --bootstrap bs.php \
+ --no-coverage \
+ --verbose unit-tests/Zephir
+%{_bindir}/php \
+ -d extension=zephir_parser.so \
+ -d extension=ext/modules/test.so \
+ %{_bindir}/phpunit \
+ --bootstrap bs.php \
+ --no-coverage \
+ --verbose unit-tests/Extension
%else
: Test suite disabled
%endif
@@ -162,6 +234,13 @@ sh ./bin/%{gh_project}.test version | grep %{version}
%changelog
+* Mon Nov 19 2018 Remi Collet <remi@remirepo.net> - 0.11.4-1
+- update to 0.11.4
+- raise minimal PHP version to 5.6
+- add dependency on league/container 2.4
+- add dependency on league/flysystem 1.0
+- add dependency on symfony/console 3.4
+
* Sat Oct 20 2018 Remi Collet <remi@remirepo.net> - 0.11.1-1
- update to 0.11.1