From 02c67351a6367fb98a68e657d69950a65c2f17e4 Mon Sep 17 00:00:00 2001 From: madomado Date: Thu, 22 May 2025 18:25:17 +0800 Subject: [PATCH] add: usage (#4987) --- anda/langs/rust/usage/anda.hcl | 5 ++ anda/langs/rust/usage/rust-usage-cli.spec | 77 +++++++++++++++++++++++ anda/langs/rust/usage/update.rhai | 1 + 3 files changed, 83 insertions(+) create mode 100644 anda/langs/rust/usage/anda.hcl create mode 100644 anda/langs/rust/usage/rust-usage-cli.spec create mode 100644 anda/langs/rust/usage/update.rhai diff --git a/anda/langs/rust/usage/anda.hcl b/anda/langs/rust/usage/anda.hcl new file mode 100644 index 0000000000..30b76ddd07 --- /dev/null +++ b/anda/langs/rust/usage/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "rust-usage-cli.spec" + } +} diff --git a/anda/langs/rust/usage/rust-usage-cli.spec b/anda/langs/rust/usage/rust-usage-cli.spec new file mode 100644 index 0000000000..e9bfe17d65 --- /dev/null +++ b/anda/langs/rust/usage/rust-usage-cli.spec @@ -0,0 +1,77 @@ +# Generated by rust2rpm 27 +%bcond check 1 + +%global crate usage-cli + +Name: rust-usage-cli +Version: 2.1.1 +Release: %autorelease +Summary: CLI for working with usage-based CLIs + +License: MIT +URL: https://crates.io/crates/usage-cli +Source: %{crates_source} +Source1: https://raw.githubusercontent.com/jdx/usage/refs/tags/v%version/LICENSE +Packager: madonuko + +BuildRequires: cargo-rpm-macros >= 24 + +%global _description %{expand: +CLI for working with usage-based CLIs.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +License: (0BSD OR MIT OR Apache-2.0) AND Apache-2.0 AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND BSD-3-Clause AND ISC AND MIT AND (MIT OR Apache-2.0) AND (MIT OR Zlib OR Apache-2.0) AND (Unlicense OR MIT) +# LICENSE.dependencies contains a full license breakdown +Provides: usage = %version-%release + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.dependencies +%{_bindir}/usage + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel %{_description} + +This package contains library source intended for building other packages which +use the "%{crate}" crate. + +%files devel +%license 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 + +%prep +%autosetup -n %{crate}-%{version} -p1 +cp %{S:1} . +%cargo_prep_online + +%build +%{cargo_license_summary_online} +%{cargo_license_online} > LICENSE.dependencies + +%install +%cargo_install + +%if %{with check} +%check +%cargo_test +%endif diff --git a/anda/langs/rust/usage/update.rhai b/anda/langs/rust/usage/update.rhai new file mode 100644 index 0000000000..5b57173e1a --- /dev/null +++ b/anda/langs/rust/usage/update.rhai @@ -0,0 +1 @@ +rpm.version(crates("usage-cli"));