From 75c85087cbcd998ef2ca5ca1e558db9747116f0b Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 16 Dec 2021 18:56:36 +0100 Subject: new package --- .gitignore | 9 ++++ Makefile | 4 ++ composer.json | 36 ++++++++++++++ php-bartlett-sarif-php-sdk.spec | 103 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 152 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 composer.json create mode 100644 php-bartlett-sarif-php-sdk.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..01f0400 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +clog +package-*.xml +*.tgz +*.tar.bz2 +*.tar.gz +*.tar.xz +*.tar.xz.asc +*.src.rpm +*/*rpm diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..13af741 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +SRCDIR := $(shell pwd) +NAME := $(shell basename $(SRCDIR)) +include ../../../common/Makefile + diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..1d36357 --- /dev/null +++ b/composer.json @@ -0,0 +1,36 @@ +{ + "name": "bartlett/sarif-php-sdk", + "description": "PHP library to create and manipulate SARIF logs", + "keywords": ["sarif"], + "type": "library", + "license": "MIT", + "support": { + "source": "https://github.com/llaville/sarif-php-sdk", + "issues": "https://github.com/llaville/sarif-php-sdk/issues" + }, + "require": { + "php": "^7.1|^8.0", + "ext-json": "*", + "ext-pcre": "*", + "ext-spl": "*" + }, + "authors": [ + { + "name": "Laurent Laville", + "email": "pear@laurent-laville.org", + "homepage": "https://github.com/llaville", + "role": "Lead" + } + ], + "autoload": { + "psr-4": { + "Bartlett\\Sarif\\": "src/" + } + }, + "minimum-stability": "stable", + "prefer-stable": true, + "config": { + "sort-packages": true, + "optimize-autoloader": true + } +} 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 - 1.0.0-1 +- Initial package -- cgit