# fedora spec file for php-spomky-labs-cbor-php # # Copyright (c) 2020 Christopher Engelhard # License: MIT # # Please preserve the changelog entries # package and composer name %global vendor spomky-labs %global project cbor-php # PHP namespace and directory %global ns_project CBOR %global ns_dir %( echo "%{ns_project}" | sed 's|\\\\|\/|g' ) # Github %global gh_vendor Spomky-Labs %global gh_project cbor-php %global commit 9776578000be884cd7864eeb7c37a4ac92d8c995 %global scommit %(c=%{commit}; echo ${c:0:7}) # tests %global with_tests 1 #-- PREAMBLE ------------------------------------------------------------------# Name: php-%{vendor}-%{project} Version: 2.0.1 Release: %autorelease Summary: CBOR Encoder/Decoder 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.3 Requires: php-composer(brick/math) >= 0.8.15 Recommends: php-gmp Recommends: php-bcmath # from phpcompatinfo Requires: php-date Requires: php-mbstring Requires: php-spl # for autoloader check BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/php BuildRequires: php(language) >= 7.3 BuildRequires: php-composer(brick/math) >= 0.8.15 %if 0%{?with_tests} # for tests %endif # composer provides Provides: php-composer(%{vendor}/%{project}) = %{version} %description A library to help decode and create objects using the Concise Binary Object Representation (CBOR - RFC7049). 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