# fedora spec file for php-web-auth-cose-lib # # Copyright (c) 2020 Christopher Engelhard # License: MIT # # Please preserve the changelog entries # package and composer name %global vendor web-auth %global project cose-lib # PHP namespace and directory %global ns_project Cose %global ns_dir %( echo "%{ns_project}" | sed 's|\\\\|\/|g' ) # Github %global gh_vendor web-auth %global gh_project cose-lib %global commit ed172d2dc1a6b87b5c644c07c118cd30c1b3819b %global scommit %(c=%{commit}; echo ${c:0:7}) # tests %global with_tests 1 #-- PREAMBLE ------------------------------------------------------------------# Name: php-%{vendor}-%{project} Version: 3.3.9 Release: %autorelease Summary: CBOR Object Signing and Encryption (COSE) For PHP License: MIT URL: https://github.com/%{gh_vendor}/%{gh_project} Source0: https://github.com/%{gh_vendor}/%{gh_project}/archive/%{commit}/%{gh_project}-%{version}-%{scommit}.tar.gz BuildArch: noarch # for the autoloader Requires: php-composer(fedora/autoloader) # from composer.json Requires: php(language) >= 7.2 Requires: php-json Requires: php-openssl Requires: php-mbstring Requires: php-composer(beberlei/assert) >= 3.2 Requires: php-composer(fgrosse/phpasn1) >= 2.1 # from phpcompatinfo Requires: php-hash Requires: php-spl # for autoloader check BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/php BuildRequires: php(language) >= 7.2 BuildRequires: php-composer(beberlei/assert) >= 3.2 BuildRequires: php-composer(fgrosse/phpasn1) >= 2.1 %if 0%{?with_tests} # for tests %endif # composer provides Provides: php-composer(%{vendor}/%{project}) = %{version} %description CBOR Object Signing and Encryption (COSE) Support for PHP is a PHP library that will help you to perform cipher operations using Cose Keys. Autoloader: %{_datadir}/php/%{ns_dir}/autoload.php #-- PREP, BUILD & INSTALL -----------------------------------------------------# %prep %autosetup -p1 -n %{gh_project}-%{commit} %build : Nothing to build. %install : Create a PSR-0 tree mkdir -p %{buildroot}%{_datadir}/php/%{ns_dir} cp -pr src/* %{buildroot}%{_datadir}/php/%{ns_dir} : Generate an autoloader cat <<'EOF' | tee %{buildroot}%{_datadir}/php/%{ns_dir}/autoload.php