From 83ac416483d249029bff10387d154d7748d3eafa Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 16 Feb 2017 15:32:55 +0100 Subject: php-Faker: 1.6.0 --- php-Faker.spec | 91 ++++++++++++++++++++++++++++------------------------------ 1 file changed, 44 insertions(+), 47 deletions(-) (limited to 'php-Faker.spec') diff --git a/php-Faker.spec b/php-Faker.spec index abff111..e7726f6 100644 --- a/php-Faker.spec +++ b/php-Faker.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-Faker # -# Copyright (c) 2012-2016 Shawn Iwinski +# Copyright (c) 2012-2017 Shawn Iwinski # # License: MIT # http://opensource.org/licenses/MIT @@ -12,13 +12,13 @@ %global github_owner fzaninotto %global github_name Faker -%global github_version 1.5.0 -%global github_commit d0190b156bcca848d401fb80f31f504f37141c8d +%global github_version 1.6.0 +%global github_commit 44f9a286a04b80c76a4e5fb7aad8bb539b920123 %global composer_vendor fzaninotto %global composer_project faker -# "php": ">=5.3.3" +# "php": "^5.3.3|^7.0" %global php_min_ver 5.3.3 # Build using "--without tests" to disable tests @@ -28,7 +28,7 @@ Name: php-%{github_name} Version: %{github_version} -Release: 5%{?dist} +Release: 1%{?dist} Summary: A PHP library that generates fake data Group: Development/Libraries @@ -36,6 +36,9 @@ License: MIT URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +# For PHP 7.1 +Patch0: %{name}-upstream.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests @@ -43,25 +46,24 @@ BuildArch: noarch ## composer.json BuildRequires: php(language) >= %{php_min_ver} BuildRequires: php-composer(phpunit/phpunit) -## phpcompatinfo (computed from version 1.5.0) +BuildRequires: php-intl +## phpcompatinfo (computed from version 1.6.0) +BuildRequires: php-ctype BuildRequires: php-curl BuildRequires: php-date BuildRequires: php-filter BuildRequires: php-hash -BuildRequires: php-intl BuildRequires: php-mbstring BuildRequires: php-pcre BuildRequires: php-reflection BuildRequires: php-spl ## Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-fedora-autoloader-devel %endif # composer.json Requires: php(language) >= %{php_min_ver} -# composer.json: optional -Requires: php-intl -# phpcompatinfo (computed from version 1.5.0) +# phpcompatinfo (computed from version 1.6.0) Requires: php-curl Requires: php-date Requires: php-hash @@ -70,11 +72,7 @@ Requires: php-pcre Requires: php-reflection Requires: php-spl # Autoloader -Requires: php-composer(symfony/class-loader) -# Weak dependencies -%if 0%{?fedora} >= 21 -Suggests: php-composer(doctrine/orm) -%endif +Requires: php-composer(fedora/autoloader) # php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT} Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release} @@ -103,15 +101,9 @@ Optional: %prep %setup -qn %{github_name}-%{github_commit} +%patch0 -p1 -b .upstream -: Remove executable bits -: https://github.com/fzaninotto/Faker/pull/593 -chmod a-x \ - src/Faker/Provider/sl_SI/Address.php \ - src/Faker/Provider/sl_SI/Internet.php \ - src/Faker/Provider/sl_SI/Payment.php \ - src/Faker/Provider/sl_SI/PhoneNumber.php \ - test/Faker/Provider/ja_JP/PersonTest.php +find src -name \*upstream -exec rm {} \; : Create autoloader cat <<'AUTOLOAD' | tee src/Faker/autoload.php @@ -123,18 +115,9 @@ cat <<'AUTOLOAD' | tee src/Faker/autoload.php * @return \Symfony\Component\ClassLoader\ClassLoader */ -if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) { - if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) { - require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php'; - } - - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} - -$fedoraClassLoader->addPrefix('Faker\\', dirname(__DIR__)); +require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; +\Fedora\Autoloader\Autoload::addPsr4('Faker\\', __DIR__); -return $fedoraClassLoader; AUTOLOAD @@ -149,22 +132,32 @@ cp -rp src/%{github_name} %{buildroot}%{phpdir}/ %check +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php + - 1.6.0-1 +- update to 1.6.0 +- switch to fedora/autoloader + * Sat Mar 12 2016 Shawn Iwinski - 1.5.0-5 - Add standard "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" provides - Updated autoloader -- cgit