summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-12-06 09:14:13 +0100
committerRemi Collet <remi@php.net>2021-12-06 09:14:13 +0100
commitfe516daf90e60f686781254c4c341253e46d4b82 (patch)
tree655e1e492b91d070b95372bf762f717aa6a88c43
parentb40eb45cde8d610d0544412f2b4b7ba61f4f1095 (diff)
disable test suite on EL
add autoloader from sources on EL
-rw-r--r--autoloader.php84
-rw-r--r--php-zetacomponents-console-tools.spec32
2 files changed, 109 insertions, 7 deletions
diff --git a/autoloader.php b/autoloader.php
new file mode 100644
index 0000000..0df803d
--- /dev/null
+++ b/autoloader.php
@@ -0,0 +1,84 @@
+<?php
+// @codingStandardsIgnoreFile
+// @codeCoverageIgnoreStart
+// this is an autogenerated file - do not edit
+spl_autoload_register(
+ function($class) {
+ static $classes = null;
+ if ($classes === null) {
+ $classes = array(
+ 'ezcconsoleargument' => '/input/argument.php',
+ 'ezcconsoleargumentalreadyregisteredexception' => '/exceptions/argument_already_registered.php',
+ 'ezcconsoleargumentexception' => '/exceptions/argument.php',
+ 'ezcconsoleargumentmandatoryviolationexception' => '/exceptions/argument_mandatory_violation.php',
+ 'ezcconsolearguments' => '/input/arguments.php',
+ 'ezcconsoleargumenttypeviolationexception' => '/exceptions/argument_type_violation.php',
+ 'ezcconsoledialog' => '/interfaces/dialog.php',
+ 'ezcconsoledialogabortexception' => '/exceptions/dialog_abort.php',
+ 'ezcconsoledialogoptions' => '/options/dialog.php',
+ 'ezcconsoledialogvalidator' => '/interfaces/dialog_validator.php',
+ 'ezcconsoledialogviewer' => '/dialog_viewer.php',
+ 'ezcconsoleexception' => '/exceptions/exception.php',
+ 'ezcconsoleinput' => '/input.php',
+ 'ezcconsoleinputhelpgenerator' => '/interfaces/input_help_generator.php',
+ 'ezcconsoleinputstandardhelpgenerator' => '/input/help_generators/standard.php',
+ 'ezcconsoleinputvalidator' => '/interfaces/input_validator.php',
+ 'ezcconsoleinvalidoptionnameexception' => '/exceptions/invalid_option_name.php',
+ 'ezcconsoleinvalidoutputtargetexception' => '/exceptions/invalid_output_target.php',
+ 'ezcconsolemenudialog' => '/dialog/menu_dialog.php',
+ 'ezcconsolemenudialogdefaultvalidator' => '/dialog/validators/menu_dialog_default.php',
+ 'ezcconsolemenudialogoptions' => '/options/menu_dialog.php',
+ 'ezcconsolemenudialogvalidator' => '/interfaces/menu_dialog_validator.php',
+ 'ezcconsolenopositionstoredexception' => '/exceptions/no_position_stored.php',
+ 'ezcconsolenovaliddialogresultexception' => '/exceptions/no_valid_dialog_result.php',
+ 'ezcconsoleoption' => '/input/option.php',
+ 'ezcconsoleoptionalreadyregisteredexception' => '/exceptions/option_already_registered.php',
+ 'ezcconsoleoptionargumentsviolationexception' => '/exceptions/option_arguments_violation.php',
+ 'ezcconsoleoptiondependencyviolationexception' => '/exceptions/option_dependency_violation.php',
+ 'ezcconsoleoptionexception' => '/exceptions/option.php',
+ 'ezcconsoleoptionexclusionviolationexception' => '/exceptions/option_exclusion_violation.php',
+ 'ezcconsoleoptionmandatoryviolationexception' => '/exceptions/option_mandatory_violation.php',
+ 'ezcconsoleoptionmissingvalueexception' => '/exceptions/option_missing_value.php',
+ 'ezcconsoleoptionnoaliasexception' => '/exceptions/option_no_alias.php',
+ 'ezcconsoleoptionnotexistsexception' => '/exceptions/option_not_exists.php',
+ 'ezcconsoleoptionrule' => '/structs/option_rule.php',
+ 'ezcconsoleoptionstringnotwellformedexception' => '/exceptions/option_string_not_wellformed.php',
+ 'ezcconsoleoptiontoomanyvaluesexception' => '/exceptions/option_too_many_values.php',
+ 'ezcconsoleoptiontypeviolationexception' => '/exceptions/option_type_violation.php',
+ 'ezcconsoleoutput' => '/output.php',
+ 'ezcconsoleoutputformat' => '/structs/output_format.php',
+ 'ezcconsoleoutputformats' => '/structs/output_formats.php',
+ 'ezcconsoleoutputoptions' => '/options/output.php',
+ 'ezcconsoleprogressbar' => '/progressbar.php',
+ 'ezcconsoleprogressbaroptions' => '/options/progressbar.php',
+ 'ezcconsoleprogressmonitor' => '/progressmonitor.php',
+ 'ezcconsoleprogressmonitoroptions' => '/options/progressmonitor.php',
+ 'ezcconsolequestiondialog' => '/dialog/question_dialog.php',
+ 'ezcconsolequestiondialogcollectionvalidator' => '/dialog/validators/question_dialog_collection.php',
+ 'ezcconsolequestiondialogmappingvalidator' => '/dialog/validators/question_dialog_mapping.php',
+ 'ezcconsolequestiondialogoptions' => '/options/question_dialog.php',
+ 'ezcconsolequestiondialogregexvalidator' => '/dialog/validators/question_dialog_regex.php',
+ 'ezcconsolequestiondialogtypevalidator' => '/dialog/validators/question_dialog_type.php',
+ 'ezcconsolequestiondialogvalidator' => '/interfaces/question_dialog_validator.php',
+ 'ezcconsolestandardinputvalidator' => '/input/validators/standard.php',
+ 'ezcconsolestatusbar' => '/statusbar.php',
+ 'ezcconsolestatusbaroptions' => '/options/statusbar.php',
+ 'ezcconsolestringtool' => '/tools/string.php',
+ 'ezcconsoletable' => '/table.php',
+ 'ezcconsoletablecell' => '/table/cell.php',
+ 'ezcconsoletableoptions' => '/options/table.php',
+ 'ezcconsoletablerow' => '/table/row.php',
+ 'ezcconsoletoomanyargumentsexception' => '/exceptions/argument_too_many.php'
+ );
+ }
+ $cn = strtolower($class);
+ if (isset($classes[$cn])) {
+ require __DIR__ . $classes[$cn];
+ }
+ },
+ true,
+ false
+);
+// @codeCoverageIgnoreEnd
+# Dependencies
+require_once '/usr/share/php/ezc/Base/autoloader.php';
diff --git a/php-zetacomponents-console-tools.spec b/php-zetacomponents-console-tools.spec
index 8594d75..dfad87c 100644
--- a/php-zetacomponents-console-tools.spec
+++ b/php-zetacomponents-console-tools.spec
@@ -1,6 +1,6 @@
# remirepo/fedora spec file for php-zetacomponents-console-tools
#
-# Copyright (c) 2015-2020 Remi Collet
+# Copyright (c) 2015-2021 Remi Collet
# License: CC-BY-SA
# http://creativecommons.org/licenses/by-sa/4.0/
#
@@ -13,20 +13,30 @@
%global gh_project ConsoleTools
%global cname console-tools
%global ezcdir %{_datadir}/php/ezc
-%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
+
+%if 0%{?fedora}
+%bcond_without tests
+%bcond_without phpab
+%else
+%bcond_with tests
+%bcond_with phpab
+%endif
Name: php-%{gh_owner}-%{cname}
Version: 1.7.2
-Release: 1%{?dist}
+Release: 4%{?dist}
Summary: Zeta %{gh_project} Component
License: ASL 2.0
URL: http://zetacomponents.org/
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
+Source1: autoloader.php
BuildArch: noarch
+%if %{with phpab}
BuildRequires: %{_bindir}/phpab
-%if %{with_tests}
+%endif
+%if %{with tests}
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
BuildRequires: (php-composer(%{gh_owner}/base) >= 1.8 with php-composer(%{gh_owner}/base) < 2)
@@ -46,7 +56,7 @@ BuildRequires: php-composer(%{gh_owner}/unit-test)
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
Requires: (php-composer(%{gh_owner}/base) >= 1.8 with php-composer(%{gh_owner}/base) < 2)
-# remirepo:4
+# remirepo:3
%else
Requires: php-zetacomponents-base >= 1.8
%endif
@@ -82,6 +92,7 @@ Requires: %{name} = %{version}-%{release}
%build
+%if %{with phpab}
: Generate a simple autoloader
%{_bindir}/phpab \
--output src/autoloader.php \
@@ -90,6 +101,9 @@ cat <<EOF | tee -a src/autoloader.php
# Dependencies
require_once '%{ezcdir}/Base/autoloader.php';
EOF
+%else
+cp %{SOURCE1} src/autoloader.php
+%endif
%install
@@ -104,7 +118,7 @@ cp -pr src/*_autoload.php \
%check
-%if %{with_tests}
+%if %{with tests}
: Create test autoloader
mkdir vendor
cat <<EOF | tee vendor/autoload.php
@@ -117,7 +131,7 @@ EOF
sed -e '/realpath/d' -i tests/statusbar_test.php
: Run test test suite
-for cmd in php php72 php73 php74 php80
+for cmd in php php74 php80 php81
do
if which $cmd;
then
@@ -143,6 +157,10 @@ done
%changelog
+* Mon Dec 6 2021 Remi Collet <remi@remirepo.net> - 1.7.2-4
+- disable test suite on EL
+- add autoloader from sources on EL
+
* Fri Oct 30 2020 Remi Collet <remi@remirepo.net> - 1.7.2-1
- update to 1.7.2
- switch to phpunit7