Name: gram_grep Summary: Search text using a grammar, lexer, or straight regex Version: 0.9.0 Release: %autorelease # Since dependencies lexertl17, parsertl17, and wildcardtl are header-only, we # must treat them as static libraries, and their licenses contribute to the # license of the binary RPM. All three are BSL-1.0. License: BSL-1.0 URL: https://github.com/BenHanson/gram_grep Source0: %{url}/archive/%{version}/gram_grep-%{version}.tar.gz # Man page hand-written for Fedora in groff_man(7) format based on --help Source1: gram_grep.1 BuildRequires: gcc-c++ BuildRequires: make BuildRequires: dos2unix # https://docs.fedoraproject.org/en-US/packaging-guidelines/#_packaging_header_only_libraries BuildRequires: lexertl17-static BuildRequires: parsertl17-static 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 install -t '%{buildroot}%{_mandir}/man1' -p -D -m 0644 '%{SOURCE1}' # Upstream does not provide any tests. %files %license LICENCE.txt %doc README.md %doc sample_configs/ %{_bindir}/gram_grep %{_mandir}/man1/gram_grep.1* %changelog %autochangelog