You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rust-tree-sitter/rust-tree-sitter.spec

99 lines
2.7 KiB

# Generated by rust2rpm 21
%bcond_without check
%global debug_package %{nil}
%global crate tree-sitter
Name: rust-%{crate}
Version: 0.20.6
Release: %autorelease
Summary: Rust bindings to the Tree-sitter parsing library
# Upstream license specification: MIT
# Bundled ICU sources: Unicode
License: MIT and Unicode
URL: https://crates.io/crates/tree-sitter
Source: %{crates_source}
# Upstream license file - tree-sitter/tree-sitter#1520
Source1: https://github.com/tree-sitter/tree-sitter/raw/v%{version}/LICENSE#/LICENSE.upstream
# tree-sitter/tree-sitter#1524 modified to apply to the crate source
Patch0: binding_rust-regenerate-bindings-during-build.patch
# fix tree-sitter-cli tests on s390x - tree-sitter/tree-sitter#1692
Patch1: lib-fix-incorrect-int-ptr-cast-on-big-endian-archite.patch
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging >= 21
%global _description %{expand:
Rust bindings to the Tree-sitter parsing library.}
%description %{_description}
%package devel
Summary: %{summary}
BuildArch: noarch
# The create contains a bundled copy of the tree-sitter C library.
Provides: bundled(tree-sitter) = %{version}
# The tree-sitter C library contains a small subset of files from the ICU library
Provides: bundled(icu) = 65.1
%description devel %{_description}
This package contains library source intended for building other packages which
use the "%{crate}" crate.
%files devel
%license %{crate_instdir}/LICENSE
%license %{crate_instdir}/src/unicode/LICENSE
%{crate_instdir}/
%package -n %{name}+default-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+default-devel %{_description}
This package contains library source intended for building other packages which
use the "default" feature of the "%{crate}" crate.
%files -n %{name}+default-devel
%ghost %{crate_instdir}/Cargo.toml
%package -n %{name}+lazy_static-devel
Summary: %{summary}
BuildArch: noarch
%description -n %{name}+lazy_static-devel %{_description}
This package contains library source intended for building other packages which
use the "lazy_static" feature of the "%{crate}" crate.
%files -n %{name}+lazy_static-devel
%ghost %{crate_instdir}/Cargo.toml
%prep
%autosetup -n %{crate}-%{version_no_tilde} -p1
%cargo_prep
# drop pre-generated bindings; we don't want to accidentally use these
rm -f binding_rust/bindings.rs
%generate_buildrequires
%cargo_generate_buildrequires
%build
%cargo_build
%install
%cargo_install
# prepare upstream license file for %%license
install -D -m 0644 -pv %{SOURCE1} %{buildroot}%{crate_instdir}/LICENSE
%if %{with check}
%check
%cargo_test
%endif
%changelog
%autochangelog