From ce7a71c1c059d90399c31c5fe22d8f328e33070e Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 26 Nov 2020 08:33:53 +0100 Subject: new package --- php-yoast-phpunit-polyfills.spec | 155 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 php-yoast-phpunit-polyfills.spec (limited to 'php-yoast-phpunit-polyfills.spec') diff --git a/php-yoast-phpunit-polyfills.spec b/php-yoast-phpunit-polyfills.spec new file mode 100644 index 0000000..c7812dc --- /dev/null +++ b/php-yoast-phpunit-polyfills.spec @@ -0,0 +1,155 @@ +# remirepo/fedora spec file for php-yoast-phpunit-polyfills +# +# Copyright (c) 2020 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please preserve changelog entries +# +# Github +%global gh_commit c48e4cf0c44b2d892540846aff19fb0468627bab +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner Yoast +%global gh_project PHPUnit-Polyfills +# Packagist +%global pk_vendor yoast +%global pk_project phpunit-polyfills +# Namespace +%global ns_vendor Yoast +%global ns_project PHPUnitPolyfills +# don't change major version used in package name +%global major %nil +%bcond_without tests +%global php_home %{_datadir}/php + +Name: php-%{pk_vendor}-%{pk_project}%{major} +Version: 0.2.0 +Release: 1%{?dist} +Summary: Set of polyfills for changed PHPUnit functionality + +License: BSD +URL: https://github.com/%{gh_owner}/%{gh_project} +# git snapshot to get upstream test suite +Source0: %{name}-%{version}-%{gh_short}.tgz +Source1: makesrc.sh + +Patch0: %{name}-layout.patch + +BuildArch: noarch +%if %{with tests} +BuildRequires: php(language) >= 5.5 +BuildRequires: php-reflection +# From composer.json, "require-dev": { +# "php-parallel-lint/php-parallel-lint": "^1.2.0", +# "php-parallel-lint/php-console-highlighter": "^0.5", +# "yoast/yoastcs": "^2.1.0" +%if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 +BuildRequires: phpunit9 +%endif +BuildRequires: phpunit8 +BuildRequires: phpunit7 +BuildRequires: phpunit6 +BuildRequires: phpunit +BuildRequires: php-fedora-autoloader-devel +%endif + +# From composer.json, "require": { +# "php": ">=5.5", +# "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" +Requires: php(language) >= 5.5 +# from phpcompatinfo report on version 0.2.0 +Requires: php-reflection + +Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version} + + +%description +Set of polyfills for changed PHPUnit functionality to allow for creating +PHPUnit cross-version compatible tests. + +Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php + + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + +# Fix for RPM layout +%patch0 -p1 -b .rpm +sed -e 's:src/::' phpunitpolyfills-autoload.php > src/autoload.php + + +%build +# Empty build section, most likely nothing required. + + +%install +mkdir -p %{buildroot}/%{php_home}/%{ns_vendor} +cp -pr src %{buildroot}/%{php_home}/%{ns_vendor}/%{ns_project}%{major} + + +%check +%if %{with tests} +: Use installed tree and autoloader +mkdir vendor +cat << 'EOF' | tee -a vendor/autoload.php + - 0.2.0-1 +- initial rpm -- cgit