# fedora spec file for php-beberlei-assert # # Copyright (c) 2020 Christopher Engelhard # License: MIT # # Please preserve the changelog entries # package and composer name %global vendor beberlei %global project assert # PHP namespace and directory %global ns_project Assert %global ns_dir %( echo "%{ns_project}" | sed 's|\\\\|\/|g' ) # Github %global gh_vendor beberlei %global gh_project assert %global commit 5e721d7e937ca3ba2cdec1e1adf195f9e5188372 %global scommit %(c=%{commit}; echo ${c:0:7}) # tests %global with_tests 1 #-- PREAMBLE ------------------------------------------------------------------# Name: php-%{vendor}-%{project} Version: 3.3.1 Release: %autorelease Summary: Thin assertion library for input validation in business models License: BSD 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.0 Requires: php-simplexml Requires: php-mbstring Requires: php-ctype Requires: php-json Recommends: php-intl # from phpcompatinfo Requires: php-date Requires: php-filter Requires: php-pcre Requires: php-reflection Requires: php-spl # for autoloader check BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/php BuildRequires: php(language) >= 7.0 %if 0%{?with_tests} # for tests %endif # composer provides Provides: php-composer(%{vendor}/%{project}) = %{version} %description A simple php library which contains assertions and guard methods for input validation (not filtering!) in business-model, libraries and application low-level code. The library can be used to implement pre-/post-conditions on input data. 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 lib/Assert/* %{buildroot}%{_datadir}/php/%{ns_dir} : Generate an autoloader cat <<'EOF' | tee %{buildroot}%{_datadir}/php/%{ns_dir}/autoload.php