summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-12-08 07:04:32 +0100
committerRemi Collet <fedora@famillecollet.com>2016-12-08 07:04:32 +0100
commitdd93137661ea20fd508f04eeaff12f5edbc958be (patch)
tree738ffba7c4ba275072ef7213794bde10cf9f5de5
parent456f0e403caa633b0647be7f0c9020e5234ab5bb (diff)
php-mtdowling-jmespath-php: 2.4.0 (backported from Fedora)
-rw-r--r--composer.json37
-rw-r--r--php-mtdowling-jmespath-php.spec51
2 files changed, 64 insertions, 24 deletions
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..79a2c5e
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,37 @@
+{
+ "name": "mtdowling/jmespath.php",
+ "description": "Declaratively specify how to extract elements from a JSON document",
+ "keywords": ["json", "jsonpath"],
+ "license": "MIT",
+
+ "authors": [
+ {
+ "name": "Michael Dowling",
+ "email": "mtdowling@gmail.com",
+ "homepage": "https://github.com/mtdowling"
+ }
+ ],
+
+ "require": {
+ "php": ">=5.4.0"
+ },
+
+ "require-dev": {
+ "phpunit/phpunit": "~4.0"
+ },
+
+ "autoload": {
+ "psr-4": {
+ "JmesPath\\": "src/"
+ },
+ "files": ["src/JmesPath.php"]
+ },
+
+ "bin": ["bin/jp.php"],
+
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0-dev"
+ }
+ }
+}
diff --git a/php-mtdowling-jmespath-php.spec b/php-mtdowling-jmespath-php.spec
index 70235b5..6404fe1 100644
--- a/php-mtdowling-jmespath-php.spec
+++ b/php-mtdowling-jmespath-php.spec
@@ -12,8 +12,8 @@
%global github_owner jmespath
%global github_name jmespath.php
-%global github_version 2.3.0
-%global github_commit 192f93e43c2c97acde7694993ab171b3de284093
+%global github_version 2.4.0
+%global github_commit adcc9531682cf87dfda21e1fd5d0e7a41d292fac
%global composer_vendor mtdowling
%global composer_project jmespath.php
@@ -43,21 +43,21 @@ BuildArch: noarch
## composer.json
BuildRequires: php(language) >= %{php_min_ver}
BuildRequires: php-composer(phpunit/phpunit)
-## phpcompatinfo (computed from version 2.3.0)
+## phpcompatinfo (computed from version 2.4.0)
BuildRequires: php-json
BuildRequires: php-spl
## Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
Requires: php-cli
# composer.json
Requires: php(language) >= %{php_min_ver}
-# phpcompatinfo (computed from version 2.3.0)
+# phpcompatinfo (computed from version 2.4.0)
Requires: php-json
Requires: php-spl
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}
Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release}
@@ -79,24 +79,12 @@ cat <<'AUTOLOAD' | tee src/autoload.php
/**
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
- *
- * @return \Symfony\Component\ClassLoader\ClassLoader
*/
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
-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('JmesPath\\', dirname(__DIR__));
+\Fedora\Autoloader\Autoload::addPsr4('JmesPath\\', __DIR__);
require_once __DIR__ . '/JmesPath.php';
-
-return $fedoraClassLoader;
AUTOLOAD
: Modify bin script
@@ -126,13 +114,23 @@ sed 's/function testTokenizesJsonNumbers/function SKIP_testTokenizesJsonNumbers/
-i tests/LexerTest.php
: Run tests
+# remirepo:11
+run=0
+ret=0
+if which php56; then
+ php56 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/JmesPath/autoload.php || ret=1
+ run=1
+fi
+if which php71; then
+ php71 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/JmesPath/autoload.php || ret=1
+ run=1
+fi
+if [ $run -eq 0 ]; then
%{_bindir}/phpunit --verbose \
--bootstrap %{buildroot}%{phpdir}/JmesPath/autoload.php
-
-if which php70; then
- php70 %{_bindir}/phpunit --verbose \
- --bootstrap %{buildroot}%{phpdir}/JmesPath/autoload.php
+# remirepo:2
fi
+exit $ret
%else
: Tests skipped
%endif
@@ -154,6 +152,11 @@ rm -rf %{buildroot}
%changelog
+* Wed Dec 07 2016 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.4.0-1
+- Update to 2.4.0 (RHBZ #1401271)
+- Change autoloader from php-composer(symfony/class-loader) to
+ php-composer(fedora/autoloader)
+
* Sun Jun 28 2015 Shawn Iwinski <shawn.iwinski@gmail.com> - 2.3.0-1
- Updated to 2.3.0 (RHBZ #1295982)
- Added "php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}" ("php-mtdowling-jmespath.php")