# fedora spec file for php-league-uri-interfaces # # Copyright (c) 2020 Christopher Engelhard # License: MIT # # Please preserve the changelog entries # package and composer name %global vendor league %global project uri-interfaces # PHP namespace and directory %global ns_project League\\Uri %global ns_dir League/UriInterfaces # Github %global gh_vendor thephpleague %global gh_project uri-interfaces %global commit 00e7e2943f76d8cb50c7dfdc2f6dee356e15e383 %global scommit %(c=%{commit}; echo ${c:0:7}) # tests %global with_tests 1 #-- PREAMBLE ------------------------------------------------------------------# Name: php-%{vendor}-%{project} Version: 2.3.0 Release: %autorelease Summary: Common interface for URI representation License: GPLv3+ 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 Recommends: php-intl # from phpcompatinfo Requires: php-pcre Requires: php-spl # for autoloader check BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/php BuildRequires: php(language) >= 7.2 %if 0%{?with_tests} # for tests %endif # composer provides Provides: php-composer(%{vendor}/%{project}) = %{version} %description Package containing an interface to represents URI objects according to RFC 3986. 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