## START: Set by rpmautospec ## (rpmautospec version 0.8.5) ## 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-sql Version: 0.3.11 Release: %autorelease License: MIT URL: https://github.com/DerekStride/%{name} Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz # https://github.com/DerekStride/tree-sitter-sql/commit/fdd66517 Patch0: 0001-fix-build-Don-t-pin-cc-to-1.2.x.patch BuildRequires: nodejs BuildSystem: tree_sitter %{tree_sitter -P -l SQL} %build -a # Makefile lacks a standard library target; build properly named shared library SONAME_MAJOR=$(sed -n 's/#define LANGUAGE_VERSION //p' src/parser.c) gcc %{build_cflags} %{build_ldflags} -shared -fPIC -Isrc -std=c11 \ -Wl,-soname,libtree-sitter-sql.so.${SONAME_MAJOR} \ -o libtree-sitter-sql.so.${SONAME_MAJOR}.0 \ src/parser.c src/scanner.c %install SONAME_MAJOR=$(sed -n 's/#define LANGUAGE_VERSION //p' src/parser.c) install -d %{buildroot}%{_libdir} install -m755 libtree-sitter-sql.so.${SONAME_MAJOR}.0 %{buildroot}%{_libdir}/ ln -sf libtree-sitter-sql.so.${SONAME_MAJOR}.0 %{buildroot}%{_libdir}/libtree-sitter-sql.so.${SONAME_MAJOR} ln -sf libtree-sitter-sql.so.${SONAME_MAJOR} %{buildroot}%{_libdir}/libtree-sitter-sql.so install -d %{buildroot}%{_includedir}/tree_sitter install -m644 bindings/c/tree_sitter/tree-sitter-sql.h %{buildroot}%{_includedir}/tree_sitter/ install -d %{buildroot}%{_libdir}/pkgconfig sed -e 's|@PROJECT_VERSION@|%{version}|' \ -e 's|@CMAKE_INSTALL_LIBDIR@|%{_lib}|' \ -e 's|@CMAKE_INSTALL_INCLUDEDIR@|include|' \ -e 's|@PROJECT_DESCRIPTION@|Tree-sitter Grammar for SQL|' \ -e 's|@PROJECT_HOMEPAGE_URL@|%{url}|' \ -e 's|@CMAKE_INSTALL_PREFIX@|%{_prefix}|' \ bindings/c/tree-sitter-sql.pc.in > %{buildroot}%{_libdir}/pkgconfig/tree-sitter-sql.pc install -d %{buildroot}%{_datadir}/tree-sitter/queries/sql install -m644 queries/*.scm %{buildroot}%{_datadir}/tree-sitter/queries/sql/ find %{buildroot} -name '*.a' -delete %pyproject_install %pyproject_save_files tree_sitter_sql %changelog ## START: Generated by rpmautospec * Mon Oct 19 2026 John Doe - 0.3.11-1 - Uncommitted changes ## END: Generated by rpmautospec