summaryrefslogtreecommitdiffstats
path: root/php-bartlett-sarif-php-sdk.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-bartlett-sarif-php-sdk.spec')
-rw-r--r--php-bartlett-sarif-php-sdk.spec103
1 files changed, 103 insertions, 0 deletions
diff --git a/php-bartlett-sarif-php-sdk.spec b/php-bartlett-sarif-php-sdk.spec
new file mode 100644
index 0000000..25de69d
--- /dev/null
+++ b/php-bartlett-sarif-php-sdk.spec
@@ -0,0 +1,103 @@
+# 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 <remi@remirepo.net> - 1.0.0-1
+- Initial package