From 746ab85ad2cf5e06820dd2044dfd6c5c95d1a937 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 11 Sep 2019 14:40:32 +0200 Subject: new package --- .gitignore | 8 ++ Makefile | 4 + composer.json | 36 +++++++++ php-pragmarx-google2fa-qrcode.spec | 157 +++++++++++++++++++++++++++++++++++++ 4 files changed, 205 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 composer.json create mode 100644 php-pragmarx-google2fa-qrcode.spec 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 + - 1.0.3-1 +- initial package -- cgit