Name: gram_grep Summary: Search text using a grammar, lexer, or straight regex Version: 2024.02.17 Release: %autorelease License: BSL-1.0 URL: https://github.com/BenHanson/gram_grep Source: %{url}/archive/%{version}/gram_grep-%{version}.tar.gz BuildRequires: gcc-c++ BuildRequires: make BuildRequires: dos2unix # https://docs.fedoraproject.org/en-US/packaging-guidelines/#_packaging_header_only_libraries BuildRequires: lexertl17-devel BuildRequires: lexertl17-static BuildRequires: parsertl17-devel BuildRequires: parsertl17-static BuildRequires: wildcardtl-devel BuildRequires: wildcardtl-static %description Search text using a grammar, lexer, or straight regex. Chain searches for greater refinement. %prep %autosetup -n gram_grep-%{version} # Fix line terminations (particularly for files that may be installed) find . -type f -exec file '{}' '+' | grep -E '\bCRLF\b' | cut -d ':' -f 1 | xargs -r dos2unix --keepdate %build # Upstream C++ flags are copied from Makefile (which does not support *adding* # flags, only overriding them). Omitted -O, since the distribution flags should # govern the optimization level. Omitted relative paths to header-only # libraries that we have packaged system-wide. export CXXFLAGS="${CXXFLAGS} -std=c++20 -Wall" %make_build CXX="${CXX-g++}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}" %install # Makefile has no install target. install -t '%{buildroot}%{_bindir}' -p -D gram_grep # Upstream does not provide any tests. %files %license LICENCE.txt %doc README.md %doc sample_configs/ %{_bindir}/gram_grep %changelog %autochangelog