From 9305599b4a63a6782e4f74b9637d91cd3fa15de5 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 3 Jul 2021 05:35:10 +0200 Subject: [PATCH] Initial package --- .gitignore | 1 + sources | 1 + tree-sitter.spec | 74 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+) create mode 100644 .gitignore create mode 100644 sources create mode 100644 tree-sitter.spec diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b8e77c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/tree-sitter-0.20.0.tar.gz diff --git a/sources b/sources new file mode 100644 index 0000000..519eb43 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (tree-sitter-0.20.0.tar.gz) = a51fa0af45a6a99bb74ff53c15a4d7939eb24c6720e65ec7a96f74ffbce54801f14539e071ec6a4891dae778d7dea5edcecc6dd57716cc70a891c9e6cfa55013 diff --git a/tree-sitter.spec b/tree-sitter.spec new file mode 100644 index 0000000..272fc21 --- /dev/null +++ b/tree-sitter.spec @@ -0,0 +1,74 @@ +Name: tree-sitter +Version: 0.20.0 +Release: 1%{?dist} +Summary: An incremental parsing system for programming tools + +License: MIT +URL: https://tree-sitter.github.io/ +Source0: https://github.com/tree-sitter/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz + +BuildRequires: gcc +BuildRequires: make + + +%description +Tree-sitter is a parser generator tool and an incremental parsing +library. It can build a concrete syntax tree for a source file +and efficiently update the syntax tree as the source file is +edited. Tree-sitter aims to be: + + * General enough to parse any programming language + * Fast enough to parse on every keystroke in a text editor + * Robust enough to provide useful results even in the presence + of syntax errors + * Dependency-free so that the runtime library (which is written + in pure C) can be embedded in any application + +%package -n lib%{name} +Summary: Incremental parsing library for programming tools + +%description -n lib%{name} +Tree-sitter is a parser generator tool and an incremental parsing +library. It can build a concrete syntax tree for a source file +and efficiently update the syntax tree as the source file is +edited. This is the package with the dynamically linked C library. + +%package -n lib%{name}-devel +Summary: Development files for %{name} +Requires: lib%{name} = %{version} + +%description -n lib%{name}-devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%prep +%autosetup -p1 + + +%build +%set_build_flags +export PREFIX='%{_prefix}' LIBDIR='%{_libdir}' +%make_build + + +%install +export PREFIX='%{_prefix}' LIBDIR='%{_libdir}' INCLUDEDIR='%{_includedir}' +%make_install + +find %{buildroot}%{_libdir} -type f \( -name "*.la" -o -name "*.a" \) -delete -print + + +%files -n lib%{name} +%license LICENSE +%doc README.md +%{_libdir}/libtree-sitter.so.0* + +%files -n lib%{name}-devel +%{_includedir}/tree_sitter +%{_libdir}/libtree-sitter.so +%{_libdir}/pkgconfig/tree-sitter.pc + + +%changelog +* Fri Jul 02 2021 Andreas Schneider - 0.20.0-1 +- Initial package