## START: Set by rpmautospec ## (rpmautospec version 0.3.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; 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} # Use clang so that the fuzzers can be built and used as a test until Catch2 v3 # is packaged to Fedora. The fuzzers use a unique fuzzing feature of clang which # is not present in GCC. %global toolchain clang %global forgeurl https://github.com/maxbachmann/rapidfuzz-cpp Version: 1.10.4 %forgemeta Name: rapidfuzz-cpp Release: %{autorelease} License: MIT Summary: A fast string matching header-only library for C++ URL: %{forgeurl} Source: %{forgesource} BuildRequires: cmake BuildRequires: clang BuildRequires: compiler-rt BuildRequires: doxygen # For tests once Catch2 v3 lands in Fedora # https://bugzilla.redhat.com/show_bug.cgi?id=1786881 #BuildRequires: catch-static %global _description %{expand: RapidFuzz is a fast string matching library for Python and C++, which is using the string similarity calculations from FuzzyWuzzy. However there are two aspects that set RapidFuzz apart from FuzzyWuzzy: 1. It is MIT licensed so it can be used whichever License you might want to choose for your project, while you're forced to adopt the GPL license when using FuzzyWuzzy 2. It is mostly written in C++ and on top of this comes with a lot of Algorithmic improvements to make string matching even faster, while still providing the same results. This is the C++ component of RapidFuzz, the Python library is available in the python-rapidfuzz package.} %description %_description %package devel Summary: Development files for the RapidFuzz C++ library Provides: %{name}-static = %{version} %description devel %_description %prep %autosetup %build # Testing needs v3 of Catch2 # %%cmake -DRAPIDFUZZ_BUILD_TESTING=ON # Use the fuzzers as a test of the code build & execution %cmake -DRAPIDFUZZ_BUILD_FUZZERS=ON %cmake_build # Build the doxygen html docs doxygen %install %cmake_install %check # Unittests need v3 of Catch2 # %%ctest # Use the fuzzers as a test of the build & execution cd "%{__cmake_builddir}" for fuzz_exe in fuzzing/fuzz_* do # True fuzz testing would have some known corpus and probably lots more # runs, but here this is used as a simple "smoketest" to confirm things # build and run OK from the library, so limit the runs to something # reasonable. ./$fuzz_exe -runs=1000 done %files devel %license LICENSE %doc README.md CHANGELOG.md %doc doxygen/html %{_includedir}/rapidfuzz %{_libdir}/cmake/rapidfuzz %changelog * Sat Dec 31 2022 Troy Curtis Jr - 1.10.4-3 - Add doxygen API docs and CHANGELOG as documentation. * Sat Dec 31 2022 Troy Curtis Jr - 1.10.4-2 - Use clang to build the fuzzers to use as a package test. * Sun Dec 25 2022 Troy Curtis Jr - 1.10.4-1 - Initial spec file.