From 87461589fbea195bd200d90145be2a14d4891323 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 12 Sep 2019 12:35:42 +0200 Subject: new package --- php-swaggest-json-diff.spec | 116 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 php-swaggest-json-diff.spec (limited to 'php-swaggest-json-diff.spec') diff --git a/php-swaggest-json-diff.spec b/php-swaggest-json-diff.spec new file mode 100644 index 0000000..f0a6adc --- /dev/null +++ b/php-swaggest-json-diff.spec @@ -0,0 +1,116 @@ +# remirepo/fedora spec file for php-swaggest-json-diff +# +# Copyright (c) 2019 Remi Collet +# License: CC-BY-SA +# http://creativecommons.org/licenses/by-sa/4.0/ +# +# Please, preserve the changelog entries +# + +%global with_tests 0%{!?_without_tests:1} +# Github +%global gh_commit 53c412ad8e3fc1293d4e6fdf06f7839698ad897d +%global gh_short %(c=%{gh_commit}; echo ${c:0:7}) +%global gh_owner swaggest +%global gh_project json-diff +# Packagist +%global pk_vendor %{gh_owner} +%global pk_project %{gh_project} +# Namespace +%global ns_vendor Swaggest +%global ns_project JsonDiff +%global major %nil + +Name: php-%{pk_vendor}-%{pk_project}%{major} +Version: 3.7.0 +Release: 1%{?gh_date?%{gh_date}git%{gh_short}}%{?dist} +Summary: JSON diff/rearrange/patch/pointer library for PHP + +License: MIT +URL: https://github.com/%{gh_owner}/%{gh_project} +Source0: %{name}-%{version}-%{?gh_short}.tgz +Source1: makesrc.sh + +BuildArch: noarch +%if %{with_tests} +BuildRequires: php-json +# For tests, from composer.json "require-dev": { +# "phpunit/phpunit": "^4.8.23", +# "phpunit/php-code-coverage": "2.2.4", +# "codeclimate/php-test-reporter": "^0.4.0" +BuildRequires: php-composer(phpunit/phpunit) >= 4.8.23 +%global phpunit %{_bindir}/phpunit +BuildRequires: php-filter +BuildRequires: php-pcre +# For autoloader +BuildRequires: php-fedora-autoloader-devel +%endif + +# From composer.json, "require": { +# "ext-json": "*" +Requires: php-json +# From phpcompatinfo report for 3.7.0 +Requires: php-filter +Requires: php-pcre +# For generated autoloader +Requires: php-composer(fedora/autoloader) + +# Composer +Provides: php-composer(%{pk_vendor}/%{pk_project}) = %{version} + + +%description +A PHP implementation for finding unordered diff between two JSON documents. + +Autoloader: %{_datadir}/php/%{ns_vendor}/%{ns_project}%{major}/autoload.php + + +%prep +%setup -q -n %{gh_project}-%{gh_commit} + + +%build +: Create autoloader +%{_bindir}/phpab -t fedora -o src/autoload.php src + + +%install +: Library +mkdir -p %{buildroot}%{_datadir}/php/%{ns_vendor} +cp -pr src %{buildroot}%{_datadir}/php/%{ns_vendor}/%{ns_project}%{major} + + +%check +%if %{with_tests} +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php + - 3.7.0-1 +- initial package -- cgit