Ajout du validateur json + correctif factory metadata
This commit is contained in:
1
lib/All/json-schema-validator/.distro/.fmf/version
Normal file
1
lib/All/json-schema-validator/.distro/.fmf/version
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,61 @@
|
||||
Name: json-schema-validator
|
||||
Summary: JSON schema validator for JSON for Modern C++
|
||||
Version: 0.0.0
|
||||
Release: %autorelease
|
||||
License: MIT
|
||||
URL: https://github.com/pboettch/json-schema-validator
|
||||
|
||||
Source: https://github.com/pboettch/json-schema-validator/archive/refs/tags/v%{version}.tar.gz
|
||||
|
||||
BuildRequires: ninja-build
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: json-devel
|
||||
|
||||
%description
|
||||
Json schema validator library for C++ projects using nlohmann/json
|
||||
|
||||
%package devel
|
||||
Summary: Development files for JSON schema validator
|
||||
Requires: json-schema-validator%{?_isa} = %{version}-%{release}
|
||||
Requires: json-devel
|
||||
|
||||
%description devel
|
||||
Json schema validator development files for C++ projects using nlohmann/json
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n json-schema-validator-%{version}
|
||||
|
||||
|
||||
%build
|
||||
%cmake \
|
||||
-DJSON_VALIDATOR_SHARED_LIBS=ON \
|
||||
-DJSON_VALIDATOR_INSTALL=ON \
|
||||
-DJSON_VALIDATOR_BUILD_EXAMPLES=OFF \
|
||||
-DJSON_VALIDATOR_BUILD_TESTS=ON
|
||||
|
||||
%cmake_build
|
||||
|
||||
|
||||
%install
|
||||
%cmake_install
|
||||
|
||||
|
||||
%check
|
||||
%ctest
|
||||
|
||||
|
||||
%files
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
%{_libdir}/libnlohmann_json_schema_validator.so.*
|
||||
|
||||
%files devel
|
||||
%{_libdir}/libnlohmann_json_schema_validator.so
|
||||
%{_includedir}/nlohmann/json-schema.hpp
|
||||
%{_libdir}/cmake/nlohmann_json_schema_validator
|
||||
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
12
lib/All/json-schema-validator/.distro/plans/import.fmf
Normal file
12
lib/All/json-schema-validator/.distro/plans/import.fmf
Normal file
@@ -0,0 +1,12 @@
|
||||
summary:
|
||||
Basic importing tests
|
||||
prepare+:
|
||||
- name: Include minimum fetching packages
|
||||
how: install
|
||||
package:
|
||||
- git
|
||||
discover+:
|
||||
how: fmf
|
||||
filter: "tag: import"
|
||||
execute:
|
||||
how: tmt
|
||||
@@ -0,0 +1,10 @@
|
||||
discover:
|
||||
how: fmf
|
||||
path: .
|
||||
|
||||
adjust+:
|
||||
# Cannot use initiator: fedora-ci reliably yet
|
||||
when: initiator is not defined or initiator != packit
|
||||
discover+:
|
||||
dist-git-source: true
|
||||
dist-git-extract: json-schema-validator-*/
|
||||
7
lib/All/json-schema-validator/.distro/plans/smoke.fmf
Normal file
7
lib/All/json-schema-validator/.distro/plans/smoke.fmf
Normal file
@@ -0,0 +1,7 @@
|
||||
summary:
|
||||
Basic smoke tests
|
||||
discover+:
|
||||
how: fmf
|
||||
filter: "tag: smoke"
|
||||
execute:
|
||||
how: tmt
|
||||
@@ -0,0 +1,15 @@
|
||||
# This is a simple project that tests using cmake to load the installed libraries
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(test_fetch_content LANGUAGES CXX)
|
||||
|
||||
|
||||
FetchContent_Declare(nlohmann_json_schema_validator
|
||||
GIT_REPOSITORY https://github.com/pboettch/json-schema-validator
|
||||
GIT_TAG main
|
||||
)
|
||||
FetchContent_MakeAvailable(nlohmann_json_schema_validator)
|
||||
|
||||
if (NOT TARGET nlohmann_json_schema_validator::validator)
|
||||
message(FATAL_ERROR "Missing target nlohmann_json_schema_validator::validator")
|
||||
endif ()
|
||||
@@ -0,0 +1,11 @@
|
||||
# This is a simple project that tests using cmake to load the installed libraries
|
||||
cmake_minimum_required(VERSION 3.14)
|
||||
|
||||
project(test_find_package LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_FIND_DEBUG_MODE ON)
|
||||
find_package(nlohmann_json_schema_validator REQUIRED)
|
||||
|
||||
if (NOT TARGET nlohmann_json_schema_validator::validator)
|
||||
message(FATAL_ERROR "Missing target nlohmann_json_schema_validator::validator")
|
||||
endif ()
|
||||
11
lib/All/json-schema-validator/.distro/tests/import/main.fmf
Normal file
11
lib/All/json-schema-validator/.distro/tests/import/main.fmf
Normal file
@@ -0,0 +1,11 @@
|
||||
# Common test variables
|
||||
tag:
|
||||
- import
|
||||
tier: 0
|
||||
path: /tests/import
|
||||
|
||||
# Define tests
|
||||
/find_package:
|
||||
test: ./test_find_package.sh
|
||||
/FetchContent:
|
||||
test: ./test_FetchContent.sh
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash -eux
|
||||
|
||||
tmp_dir=$(mktemp -d)
|
||||
cmake -S ./FetchContent -B ${tmp_dir}
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash -eux
|
||||
|
||||
tmp_dir=$(mktemp -d)
|
||||
cmake -S ./find_package -B ${tmp_dir}
|
||||
9
lib/All/json-schema-validator/.distro/tests/smoke.fmf
Normal file
9
lib/All/json-schema-validator/.distro/tests/smoke.fmf
Normal file
@@ -0,0 +1,9 @@
|
||||
# Common test variables
|
||||
tag:
|
||||
- smoke
|
||||
tier: 0
|
||||
path: /
|
||||
|
||||
# Define tests
|
||||
/version:
|
||||
test: echo "TODO: Write a minimum working example"
|
||||
Reference in New Issue
Block a user