## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; 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 Name: gram_grep Summary: Search text using a grammar, lexer, or straight regex Version: 0.9.5 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 # Main source file as of version 0.9.0; we use this for “smoke testing,” so we # need a copy that does not change every time we ship an update. This does # *not* contribute to the binary RPMs. Source2: main-0.9.0.cpp # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: gcc-c++ BuildRequires: cmake # Ninja is a little faster than make and has no disadvantages. BuildRequires: ninja-build BuildRequires: dos2unix BuildRequires: boost-devel # 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 # Remove include paths for unbundled header-only library dependencies sed -r -i 's@^([[:blank:]]*)(include_directories.*"\.\./)@\1# \2@' \ CMakeLists.txt %conf %cmake -GNinja %build %cmake_build %install # The CMake build system has no provision for installing the program, so # %%cmake_install would do nothing. We must install the executable manually. install -t '%{buildroot}%{_bindir}' -p -D %{_vpath_builddir}/gram_grep install -t '%{buildroot}%{_mandir}/man1' -p -D -m 0644 '%{SOURCE1}' %check # Upstream does not provide any tests. We use a few of the examples from # http://benhanson.net/gram_grep.html as “smoke tests.” # Make sure the program can at least print its help text and exit successfully %{buildroot}%{_bindir}/gram_grep --help >/dev/null # Copy in a fixed version of main.cpp (as of version 0.9.0) as a sample file to # process. By doing this instead of operating on the actual main.cpp, the # output from our “smoke tests” does not change with each update. cp -p '%{SOURCE2}' _x.cpp assert_same() { # Parameters: actual, expected set -o nounset set -o errexit if [ "${1}" != "${2}" ] then cat 1>&2 < - 0.9.5-1 - Update to 0.9.5 (close RHBZ#2351789) * Wed Feb 26 2025 Benjamin A. Beasley - 0.9.4-1 - Update to 0.9.4 (close RHBZ#2348431) * Thu Feb 20 2025 Benjamin A. Beasley - 0.9.3-1 - Update to 0.9.3 (close RHBZ#2346745) * Mon Feb 17 2025 Benjamin A. Beasley - 0.9.2-1 - Update to 0.9.2 (close RHBZ#2346003) * Sun Feb 09 2025 Benjamin A. Beasley - 0.9.1-1 - Update to 0.9.1 (close RHBZ#2344499) * Sat Feb 01 2025 Benjamin A. Beasley - 0.9.0-4 - Do not build for i686 (leaf package) * Sat Feb 01 2025 Benjamin A. Beasley - 0.9.0-3 - Switch from plain makefiles to CMake * Sat Feb 01 2025 Benjamin A. Beasley - 0.9.0-2 - Add some messy but useful “smoke tests” based on documented examples * Sat Feb 01 2025 Benjamin A. Beasley - 0.9.0-1 - Initial package (close RHBZ#2264773) ## END: Generated by rpmautospec