summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--Makefile4
-rw-r--r--composer.json17
-rw-r--r--php-samyoul-u2f-php-server.spec117
4 files changed, 147 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6f69818
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+clog
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.bz2
+*.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..8da2271
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,17 @@
+{
+ "name": "samyoul/u2f-php-server",
+ "description": "Server side handling class for FIDO U2F registration and authentication",
+ "license":"BSD-2-Clause",
+ "authors": [
+ {
+ "name": "Samuel Hawksby-Robinson",
+ "email": "samuel@samyoul.com"
+ }
+ ],
+ "require": {
+ "ext-openssl":"*"
+ },
+ "autoload": {
+ "psr-4": { "Samyoul\\U2F\\U2FServer\\": ["src/"] }
+ }
+}
diff --git a/php-samyoul-u2f-php-server.spec b/php-samyoul-u2f-php-server.spec
new file mode 100644
index 0000000..3c35c12
--- /dev/null
+++ b/php-samyoul-u2f-php-server.spec
@@ -0,0 +1,117 @@
+# remirepo/fedora spec file for php-samyoul-u2f-php-server
+#
+# Copyright (c) 2018 Remi Collet
+# License: CC-BY-SA
+# http://creativecommons.org/licenses/by-sa/4.0/
+#
+# Please, preserve the changelog entries
+#
+
+%global with_tests 0%{!?_without_tests:1}
+# Github
+%global gh_commit 815279529ddd63b349dea9a1d0817fa2775d81c8
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner Samyoul
+%global gh_project U2F-php-server
+# Packagist
+%global pk_vendor samyoul
+%global pk_project u2f-php-server
+# Namespace
+%global ns_vendor Samyoul
+%global ns_project U2F
+%global ns_library U2FServer
+
+Name: php-%{pk_vendor}-%{pk_project}
+Version: 1.1.3
+Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist}
+Summary: Server side handling class for FIDO U2F registration and authentication
+
+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
+
+BuildArch: noarch
+%if %{with_tests}
+BuildRequires: php-cli
+BuildRequires: php-hash
+BuildRequires: php-json
+BuildRequires: php-openssl
+BuildRequires: php-spl
+# For autoloader
+BuildRequires: php-composer(fedora/autoloader)
+%endif
+
+# From composer.json, "require": {
+# "ext-openssl":"*"
+Requires: php-openssl
+# From phpcompatinfo report for 1.1.3
+Requires: php-hash
+Requires: php-json
+Requires: php-spl
+# For generated autoloader
+Requires: php-composer(fedora/autoloader)
+
+# Composer
+Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
+
+
+%description
+Server-side handling of FIDO U2F registration and authentication for PHP.
+
+Securing your online accounts and doing your bit to protect your data is
+extremely important and increasingly more so as hackers get more sophisticated.
+FIDO's U2F enables you to add a simple unobtrusive method of 2nd factor
+authentication, allowing users of your service and/or application to link
+a hardware key to their account.
+
+Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}/%{ns_library}/autoload.php
+
+
+%prep
+%setup -q -n %{gh_project}-%{gh_commit}
+
+mv LICENCE.md LICENCE
+
+: Create autoloader
+cat <<'AUTOLOAD' | tee src/autoload.php
+<?php
+/* Autoloader for %{name} and its dependencies */
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
+
+\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\%{ns_library}\\', __DIR__);
+AUTOLOAD
+
+
+%build
+: Nothing to build
+
+
+%install
+: Library
+mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}
+cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/%{ns_library}
+
+
+%check
+%if %{with_tests}
+# No upstream test suite, only check our autoloader
+php -r '
+ require "%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/%{ns_library}/autoload.php";
+ exit (%{ns_vendor}\%{ns_project}\%{ns_library}\U2FServer::checkOpenSSLVersion() ? 0 : 1);
+'
+%endif
+
+
+%files
+%{!?_licensedir:%global license %%doc}
+%license LICENCE
+%doc composer.json
+%doc *.md
+%dir %{_datadir}/php/%{ns_vendor}
+%dir %{_datadir}/php/%{ns_vendor}/%{ns_project}
+ %{_datadir}/php/%{ns_vendor}/%{ns_project}/%{ns_library}
+
+
+%changelog
+* Wed Mar 7 2018 Remi Collet <remi@remirepo.net> - 1.1.3-1
+- initial package