# remirepo/fedora spec file for php-bartlett-sarif-php-sdk # # Copyright (c) 2021 Remi Collet # License: CC-BY-SA # http://creativecommons.org/licenses/by-sa/4.0/ # # Please, preserve the changelog entries # # See https://github.com/llaville/sarif-php-sdk/releases %global gh_commit 7f5324fa6bd2a257eacfbd30cb661f9f93abade5 %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner llaville %global gh_project sarif-php-sdk # Namespace %global ns_vendor Bartlett %global ns_project Sarif # Composer %global c_vendor bartlett %global c_project sarif-php-sdk %bcond_without tests %global upstream_version 1.0.0 #global upstream_prever RC1 Name: php-%{c_vendor}-%{c_project} Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} Release: 1%{?dist} Summary: PHP library to create and manipulate SARIF logs License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{upstream_version}%{?upstream_prever}-%{gh_short}.tar.gz BuildArch: noarch BuildRequires: php(language) >= 7.1 BuildRequires: php-cli BuildRequires: php-json BuildRequires: php-pcre BuildRequires: php-spl # For our patch / autoloader BuildRequires: php-fedora-autoloader-devel # From composer.json, "require" # "php": "^7.1|^8.0", # "ext-json": "*", # "ext-pcre": "*", # "ext-spl": "*" Requires: php(language) >= 7.1 Requires: php-json Requires: php-pcre Requires: php-spl # Required by autoloader Requires: php-composer(fedora/autoloader) Provides: php-composer(%{c_vendor}/%{c_project}) = %{version} %description %{summary}. SARIF, the Static Analysis Results Interchange Format, defines a standard format for the output of static analysis tools. It is a powerful and sophisticated format suited to the needs of a wide variety of tools. Documentation: https://llaville.github.io/sarif-php-sdk/ Autoloader: %prep %setup -q -n %{gh_project}-%{gh_commit} %build phpab --template fedora --output src/autoload.php src %install mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project} %check : Ensure our autoloader works php -r ' require "%{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}/autoload.php"; exit (class_exists("Bartlett\\Sarif\\SarifLog") ? 0 : 1);' %files # remirepo:1 %{!?_licensedir:%global license %%doc} %license LICENSE %doc composer.json %doc *.md %dir %{_datadir}/php/%{ns_vendor} %{_datadir}/php/%{ns_vendor}/%{ns_project} %changelog * Thu Dec 16 2021 Remi Collet - 1.0.0-1 - Initial package