summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2018-02-27 14:30:17 +0100
committerRemi Collet <remi@remirepo.net>2018-02-27 14:30:17 +0100
commita27f9ff39cf2dd8cea75549efeaefc4482b9f2e3 (patch)
tree54e93133ce49af54cbf204598de113fe56b33bae
new package
-rw-r--r--.gitignore7
-rw-r--r--Makefile4
-rw-r--r--REFLECTION148
-rw-r--r--php-componere.spec181
4 files changed, 340 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1ab5c4f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..91b0fd5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../common/Makefile
+
diff --git a/REFLECTION b/REFLECTION
new file mode 100644
index 0000000..eae14f3
--- /dev/null
+++ b/REFLECTION
@@ -0,0 +1,148 @@
+Extension [ <persistent> extension #79 componere version 1.3.0 ] {
+
+ - Classes [3] {
+ Class [ <internal:componere> class Componere\Definition ] {
+
+ - Constants [0] {
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [0] {
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [8] {
+ Method [ <internal:componere, ctor> public method __construct ] {
+ }
+
+ Method [ <internal:componere> public method addMethod ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <required> $name ]
+ Parameter #1 [ <required> Componere\Method $method ]
+ }
+ }
+
+ Method [ <internal:componere> public method addTrait ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $trait ]
+ }
+ }
+
+ Method [ <internal:componere> public method addProperty ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <required> $name ]
+ Parameter #1 [ <required> Componere\Value $property ]
+ }
+ }
+
+ Method [ <internal:componere> public method addConstant ] {
+
+ - Parameters [2] {
+ Parameter #0 [ <required> $name ]
+ Parameter #1 [ <required> Componere\Value $property ]
+ }
+ }
+
+ Method [ <internal:componere> public method register ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:componere> public method getClosure ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $name ]
+ }
+ }
+
+ Method [ <internal:componere> public method getClosures ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <optional> $scope ]
+ }
+ }
+ }
+ }
+
+ Class [ <internal:componere> class Componere\Method ] {
+
+ - Constants [0] {
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [0] {
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [3] {
+ Method [ <internal:componere, ctor> public method __construct ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> Closure $closure ]
+ }
+ }
+
+ Method [ <internal:componere> public method setProtected ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:componere> public method setPrivate ] {
+
+ - Parameters [0] {
+ }
+ }
+ }
+ }
+
+ Class [ <internal:componere> class Componere\Value ] {
+
+ - Constants [0] {
+ }
+
+ - Static properties [0] {
+ }
+
+ - Static methods [0] {
+ }
+
+ - Properties [0] {
+ }
+
+ - Methods [3] {
+ Method [ <internal:componere, ctor> public method __construct ] {
+
+ - Parameters [1] {
+ Parameter #0 [ <required> $value ]
+ }
+ }
+
+ Method [ <internal:componere> public method setProtected ] {
+
+ - Parameters [0] {
+ }
+ }
+
+ Method [ <internal:componere> public method setPrivate ] {
+
+ - Parameters [0] {
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/php-componere.spec b/php-componere.spec
new file mode 100644
index 0000000..2e92b38
--- /dev/null
+++ b/php-componere.spec
@@ -0,0 +1,181 @@
+# remirepo spec file for php-componere
+#
+# Copyright (c) 2018 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+
+# we don't want -z defs linker flag
+%undefine _strict_symbol_defs_build
+
+%{?scl: %scl_package php-componere}
+
+%global gh_commit 9653769e4be011f86627461b4ae75f90fc42d324
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner krakjoe
+%global gh_project componere
+#global gh_date 20160608
+%global pecl_name componere
+%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
+%global ini_name 40-%{pecl_name}.ini
+
+Summary: Class composition at runtime
+Name: %{?scl_prefix}php-componere
+Version: 1.3.0
+%if 0%{?gh_date:1}
+Release: 0.3.%{gh_date}git%{gh_short}%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+%else
+Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+%endif
+License: PHP
+URL: https://github.com/%{gh_owner}/%{gh_project}
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
+
+BuildRequires: %{?scl_prefix}php-devel > 7
+BuildRequires: %{?scl_prefix}php-pear
+
+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 "%{?scl_prefix}" != "%{?sub_prefix}"
+Provides: %{?scl_prefix}php-%{pecl_name} = %{version}-%{release}
+Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}-%{release}
+%endif
+
+%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
+Obsoletes: php70u-%{pecl_name} <= %{version}
+Obsoletes: php70w-%{pecl_name} <= %{version}
+%if "%{php_version}" > "7.1"
+Obsoletes: php71u-%{pecl_name} <= %{version}
+Obsoletes: php71w-%{pecl_name} <= %{version}
+%endif
+%if "%{php_version}" > "7.2"
+Obsoletes: php72u-%{pecl_name} <= %{version}
+Obsoletes: php72w-%{pecl_name} <= %{version}
+%endif
+%endif
+
+%if 0%{?fedora} < 20 && 0%{?rhel} < 7
+# Filter shared private
+%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
+%{?filter_setup}
+%endif
+
+
+%description
+This extension allows the composition and re-composition of classes
+at runtime, using dark scary magic, but of the kind you might take
+to production.
+
+Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}.
+
+
+%prep
+%setup -qc
+mv %{gh_project}-%{gh_commit} NTS
+
+cd NTS
+# Sanity check, really often broken
+extver=$(sed -n '/define PHP_COMPONERE_VERSION/{s/.* "//;s/".*$//;p}' php_componere.h)
+if test "x${extver}" != "x%{version}%{?gh_date:-dev}"; then
+ : Error: Upstream extension version is ${extver}, expecting %{version}%{?gh_date:-dev}.
+ exit 1
+fi
+cd ..
+
+%if %{with_zts}
+# duplicate for ZTS build
+cp -pr NTS ZTS
+%endif
+
+# Drop in the bit of configuration
+cat << 'EOF' | tee %{ini_name}
+; Enable '%{summary}' extension module
+extension = %{pecl_name}.so
+EOF
+
+
+%build
+%{?dtsenable}
+
+cd NTS
+%{_bindir}/phpize
+%configure \
+ --with-php-config=%{_bindir}/php-config \
+ --enable-componere
+make %{?_smp_mflags}
+
+%if %{with_zts}
+cd ../ZTS
+%{_bindir}/zts-phpize
+%configure \
+ --with-php-config=%{_bindir}/zts-php-config \
+ --enable-componere
+make %{?_smp_mflags}
+%endif
+
+
+%install
+%{?dtsenable}
+
+# Install the NTS stuff
+make -C NTS install INSTALL_ROOT=%{buildroot}
+install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
+
+%if %{with_zts}
+# Install the ZTS stuff
+make -C ZTS install INSTALL_ROOT=%{buildroot}
+install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
+%endif
+
+
+%check
+cd NTS
+: Minimal load test for NTS extension
+%{__php} --no-php-ini \
+ --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
+ --modules | grep %{pecl_name}
+
+: Upstream test suite for NTS extension
+TEST_PHP_EXECUTABLE=%{__php} \
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__php} -n run-tests.php --show-diff || : ignore
+
+%if %{with_zts}
+cd ../ZTS
+: Minimal load test for ZTS extension
+%{__ztsphp} --no-php-ini \
+ --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
+ --modules | grep %{pecl_name}
+
+: Upstream test suite for ZTS extension
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
+TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__ztsphp} -n run-tests.php --show-diff
+%endif
+
+
+%files
+%{?_licensedir:%license NTS/LICENSE}
+%doc NTS/README.md
+
+%config(noreplace) %{php_inidir}/%{ini_name}
+%{php_extdir}/%{pecl_name}.so
+
+%if %{with_zts}
+%config(noreplace) %{php_ztsinidir}/%{ini_name}
+%{php_ztsextdir}/%{pecl_name}.so
+%endif
+
+
+%changelog
+* Tue Feb 27 2018 Remi Collet <remi@remirepo.net> - 1.3.0-1
+- new package, version 1.3.0 +2 commits:
+ fix build warnings + add LICENSE file