From a73ece69dd8a3f13aa11c3cad5d97287687f93c1 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sat, 30 Jul 2016 06:53:52 +0200 Subject: php-simplesamlphp-saml2: backport --- Makefile | 4 ++++ composer.json | 39 +++++++++++++++++++++++++++++++++++++++ php-simplesamlphp-saml2.spec | 34 +++++++++++++++++++++++++--------- 3 files changed, 68 insertions(+), 9 deletions(-) create mode 100644 Makefile create mode 100644 composer.json 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..26461cd --- /dev/null +++ b/composer.json @@ -0,0 +1,39 @@ +{ + "name": "simplesamlphp/saml2", + "description": "SAML2 PHP library from SimpleSAMLphp", + "license": "LGPL-2.1", + "authors": [ + { + "name": "Andreas Åkre Solberg", + "email": "andreas.solberg@uninett.no" + } + ], + "require": { + "php": ">=5.3.3", + "ext-openssl": "*", + "ext-dom": "*", + + "robrichards/xmlseclibs": "^2.0", + "psr/log": "~1.0" + }, + "require-dev": { + "squizlabs/php_codesniffer": "~1.4", + "phpmd/phpmd": "~1.5", + "sensiolabs/security-checker": "~1.1", + "phpunit/phpunit": "~3.7", + "satooshi/php-coveralls": "~0.6.1", + "sebastian/phpcpd": "~1.4", + "mockery/mockery": "~0.9" + }, + "autoload": { + "psr-0": { + "SAML2\\": "src/" + }, + "files": ["src/_autoload.php"] + }, + "autoload-dev": { + "psr-0": { + "SAML2\\": "tests/" + } + } +} diff --git a/php-simplesamlphp-saml2.spec b/php-simplesamlphp-saml2.spec index 2dfc389..7086077 100644 --- a/php-simplesamlphp-saml2.spec +++ b/php-simplesamlphp-saml2.spec @@ -1,3 +1,4 @@ +# remirepo spec file for php-simplesamlphp-saml2, from: # # Fedora spec file for php-simplesamlphp-saml2 # @@ -45,6 +46,7 @@ License: LGPLv2 URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests %if %{with_tests} @@ -56,9 +58,7 @@ BuildRequires: php-PsrLog >= %{psr_log_min_ver} BuildRequires: php-composer(robrichards/xmlseclibs) >= %{robrichards_xmlseclibs_min_ver} BuildRequires: php-dom BuildRequires: php-openssl -%if 0%{!?el6:1} BuildRequires: php-composer(mockery/mockery) >= %{mockery_min_ver} -%endif ## phpcompatinfo (computed from version 2.2) BuildRequires: php-date BuildRequires: php-libxml @@ -145,6 +145,8 @@ AUTOLOAD %install +rm -rf %{buildroot} + mkdir -p %{buildroot}%{phpdir} cp -rp src/* %{buildroot}%{phpdir}/ @@ -157,24 +159,35 @@ cat <<'AUTOLOAD' | tee vendor/autoload.php addPrefix('SAML2', dirname(__DIR__).'/tests'); -%if 0%{!?el6:1} require_once '%{phpdir}/Mockery/autoload.php'; -%endif AUTOLOAD -%if 0%{?el6} -: Remove tests requiring Mockery -grep -r --files-with-matches Mockery tests | xargs rm -f -%endif - : Run tests +ret=0 +run=0 +if which php56; then + php56 %{_bindir}/phpunit --configuration=tools/phpunit || ret=1 + run=1 +fi +if which php71; then + php71 %{_bindir}/phpunit --configuration=tools/phpunit || ret=1 + run=1 +fi +if [ $run -eq 0 ]; then %{_bindir}/phpunit --configuration=tools/phpunit --verbose +fi +exit $ret %else : Tests skipped %endif +%clean +rm -rf %{buildroot} + + %files +%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc *.md @@ -183,6 +196,9 @@ grep -r --files-with-matches Mockery tests | xargs rm -f %changelog +* Sat Jul 30 2016 Remi Collet - 2.2-2 +- backport for remirepo + * Fri Jul 29 2016 Shawn Iwinski - 2.2-2 - Remove upstream temporary autoloader -- cgit