From 2a78bb8762b2b50ffeeefb1a279f95a16b4282c8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 6 Jul 2018 08:38:58 +0200 Subject: backport for remirepo --- .gitignore | 8 ++++++ Makefile | 4 +++ composer.json | 59 ++++++++++++++++++++++++++++++++++++++++++++ php-opencloud-openstack.spec | 34 ++++++++++++++++++++++++- 4 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 composer.json 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/Makefile b/Makefile new file mode 100644 index 0000000..91b0fd5 --- /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..7abc54b --- /dev/null +++ b/composer.json @@ -0,0 +1,59 @@ +{ + "name": "php-opencloud/openstack", + "description": "PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi", + "keywords": [ + "php", + "openstack", + "api", + "sdk" + ], + "homepage": "https://github.com/php-opencloud/openstack", + "license": "Apache-2.0", + "authors": [ + { + "name": "Jamie Hannaford", + "email": "jamie.hannaford@rackspace.com", + "homepage" : "https://github.com/jamiehannaford" + }, + { + "name": "Ha Phan", + "email": "thanhha.work@gmail.com", + "homepage" : "https://github.com/haphan" + } + ], + "autoload": { + "psr-4": { + "OpenStack\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "OpenStack\\Test\\": "tests/unit/", + "OpenStack\\Integration\\": "tests/integration/" + } + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/php-opencloud/Sami" + } + ], + "require": { + "php": "~7.0", + "guzzlehttp/guzzle": "~6.1", + "justinrainbow/json-schema": "~5.2" + }, + "require-dev": { + "phpunit/phpunit": "^6.5", + "sami/sami": "dev-master", + "psr/log": "^1.0", + "satooshi/php-coveralls": "^2.0", + "jakub-onderka/php-parallel-lint": "^1.0", + "friendsofphp/php-cs-fixer": "^2.9" + }, + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + } +} diff --git a/php-opencloud-openstack.spec b/php-opencloud-openstack.spec index 20d66be..8813362 100644 --- a/php-opencloud-openstack.spec +++ b/php-opencloud-openstack.spec @@ -1,3 +1,4 @@ +# remirepo spec file for php-opencloud-openstack, from: # # Fedora spec file for php-opencloud-openstack # @@ -45,16 +46,25 @@ Source0: https://github.com/%{github_owner}/%{github_name}/archive/%{gith BuildArch: noarch # Docs +%if 0%{?fedora} >= 29 +%global with_docs 1 BuildRequires: python3dist(sphinx) BuildRequires: python3dist(sphinxcontrib-phpdomain) +%else +%global with_docs 0 +%endif BuildRequires: fontawesome-fonts Requires: fontawesome-fonts +%if 0%{?fedora} >= 25 BuildRequires: fontawesome-fonts-web Requires: fontawesome-fonts-web +%endif BuildRequires: lato-fonts Requires: lato-fonts +%if 0%{?fedora} >= 25 || 0%{?rhel} >= 7 BuildRequires: google-roboto-slab-fonts Requires: google-roboto-slab-fonts +%endif %if 0%{?fedora} >= 29 BuildRequires: levien-inconsolata-fonts Requires: levien-inconsolata-fonts @@ -64,8 +74,13 @@ Requires: levien-inconsolata-fonts %if %{with_tests} ## composer.json BuildRequires: php(language) >= %{php_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 BuildRequires: (php-guzzlehttp-guzzle6 >= %{guzzle_min_ver} with php-guzzlehttp-guzzle6 < %{guzzle_max_ver}) BuildRequires: (php-justinrainbow-json-schema5 >= %{json_schema_min_ver} with php-justinrainbow-json-schema5 < %{json_schema_max_ver}) +%else +BuildRequires: php-guzzlehttp-guzzle6 >= %{guzzle_min_ver} +BuildRequires: php-justinrainbow-json-schema5 >= %{json_schema_min_ver} +%endif BuildRequires: phpunit6 ## Autoloader BuildRequires: php-fedora-autoloader @@ -73,8 +88,13 @@ BuildRequires: php-fedora-autoloader # composer.json Requires: php(language) >= %{php_min_ver} +%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 Requires: (php-guzzlehttp-guzzle6 >= %{guzzle_min_ver} with php-guzzlehttp-guzzle6 < %{guzzle_max_ver}) Requires: (php-justinrainbow-json-schema5 >= %{json_schema_min_ver} with php-justinrainbow-json-schema5 < %{json_schema_max_ver}) +%else +Requires: php-guzzlehttp-guzzle6 >= %{guzzle_min_ver} +Requires: php-justinrainbow-json-schema5 >= %{json_schema_min_ver} +%endif # Autoloader Requires: php-fedora-autoloader @@ -103,6 +123,7 @@ Documentation for PHP SDK for OpenStack clouds %build +%if %{with_docs} # Generate html docs PYTHONPATH=${PWD} sphinx-build-3 doc html # Remove the sphinx-build leftovers @@ -121,10 +142,12 @@ for file in Lato*; do rm -f $file ln -s /usr/share/fonts/lato/$file $file done +%if 0%{?fedora} >= 24 || 0%{?rhel} >= 7 for file in RobotoSlab*; do rm -f $file ln -s /usr/share/fonts/google-roboto-slab/$file $file done +%endif %if 0%{?fedora} >= 29 for file in Inconsolata*; do rm -f $file @@ -132,6 +155,7 @@ for file in Inconsolata*; do done %endif popd +%endif : Create autoloader cat <<'AUTOLOAD' | tee src/autoload.php @@ -169,7 +193,12 @@ require '%{buildroot}%{phpdir}/OpenStack/autoload.php'; AUTOLOAD : Upstream tests -%{_bindir}/phpunit6 --verbose +for cmd in php php70 php71 php72 php73 +do + if which $cmd; then + $cmd %{_bindir}/phpunit6 --verbose + fi +done %else : Tests skipped %endif @@ -189,6 +218,9 @@ AUTOLOAD %changelog +* Fri Jul 6 2018 Remi Collet - 3.0.5-1 +- backport for remirepo + * Sun Jul 01 2018 Christian Glombek - 3.0.5-1 - Update to version 3.0.5 - Rename to php-opencloud-openstack -- cgit