diff options
author | Remi Collet <remi@remirepo.net> | 2017-04-07 07:46:19 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-04-07 07:46:19 +0200 |
commit | 61d697fa94c3c00abf119b209230960679899968 (patch) | |
tree | a08b2c5a1986d8fb5e21a1cf759578edf6426938 |
new package
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | composer.json | 42 | ||||
-rw-r--r-- | php-phar-io-manifest-pr2.patch | 260 | ||||
-rw-r--r-- | php-phar-io-manifest.spec | 134 |
5 files changed, 447 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1ab5c4f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +package-*.xml +*.tgz +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..832134d --- /dev/null +++ b/composer.json @@ -0,0 +1,42 @@ +{ + "name": "phar-io/manifest", + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "support": { + "issues": "https://github.com/phar-io/manifest/issues" + }, + "require": { + "php": "^5.6 || ^7.0", + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} + diff --git a/php-phar-io-manifest-pr2.patch b/php-phar-io-manifest-pr2.patch new file mode 100644 index 0000000..23eb2c0 --- /dev/null +++ b/php-phar-io-manifest-pr2.patch @@ -0,0 +1,260 @@ +From 3a5c1456e6dd4cde6ef655e651b922e13836733c Mon Sep 17 00:00:00 2001 +From: Remi Collet <remi@remirepo.net> +Date: Fri, 7 Apr 2017 07:39:47 +0200 +Subject: [PATCH] fix compatibility with phpunit 6 + +--- + tests/ManifestDocumentMapperTest.php | 2 +- + tests/ManifestLoaderTest.php | 2 +- + tests/ManifestSerializerTest.php | 2 +- + tests/exceptions/ManifestDocumentLoadingExceptionTest.php | 2 +- + tests/xml/AuthorElementCollectionTest.php | 2 +- + tests/xml/AuthorElementTest.php | 2 +- + tests/xml/BundlesElementTest.php | 2 +- + tests/xml/ComponentElementCollectionTest.php | 2 +- + tests/xml/ComponentElementTest.php | 2 +- + tests/xml/ContainsElementTest.php | 2 +- + tests/xml/CopyrightElementTest.php | 2 +- + tests/xml/ExtElementCollectionTest.php | 2 +- + tests/xml/ExtElementTest.php | 2 +- + tests/xml/ExtensionElementTest.php | 2 +- + tests/xml/LicenseElementTest.php | 2 +- + tests/xml/ManifestDocumentTest.php | 2 +- + tests/xml/PhpElementTest.php | 2 +- + tests/xml/RequiresElementTest.php | 2 +- + 18 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/tests/ManifestDocumentMapperTest.php b/tests/ManifestDocumentMapperTest.php +index e261231..c69d761 100644 +--- a/tests/ManifestDocumentMapperTest.php ++++ b/tests/ManifestDocumentMapperTest.php +@@ -42,7 +42,7 @@ + * @uses \PharIo\Version\Version + * @uses \PharIo\Version\VersionConstraint + */ +-class ManifestDocumentMapperTest extends \PHPUnit_Framework_TestCase { ++class ManifestDocumentMapperTest extends \PHPUnit\Framework\TestCase { + /** + * @dataProvider dataProvider + * +diff --git a/tests/ManifestLoaderTest.php b/tests/ManifestLoaderTest.php +index 73b682e..919143a 100644 +--- a/tests/ManifestLoaderTest.php ++++ b/tests/ManifestLoaderTest.php +@@ -42,7 +42,7 @@ + * @uses \PharIo\Version\Version + * @uses \PharIo\Version\VersionConstraint + */ +-class ManifestLoaderTest extends \PHPUnit_Framework_TestCase { ++class ManifestLoaderTest extends \PHPUnit\Framework\TestCase { + public function testCanBeLoadedFromFile() { + $this->assertInstanceOf( + Manifest::class, +diff --git a/tests/ManifestSerializerTest.php b/tests/ManifestSerializerTest.php +index 4433020..5fdf799 100644 +--- a/tests/ManifestSerializerTest.php ++++ b/tests/ManifestSerializerTest.php +@@ -44,7 +44,7 @@ + * @uses \PharIo\Version\Version + * @uses \PharIo\Version\VersionConstraint + */ +-class ManifestSerializerTest extends \PHPUnit_Framework_TestCase { ++class ManifestSerializerTest extends \PHPUnit\Framework\TestCase { + /** + * @dataProvider dataProvider + * +diff --git a/tests/exceptions/ManifestDocumentLoadingExceptionTest.php b/tests/exceptions/ManifestDocumentLoadingExceptionTest.php +index d87e84e..70f7553 100644 +--- a/tests/exceptions/ManifestDocumentLoadingExceptionTest.php ++++ b/tests/exceptions/ManifestDocumentLoadingExceptionTest.php +@@ -5,7 +5,7 @@ + use DOMDocument; + use LibXMLError; + +-class ManifestDocumentLoadingExceptionTest extends \PHPUnit_Framework_TestCase { ++class ManifestDocumentLoadingExceptionTest extends \PHPUnit\Framework\TestCase { + public function testXMLErrorsCanBeRetrieved() { + $dom = new DOMDocument(); + $prev = libxml_use_internal_errors(true); +diff --git a/tests/xml/AuthorElementCollectionTest.php b/tests/xml/AuthorElementCollectionTest.php +index 327a7e3..588558e 100644 +--- a/tests/xml/AuthorElementCollectionTest.php ++++ b/tests/xml/AuthorElementCollectionTest.php +@@ -4,7 +4,7 @@ + + use DOMDocument; + +-class AuthorElementCollectionTest extends \PHPUnit_Framework_TestCase { ++class AuthorElementCollectionTest extends \PHPUnit\Framework\TestCase { + public function testAuthorElementCanBeRetrievedFromCollection() { + $dom = new DOMDocument(); + $dom->loadXML('<?xml version="1.0" ?><author xmlns="https://phar.io/xml/manifest/1.0" name="Reiner Zufall" email="reiner@zufall.de" />'); +diff --git a/tests/xml/AuthorElementTest.php b/tests/xml/AuthorElementTest.php +index 430c0ca..6fce1d4 100644 +--- a/tests/xml/AuthorElementTest.php ++++ b/tests/xml/AuthorElementTest.php +@@ -2,7 +2,7 @@ + + namespace PharIo\Manifest; + +-class AuthorElementTest extends \PHPUnit_Framework_TestCase { ++class AuthorElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var AuthorElement + */ +diff --git a/tests/xml/BundlesElementTest.php b/tests/xml/BundlesElementTest.php +index 7972617..7872795 100644 +--- a/tests/xml/BundlesElementTest.php ++++ b/tests/xml/BundlesElementTest.php +@@ -4,7 +4,7 @@ + + use DOMDocument; + +-class BundlesElementTest extends \PHPUnit_Framework_TestCase { ++class BundlesElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var DOMDocument + */ +diff --git a/tests/xml/ComponentElementCollectionTest.php b/tests/xml/ComponentElementCollectionTest.php +index 3a2716f..9fe2378 100644 +--- a/tests/xml/ComponentElementCollectionTest.php ++++ b/tests/xml/ComponentElementCollectionTest.php +@@ -4,7 +4,7 @@ + + use DOMDocument; + +-class ComponentElementCollectionTest extends \PHPUnit_Framework_TestCase { ++class ComponentElementCollectionTest extends \PHPUnit\Framework\TestCase { + public function testComponentElementCanBeRetrievedFromCollection() { + $dom = new DOMDocument(); + $dom->loadXML('<?xml version="1.0" ?><component xmlns="https://phar.io/xml/manifest/1.0" />'); +diff --git a/tests/xml/ComponentElementTest.php b/tests/xml/ComponentElementTest.php +index ab89fbd..1996585 100644 +--- a/tests/xml/ComponentElementTest.php ++++ b/tests/xml/ComponentElementTest.php +@@ -2,7 +2,7 @@ + + namespace PharIo\Manifest; + +-class ComponentElementTest extends \PHPUnit_Framework_TestCase { ++class ComponentElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var ComponentElement + */ +diff --git a/tests/xml/ContainsElementTest.php b/tests/xml/ContainsElementTest.php +index f77313d..ed08600 100644 +--- a/tests/xml/ContainsElementTest.php ++++ b/tests/xml/ContainsElementTest.php +@@ -5,7 +5,7 @@ + use DOMDocument; + use DOMElement; + +-class ContainsElementTest extends \PHPUnit_Framework_TestCase { ++class ContainsElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var DOMElement + */ +diff --git a/tests/xml/CopyrightElementTest.php b/tests/xml/CopyrightElementTest.php +index 9ad8eb3..c74a2ce 100644 +--- a/tests/xml/CopyrightElementTest.php ++++ b/tests/xml/CopyrightElementTest.php +@@ -4,7 +4,7 @@ + + use DOMDocument; + +-class CopyrightElementTest extends \PHPUnit_Framework_TestCase { ++class CopyrightElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var DOMDocument + */ +diff --git a/tests/xml/ExtElementCollectionTest.php b/tests/xml/ExtElementCollectionTest.php +index 463e4d6..7a456d2 100644 +--- a/tests/xml/ExtElementCollectionTest.php ++++ b/tests/xml/ExtElementCollectionTest.php +@@ -4,7 +4,7 @@ + + use DOMDocument; + +-class ExtElementCollectionTest extends \PHPUnit_Framework_TestCase { ++class ExtElementCollectionTest extends \PHPUnit\Framework\TestCase { + public function testComponentElementCanBeRetrievedFromCollection() { + $dom = new DOMDocument(); + $dom->loadXML('<?xml version="1.0" ?><ext xmlns="https://phar.io/xml/manifest/1.0" />'); +diff --git a/tests/xml/ExtElementTest.php b/tests/xml/ExtElementTest.php +index 097b522..db6ecbc 100644 +--- a/tests/xml/ExtElementTest.php ++++ b/tests/xml/ExtElementTest.php +@@ -2,7 +2,7 @@ + + namespace PharIo\Manifest; + +-class ExtElementTest extends \PHPUnit_Framework_TestCase { ++class ExtElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var ExtElement + */ +diff --git a/tests/xml/ExtensionElementTest.php b/tests/xml/ExtensionElementTest.php +index 2ae0112..58965d8 100644 +--- a/tests/xml/ExtensionElementTest.php ++++ b/tests/xml/ExtensionElementTest.php +@@ -2,7 +2,7 @@ + + namespace PharIo\Manifest; + +-class ExtensionElementTest extends \PHPUnit_Framework_TestCase { ++class ExtensionElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var ExtensionElement + */ +diff --git a/tests/xml/LicenseElementTest.php b/tests/xml/LicenseElementTest.php +index 00d4a6c..5b1ffcb 100644 +--- a/tests/xml/LicenseElementTest.php ++++ b/tests/xml/LicenseElementTest.php +@@ -2,7 +2,7 @@ + + namespace PharIo\Manifest; + +-class LicenseElementTest extends \PHPUnit_Framework_TestCase { ++class LicenseElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var LicenseElement + */ +diff --git a/tests/xml/ManifestDocumentTest.php b/tests/xml/ManifestDocumentTest.php +index b5bb8cd..3dd59bf 100644 +--- a/tests/xml/ManifestDocumentTest.php ++++ b/tests/xml/ManifestDocumentTest.php +@@ -2,7 +2,7 @@ + + namespace PharIo\Manifest; + +-class ManifestDocumentTest extends \PHPUnit_Framework_TestCase { ++class ManifestDocumentTest extends \PHPUnit\Framework\TestCase { + public function testThrowsExceptionWhenFileDoesNotExist() { + $this->expectException(ManifestDocumentException::class); + ManifestDocument::fromFile('/does/not/exist'); +diff --git a/tests/xml/PhpElementTest.php b/tests/xml/PhpElementTest.php +index 546187a..62dd359 100644 +--- a/tests/xml/PhpElementTest.php ++++ b/tests/xml/PhpElementTest.php +@@ -4,7 +4,7 @@ + + use DOMDocument; + +-class PhpElementTest extends \PHPUnit_Framework_TestCase { ++class PhpElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var DOMDocument + */ +diff --git a/tests/xml/RequiresElementTest.php b/tests/xml/RequiresElementTest.php +index 907b0a6..35ddc82 100644 +--- a/tests/xml/RequiresElementTest.php ++++ b/tests/xml/RequiresElementTest.php +@@ -4,7 +4,7 @@ + + use DOMDocument; + +-class RequiresElementTest extends \PHPUnit_Framework_TestCase { ++class RequiresElementTest extends \PHPUnit\Framework\TestCase { + /** + * @var DOMDocument + */ diff --git a/php-phar-io-manifest.spec b/php-phar-io-manifest.spec new file mode 100644 index 0000000..6c46b59 --- /dev/null +++ b/php-phar-io-manifest.spec @@ -0,0 +1,134 @@ +# remirepo/fedora spec file for php-phar-io-manifest +# +# Copyright (c) 2017 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# +%global bootstrap 0 +%global gh_commit 2df402786ab5368a0169091f61a7c1e0eb6852d0 +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner phar-io +%global gh_project manifest +%global pk_vendor %{gh_owner} +%global pk_project %{gh_project} +%global ns_vendor PharIo +%global ns_project Manifest +%global major %nil +%global php_home %{_datadir}/php +%if %{bootstrap} +%global with_tests 0%{?_with_tests:1} +%else +%global with_tests 0%{!?_without_tests:1} +%endif + +Name: php-%{pk_vendor}-%{pk_project}%{major} +Version: 1.0.1 +Release: 1%{?dist} +Summary: Component for reading phar.io manifest information + +Group: Development/Libraries +License: BSD +URL: https://github.com/%{gh_owner}/%{gh_project} +Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz + +# https://github.com/phar-io/manifest/pull/2 +Patch0: %{name}-pr2.patch + +BuildArch: noarch +BuildRequires: php(language) >= 5.6 +BuildRequires: php-dom +BuildRequires: php-phar +BuildRequires: php-composer(%{pk_vendor}/version) < 2 +BuildRequires: php-composer(%{pk_vendor}/version) >= 1.0.1 +BuildRequires: php-filter +BuildRequires: php-libxml +BuildRequires: php-pcre +BuildRequires: php-spl +BuildRequires: php-xmlwriter +BuildRequires: php-fedora-autoloader-devel >= 1.0.0 +%if %{with_tests} +BuildRequires: phpunit6 +%endif + +# from composer.json +# "php": "^5.6 || ^7.0", +# "ext-dom": "*", +# "ext-phar": "*", +# "phar-io/version": "^1.0.1" +Requires: php(language) >= 5.6 +Requires: php-dom +Requires: php-phar +Requires: php-composer(%{pk_vendor}/version) < 2 +Requires: php-composer(%{pk_vendor}/version) >= 1.0.1 +# from phpcompatinfo report for version 1.0.1 +Requires: php-filter +Requires: php-libxml +Requires: php-pcre +Requires: php-spl +Requires: php-xmlwriter +# Autoloader +Requires: php-composer(fedora/autoloader) + +Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version} + + +%description +Component for reading phar.io manifest information from a PHP Archive (PHAR). + +Autoloader: %{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} +%patch0 -p1 -b .pr2 + + +%build +# Generate the Autoloader +%{_bindir}/phpab --template fedora2 --output src/autoload.php src + +cat << 'EOF' | tee -a src/autoload.php +\Fedora\Autoloader\Dependencies::required([ + '%{ns_vendor}/Version/autoload.php', +]); +EOF + + + +%install +mkdir -p %{buildroot}%{php_home}/%{ns_vendor} +cp -pr src %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major} + + +%check +%if %{with_tests} +mkdir vendor +ln -s %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}%{major}/autoload.php vendor/autoload.php + +: Run upstream test suite +ret=0 +for cmd in php70 php71 php; do + if which $cmd; then + %{_bindir}/php -d include_path=.:%{buildroot}%{_datadir}/php:%{_datadir}/php \ + %{_bindir}/phpunit6 --verbose || ret=1 + fi +done +exit $ret +%else +: bootstrap build with test suite disabled +%endif + + +%files +%{!?_licensedir:%global license %%doc} +%license LICENSE +%doc README.md composer.json +%{php_home}/%{ns_vendor}/%{ns_project}%{major} + + +%changelog +* Fri Apr 7 2017 Remi Collet <remi@remirepo.net> - 1.0.1-1 +- initial package + |