summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-09-11 14:40:32 +0200
committerRemi Collet <remi@remirepo.net>2019-09-11 14:40:32 +0200
commit746ab85ad2cf5e06820dd2044dfd6c5c95d1a937 (patch)
treec417f397351d141cbb50c8cef59cab2fe721c5a0
new packageHEADmaster
-rw-r--r--.gitignore8
-rw-r--r--Makefile4
-rw-r--r--composer.json36
-rw-r--r--php-pragmarx-google2fa-qrcode.spec157
4 files changed, 205 insertions, 0 deletions
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..61fbb7c
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,36 @@
+{
+ "name": "pragmarx/google2fa-qrcode",
+ "description": "QR Code package for Google2FA",
+ "keywords": ["authentication", "two factor authentication", "google2fa", "2fa", "QRCode", "qr code"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Antonio Carlos Ribeiro",
+ "email": "acr@antoniocarlosribeiro.com",
+ "role": "Creator & Designer"
+ }
+ ],
+ "require": {
+ "php": ">=5.4",
+ "pragmarx/google2fa": ">=4.0",
+ "bacon/bacon-qr-code": "~1.0|~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4|~5|~6|~7",
+ "khanamiryan/qrcode-detector-decoder": "^1.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "PragmaRX\\Google2FAQRCode\\": "src/",
+ "PragmaRX\\Google2FAQRCode\\Tests\\": "tests/"
+ }
+ },
+ "extra": {
+ "component": "package",
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "minimum-stability": "dev",
+ "prefer-stable": true
+}
diff --git a/php-pragmarx-google2fa-qrcode.spec b/php-pragmarx-google2fa-qrcode.spec
new file mode 100644
index 0000000..ab94be4
--- /dev/null
+++ b/php-pragmarx-google2fa-qrcode.spec
@@ -0,0 +1,157 @@
+# remirepo/fedora spec file for php-pragmarx-google2fa-qrcode
+#
+# Copyright (c) 2019 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 fd5ff0531a48b193a659309cc5fb882c14dbd03f
+%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner antonioribeiro
+%global gh_project google2fa-qrcode
+# Packagist
+%global pk_vendor pragmarx
+%global pk_project %{gh_project}
+# Namespace
+%global ns_vendor PragmaRX
+%global ns_project Google2FAQRCode
+%global major %nil
+
+Name: php-%{pk_vendor}-%{pk_project}%{major}
+Version: 1.0.3
+Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist}
+Summary: QR Code package for Google2FA
+
+License: MIT
+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(language) >= 5.4
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(pragmarx/google2fa) >= 5.0 with php-composer(pragmarx/google2fa) < 6)
+BuildRequires: (php-composer(bacon/bacon-qr-code) >= 1.0 with php-composer(bacon/bacon-qr-code) < 3)
+%else
+BuildRequires: php-pragmarx-google2fa5
+BuildRequires: php-bacon-qr-code
+%endif
+# For tests, from composer.json "require-dev": {
+# "phpunit/phpunit": "~4|~5|~6|~7",
+# "khanamiryan/qrcode-detector-decoder": "^1.0"
+BuildRequires: php-composer(phpunit/phpunit)
+%global phpunit %{_bindir}/phpunit
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(khanamiryan/qrcode-detector-decoder) >= 1.0 with php-composer(khanamiryan/qrcode-detector-decoder) < 2)
+%else
+BuildRequires: php-khanamiryan-qrcode-detector-decoder
+%endif
+BuildRequires: php-date
+# For autoloader
+BuildRequires: php-composer(fedora/autoloader)
+# Optional dependency of khanamiryan/qrcode-detector-decoder
+BuildRequires: php-imagick
+%endif
+
+# From composer.json, "require": {
+# "php": ">=5.4",
+# "pragmarx/google2fa": ">=4.0",
+# "bacon/bacon-qr-code": "~1.0|~2.0"
+Requires: php(language) >= 5.4
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+Requires: (php-composer(pragmarx/google2fa) >= 5.0 with php-composer(pragmarx/google2fa) < 6)
+Requires: (php-composer(bacon/bacon-qr-code) >= 1.0 with php-composer(bacon/bacon-qr-code) < 3)
+%else
+Requires: php-pragmarx-google2fa5
+Requires: php-bacon-qr-code
+%endif
+# From phpcompatinfo report for 1.0.3
+# only Core and standard
+# From composer.json, "suggest": {
+# "bacon/bacon-qr-code": "Required to generate inline QR Codes."
+%if 0%{?fedora} >= 21 || 0%{?rhel} >= 8
+Recommends: php-composer(bacon/bacon-qr-code)
+%endif
+# For generated autoloader
+Requires: php-composer(fedora/autoloader)
+
+# Composer
+Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version}
+
+
+%description
+This is package is Goole2FA integrated with a QRCode generator,
+providing an easy way to plot QRCode for your two factor authentication.
+
+Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php
+
+
+%prep
+%setup -q -n %{gh_project}-%{gh_commit}
+
+: 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}\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ '%{_datadir}/php/%{ns_vendor}/Google2FA5/autoload.php',
+ [
+ '%{_datadir}/php/BaconQrCode2/autoload.php',
+ '%{_datadir}/php/BaconQrCode/autoload.php',
+ ],
+]);
+AUTOLOAD
+
+
+%build
+: Nothing to build
+
+
+%install
+: Library
+mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor}
+cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}
+
+
+%check
+%if %{with_tests}
+mkdir vendor
+cat << 'EOF' | tee vendor/autoload.php
+<?php
+require '%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('%{ns_vendor}\\%{ns_project}\\Tests\\', dirname(__DIR__).'/tests');
+require '%{_datadir}/php/Zxing/autoload.php';
+EOF
+
+ret=0
+for cmd in php php71 php72 php73 php74; do
+ if which $cmd; then
+ $cmd %{phpunit} --no-coverage --verbose || ret=1
+ fi
+done
+exit $ret
+%else
+: Test suite disabled
+%endif
+
+
+%files
+# remirepo:1
+%{!?_licensedir:%global license %%doc}
+%license LICENSE.md
+%doc composer.json
+%doc README.md CHANGELOG.md
+%dir %{_datadir}/php/%{ns_vendor}
+ %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}
+
+
+%changelog
+* Wed Sep 11 2019 Remi Collet <remi@remirepo.net> - 1.0.3-1
+- initial package