From a95b69259b711355044f485c5c936e5ae4eb17d4 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 10 Nov 2017 11:04:37 +0100 Subject: Update to 1.7.1 fix erratic FTBFS from Koschei skip 1 test on BigEndian https://github.com/fzaninotto/Faker/issues/1346 ignore test results on 32-bit https://github.com/fzaninotto/Faker/issues/1347 --- .gitignore | 8 +++++++ composer.json | 8 +++---- php-Faker-upstream.patch | 57 -------------------------------------------- php-Faker.spec | 62 +++++++++++++++++++++++++++--------------------- 4 files changed, 47 insertions(+), 88 deletions(-) create mode 100644 .gitignore delete mode 100644 php-Faker-upstream.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fc9aa8c --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +clog +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/composer.json b/composer.json index 1bf3497..d3bfd6c 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,11 @@ } ], "require": { - "php": "^5.3.3|^7.0" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5", + "phpunit/phpunit": "^4.0 || ^5.0", + "squizlabs/php_codesniffer": "^1.5", "ext-intl": "*" }, "autoload": { @@ -29,7 +29,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.6.0" + "dev-master": "1.8-dev" } } } diff --git a/php-Faker-upstream.patch b/php-Faker-upstream.patch deleted file mode 100644 index bda2a97..0000000 --- a/php-Faker-upstream.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 19dcb9039ec3df9776af23aebd9de5c8d0de3946 Mon Sep 17 00:00:00 2001 -From: oittaa -Date: Thu, 6 Oct 2016 23:59:25 +0300 -Subject: [PATCH] [UuidTest.php] Don't use mt_srand() directly. - ---- - test/Faker/Provider/UuidTest.php | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/test/Faker/Provider/UuidTest.php b/test/Faker/Provider/UuidTest.php -index fceb8df..22f9efb 100644 ---- a/test/Faker/Provider/UuidTest.php -+++ b/test/Faker/Provider/UuidTest.php -@@ -2,6 +2,7 @@ - - namespace Faker\Test\Provider; - -+use Faker\Generator; - use Faker\Provider\Uuid as BaseProvider; - - class UuidTest extends \PHPUnit_Framework_TestCase -@@ -14,7 +15,8 @@ public function testUuidReturnsUuid() - - public function testUuidExpectedSeed() - { -- mt_srand(123); -+ $faker = new Generator(); -+ $faker->seed(123); - $this->assertEquals("8e2e0c84-50dd-367c-9e66-f3ab455c78d6", BaseProvider::uuid()); - $this->assertEquals("073eb60a-902c-30ab-93d0-a94db371f6c8", BaseProvider::uuid()); - } -From 89135d0fe594ec7f3e82ef084242df09b88f6fd8 Mon Sep 17 00:00:00 2001 -From: oittaa -Date: Thu, 6 Oct 2016 23:32:59 +0300 -Subject: [PATCH] [Generator.php] mt_rand() changed in PHP 7.1 - ---- - src/Faker/Generator.php | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/Faker/Generator.php b/src/Faker/Generator.php -index cb13cd0..9496bca 100644 ---- a/src/Faker/Generator.php -+++ b/src/Faker/Generator.php -@@ -188,7 +188,11 @@ public function seed($seed = null) - if ($seed === null) { - mt_srand(); - } else { -- mt_srand((int) $seed); -+ if (PHP_VERSION_ID < 70100) { -+ mt_srand((int) $seed); -+ } else { -+ mt_srand((int) $seed, MT_RAND_PHP); -+ } - } - } - diff --git a/php-Faker.spec b/php-Faker.spec index e7726f6..3c8f650 100644 --- a/php-Faker.spec +++ b/php-Faker.spec @@ -12,8 +12,8 @@ %global github_owner fzaninotto %global github_name Faker -%global github_version 1.6.0 -%global github_commit 44f9a286a04b80c76a4e5fb7aad8bb539b920123 +%global github_version 1.7.1 +%global github_commit d3ed4cc37051c1ca52d22d76b437d14809fc7e0d %global composer_vendor fzaninotto %global composer_project faker @@ -28,7 +28,7 @@ Name: php-%{github_name} Version: %{github_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: A PHP library that generates fake data Group: Development/Libraries @@ -36,10 +36,10 @@ 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) +# remirepo:3 +# For test build on all available arch +#global debug_package %{nil} +#global __debug_install_post /bin/true BuildArch: noarch # Tests %if %{with_tests} @@ -101,9 +101,13 @@ Optional: %prep %setup -qn %{github_name}-%{github_commit} -%patch0 -p1 -b .upstream -find src -name \*upstream -exec rm {} \; +%if 0%{?el6} +# For old PHPUnit +for test in $(find test -name \*Test.php); do + sed -e '/assertNotFalse/s/);/, false);/;s/assertNotFalse/assertNotSame/' -i $test +done +%endif : Create autoloader cat <<'AUTOLOAD' | tee src/Faker/autoload.php @@ -126,12 +130,12 @@ AUTOLOAD %install -rm -rf %{buildroot} mkdir -p %{buildroot}%{phpdir} cp -rp src/%{github_name} %{buildroot}%{phpdir}/ %check +%if %{with_tests} mkdir vendor cat << 'EOF' | tee vendor/autoload.php - 1.7.1-2 +- fix skip result condition + +* Fri Nov 10 2017 Remi Collet - 1.7.1-1 +- Update to 1.7.1 +- fix erratic FTBFS from Koschei +- skip 1 test on BigEndian + https://github.com/fzaninotto/Faker/issues/1346 +- ignore test results on 32-bit + https://github.com/fzaninotto/Faker/issues/1347 + * Thu Feb 16 2017 Remi Collet - 1.6.0-1 - update to 1.6.0 - switch to fedora/autoloader -- cgit