## START: Set by rpmautospec
## (rpmautospec version 0.7.1)
## 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:           tree-sitter-cpp
Version:        0.22.3

%global libname lib%{name}
%global summary C++ grammar for Tree-sitter
%global desc    Add support for C++ to Tree-sitter, an incremental parsing system for \
programming tools.


Release:        %autorelease
Summary:        %{summary}
License:        MIT
URL:            https://github.com/tree-sitter/%{name}

Source:         %{url}/archive/v%{version}/%{name}-%{version}.tar.gz

BuildRequires:  gcc
BuildRequires:  libtree-sitter-devel
BuildRequires:  make

%description
%{desc}


%package -n %{libname}
Summary:        %{summary}
Recommends:     libtree-sitter
Enhances:       libtree-sitter

%description -n %{libname}
%{desc}


%package -n %{libname}-devel
Summary:        Development files for %{libname}
Requires:       %{libname}%{?_isa} = %{version}-%{release}

%description -n %{libname}-devel
Libraries and header files for developing applications that use
%{name}.


%prep
%autosetup


%build
%make_build all


%install
%make_install PARSER_REPO_URL=%{url} \
              PREFIX=%{_prefix} INCLUDEDIR=%{_includedir} LIBDIR=%{_libdir}
find $RPM_BUILD_ROOT -name '*.a' -delete


%{?ldconfig_scriptlets}


%files -n %{libname}
%license LICENSE
%doc README.md
%{_libdir}/%{libname}.so.*

%files -n %{libname}-devel
%{_includedir}/*
%{_libdir}/%{libname}.so
%{_libdir}/pkgconfig/*.pc


%changelog
## START: Generated by rpmautospec
* Fri Aug 23 2024 Peter Oliver <git@mavit.org.uk> - 0.22.3-1
- Initial package.
## END: Generated by rpmautospec