summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-10-21 07:54:57 +0200
committerRemi Collet <fedora@famillecollet.com>2016-10-21 07:54:57 +0200
commit5ea4737cf01902d48f496a921b92ce96d24ac4d4 (patch)
treeac3dbfc469413c34b82d6ffdfd244f60ca2888f6
parent02e154692a9197d8c8e53c512eb6322c74584a5e (diff)
php-asm89-stack-cors: add backport stuff
-rw-r--r--Makefile4
-rw-r--r--composer.json22
-rw-r--r--php-asm89-stack-cors.spec27
3 files changed, 52 insertions, 1 deletions
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..02296c6
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,22 @@
+{
+ "name": "asm89/stack-cors",
+ "description": "Cross-origin resource sharing library and stack middleware",
+ "keywords": ["stack", "cors"],
+ "homepage": "https://github.com/asm89/stack-cors",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Alexander",
+ "email": "iam.asm89@gmail.com"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.2",
+ "symfony/http-foundation": "~2.1|~3.0",
+ "symfony/http-kernel": "~2.1|~3.0"
+ },
+ "autoload": {
+ "psr-0": { "Asm89\\Stack": "src/" }
+ }
+}
diff --git a/php-asm89-stack-cors.spec b/php-asm89-stack-cors.spec
index 063f9a6..712b45c 100644
--- a/php-asm89-stack-cors.spec
+++ b/php-asm89-stack-cors.spec
@@ -1,3 +1,4 @@
+# remirepo spec file for php-asm89-stack-cors, from:
#
# Fedora spec file for php-asm89-stack-cors
#
@@ -44,6 +45,7 @@ Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{githu
# https://github.com/asm89/stack-cors/pull/32
Patch0: %{name}-pull-request-32-add-license-file.patch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Autoloader
BuildRequires: %{_bindir}/phpab
@@ -85,7 +87,7 @@ Autoloader: %{phpdir}/Asm89/Stack/autoload-cors.php
: Remove executable bits from non-executable files
: https://github.com/asm89/stack-cors/pull/31
-find . -type f -executable -name '*.php' -print0 | xargs -0 chmod a-x
+find . -type f -name '*.php' -print0 | xargs -0 chmod a-x
: Add LICENSE file
: https://github.com/asm89/stack-cors/pull/32
@@ -105,20 +107,40 @@ AUTOLOAD
%install
+rm -rf %{buildroot}
+
mkdir -p %{buildroot}%{phpdir}
cp -rp src/* %{buildroot}%{phpdir}/
%check
%if %{with_tests}
+run=0
+ret=0
+if which php56; then
+ php56 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Asm89/Stack/autoload-cors.php || ret=1
+ run=1
+fi
+if which php71; then
+ php71 %{_bindir}/phpunit --bootstrap %{buildroot}%{phpdir}/Asm89/Stack/autoload-cors.php || ret=1
+ run=1
+fi
+if [ $run -eq 0 -o $ret -eq 1 ]; then
%{_bindir}/phpunit --verbose \
--bootstrap %{buildroot}%{phpdir}/Asm89/Stack/autoload-cors.php
+fi
+exit $ret
%else
: Tests skipped
%endif
+%clean
+rm -rf %{buildroot}
+
+
%files
+%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -131,5 +153,8 @@ cp -rp src/* %{buildroot}%{phpdir}/
%changelog
+* Fri Oct 21 2016 Remi Collet <remim@remirepo.net> - 1.0.0-1
+- add backport stuff
+
* Sun Oct 09 2016 Shawn Iwinski <shawn@iwin.ski> - 1.0.0-1
- Initial package