## START: Set by rpmautospec ## (rpmautospec version 0.7.2) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 6; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # header-only library %global debug_package %{nil} %bcond tests 1 Name: valijson Version: 1.0.3 Release: %autorelease Summary: Header-only JSON Schema validation library for C++11 %global forgeurl0 https://github.com/tristanpenman/valijson %global forgeurl1 https://github.com/json-schema-org/JSON-Schema-Test-Suite %global tag1 23.2.0 %forgemeta -a License: MIT URL: %forgeurl Source0: %forgesource0 Source1: %forgesource1 # Use system libraries and tools where available. # Don't use or ship `json11`. It has been retired upstream. # Downstream only patch Patch: thirdparty_cleanup.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: cmake BuildRequires: gcc-c++ %if %{with tests} BuildRequires: boost-devel BuildRequires: cmake(gtest) BuildRequires: cmake(jsoncpp) BuildRequires: cmake(nlohmann_json) BuildRequires: cmake(pocojson) BuildRequires: cmake(qt5core) BuildRequires: cmake(rapidjson) BuildRequires: cmake(yaml-cpp) BuildRequires: picojson-devel %endif %global _description %{expand: Valijson provides a simple validation API that allows you to load JSON Schemas, and validate documents loaded by one of several supported parser libraries. The goal of this project is to support validation of all constraints available in JSON Schema v7, while being competitive with the performance of a hand-written schema validator.} %description %_description %package devel Summary: Header files for %{name} Requires: boost-devel Requires: cmake(gtest) Requires: cmake(jsoncpp) Requires: cmake(nlohmann_json) Requires: cmake(pocojson) Requires: cmake(qt5core) Requires: cmake(rapidjson) Requires: cmake(yaml-cpp) Requires: picojson-devel %description devel %{summary} %prep %forgeautosetup -p1 # Move compat/optional.hpp to avoid possible conflict mv include/compat include/valijson sed -r 's|compat/optional.hpp|valijson/compat/optional.hpp|' \ -i include/valijson/internal/optional.hpp # Remove bundled libs (git submodule stubs) rm -rfv thirdparty/* # Install test data tar xzf %{SOURCE1} -C thirdparty mv -v thirdparty/JSON-Schema-Test-Suite-%{tag1} thirdparty/JSON-Schema-Test-Suite # Remove `json11` headers rm -v include/valijson/utils/json11_utils.hpp rm -v include/valijson/adapters/json11_adapter.hpp # Don't turn warnings into errors # Link against system `yaml-cpp` sed -r 's/-Werror ?//' \ -i CMakeLists.txt %build %cmake \ -DCMAKE_BUILD_TYPE=Release \ %{?with_tests:-Dvalijson_BUILD_TESTS:BOOL=ON} %cmake_build --config Release %install %cmake_install %if %{with tests} %check pushd %{__cmake_builddir} # TODO: Investigate failing tests ./test_suite \ --gtest_filter=-*Draft3_Ref:*Draft4_MultipleOf:*Draft7* popd %endif %files devel %doc Authors README.md %license LICENSE %{_includedir}/%{name} %{_libdir}/cmake/%{name} %changelog ## START: Generated by rpmautospec * Tue Oct 01 2024 Sandro - 1.0.3-6 - Exclude i686 * Tue Oct 01 2024 Sandro - 1.0.3-5 - Fix building and running tests * Sun Sep 22 2024 Sandro - 1.0.3-4 - Remove json11 * Sun Sep 22 2024 Sandro - 1.0.3-3 - Prepare for building and running tests * Sun Sep 22 2024 Sandro - 1.0.3-2 - Add dependencies for devel package * Sun Sep 22 2024 Sandro - 1.0.3-1 - Initial package ## END: Generated by rpmautospec