From 408732428b9b29dc0a541bc1509b86f3bc1d4161 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 30 Jun 2015 13:15:27 +0200 Subject: php-egulias-email-validator: 1.2.9 (backport from rawhide) --- php-egulias-email-validator.spec | 88 ++++++++++++++++++++++++++-------------- 1 file changed, 57 insertions(+), 31 deletions(-) diff --git a/php-egulias-email-validator.spec b/php-egulias-email-validator.spec index f6a03b3..b406f66 100644 --- a/php-egulias-email-validator.spec +++ b/php-egulias-email-validator.spec @@ -1,5 +1,6 @@ +# remirepo spec file for php-egulias-email-validator, from # -# RPM spec file for php-egulias-email-validator +# Fedora spec file for php-egulias-email-validator # # Copyright (c) 2014-2015 Shawn Iwinski # @@ -11,23 +12,23 @@ %global github_owner egulias %global github_name EmailValidator -%global github_version 1.2.7 -%global github_commit af9417f765623429c9d2a200f0159537e08d1ef3 +%global github_version 1.2.9 +%global github_commit af864423f50ea59f96c87bb1eae147a70bcf67a1 %global composer_vendor egulias %global composer_project email-validator # "php": ">= 5.3.3" %global php_min_ver 5.3.3 -# "doctrine/lexer": "~1.0" -%global doctrine_lexer_min_ver 1.0 +# "doctrine/lexer": "~1.0,>=1.0.1" +# NOTE: Min version not 1.0.1 because autoloader required +%global doctrine_lexer_min_ver 1.0.1-4 %global doctrine_lexer_max_ver 2.0 # Build using "--without tests" to disable tests -%global with_tests %{?_without_tests:0}%{!?_without_tests:1} +%global with_tests 0%{!?_without_tests:1} -%{!?phpdir: %global phpdir %{_datadir}/php} -%{!?__phpunit: %global __phpunit %{_bindir}/phpunit} +%{!?phpdir: %global phpdir %{_datadir}/php} Name: php-%{composer_vendor}-%{composer_project} Version: %{github_version} @@ -41,27 +42,34 @@ Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{githu BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildArch: noarch +# Tests %if %{with_tests} -BuildRequires: php-phpunit-PHPUnit -# composer.json +BuildRequires: %{_bindir}/phpunit +## composer.json BuildRequires: php(language) >= %{php_min_ver} -BuildRequires: php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} +#BuildRequires: php-composer(doctrine/lexer) >= %%{doctrine_lexer_min_ver} +BuildRequires: php-doctrine-lexer >= %{doctrine_lexer_min_ver} BuildRequires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver} -# phpcompatinfo (computed from version 1.2.7) +## phpcompatinfo (computed from version 1.2.9) BuildRequires: php-filter BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl +## Autoloader +BuildRequires: php-composer(symfony/class-loader) %endif # composer.json Requires: php(language) >= %{php_min_ver} -Requires: php-composer(doctrine/lexer) >= %{doctrine_lexer_min_ver} +#Requires: php-composer(doctrine/lexer) >= %%{doctrine_lexer_min_ver} +Requires: php-doctrine-lexer >= %{doctrine_lexer_min_ver} Requires: php-composer(doctrine/lexer) < %{doctrine_lexer_max_ver} -# phpcompatinfo (computed from version 1.2.7) +# phpcompatinfo (computed from version 1.2.9) Requires: php-pcre Requires: php-reflection Requires: php-spl +# Autoloader +Requires: php-composer(symfony/class-loader) # Composer Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -73,8 +81,31 @@ Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} %prep %setup -qn %{github_name}-%{github_commit} -# W: wrong-file-end-of-line-encoding /usr/share/doc/php-egulias-email-validator/README.md -sed -i 's/\r$//' README.md +: Create autoloader +(cat <<'AUTOLOAD' +register(); +} + +$fedoraClassLoader->addPrefix('Egulias\\EmailValidator\\', dirname(dirname(__DIR__))); + +return $fedoraClassLoader; +AUTOLOAD +) | tee src/Egulias/EmailValidator/autoload.php %build @@ -83,31 +114,21 @@ sed -i 's/\r$//' README.md %install rm -rf %{buildroot} -mkdir -pm 0755 %{buildroot}%{phpdir} +mkdir -p %{buildroot}%{phpdir} cp -rp src/* %{buildroot}%{phpdir}/ %check %if %{with_tests} -# Create autoloader -mkdir vendor -cat > vendor/autoload.php <<'AUTOLOAD' - - 1.2.9-1 +- Updated to 1.2.9 (RHBZ #1215684) +- Added autoloader + * Mon Jan 05 2015 Shawn Iwinski - 1.2.7-1 - Updated to 1.2.7 (BZ #1178809) -- cgit