# fedora spec file for php-giggsey-libphonenumber-for-php # # Copyright (c) 2020 Christopher Engelhard # License: MIT # # Please preserve the changelog entries # package and composer name %global vendor giggsey %global project libphonenumber-for-php # PHP namespace and directory %global ns_project libphonenumber %global ns_dir %( echo "%{ns_project}" | sed 's|\\\\|\/|g' ) # Github %global gh_vendor giggsey %global gh_project libphonenumber-for-php %global commit f4d3aab2d2f7e0f82381303019be77fd22c49efe %global scommit %(c=%{commit}; echo ${c:0:7}) # tests %global with_tests 1 #-- PREAMBLE ------------------------------------------------------------------# Name: php-%{vendor}-%{project} Version: 8.12.27 Release: %autorelease Summary: PHP Port of Google's libphonenumber License: ASL 2.0 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) >= 5.3.2 Requires: php-mbstring Requires: php-composer(giggsey/locale) >= 1.7 # from phpcompatinfo Requires: php-pcre Requires: php-spl # for autoloader check BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/php BuildRequires: php-composer(giggsey/locale) >= 1.7 BuildRequires: php(language) >= 5.3.2 %if 0%{?with_tests} # for tests %endif # composer provides Provides: php-composer(%{vendor}/%{project}) = %{version} %description A PHP library for parsing, formatting, storing and validating international phone numbers. This library is based on Google's libphonenumber. 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