diff --git a/anda/langs/rust/typstyle/anda.hcl b/anda/langs/rust/typstyle/anda.hcl new file mode 100644 index 0000000000..8ac84d9503 --- /dev/null +++ b/anda/langs/rust/typstyle/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "rust-typstyle.spec" + } +} diff --git a/anda/langs/rust/typstyle/rust-typstyle.spec b/anda/langs/rust/typstyle/rust-typstyle.spec new file mode 100644 index 0000000000..60722a3499 --- /dev/null +++ b/anda/langs/rust/typstyle/rust-typstyle.spec @@ -0,0 +1,64 @@ +# Generated by rust2rpm 27 +%bcond check 1 + +%global crate typstyle + +Name: rust-typstyle +Version: 0.14.0 +Release: 1%?dist +Summary: CLI for Typstyle + +License: Apache-2.0 +URL: https://crates.io/crates/typstyle +Source: %{crates_source} +Source1: https://raw.githubusercontent.com/typstyle-rs/typstyle/v%{version}/LICENSE +Packager: metcya + +BuildRequires: anda-srpm-macros rust-packaging >= 24 mold + +%global _description %{expand: +The CLI for Typstyle.} + +%description %{_description} + +%package -n %{crate} +Summary: %{summary} +License: Apache-2.0 + +%description -n %{crate} %{_description} + +%files -n %{crate} +%license LICENSE +%license LICENSE.dependencies +%doc README.md +%{_bindir}/typstyle + +%pkg_completion -Bzfn %{crate} + +%prep +%autosetup -n %{crate}-%{version} -p1 +cp %{S:1} LICENSE +%cargo_prep_online + +%build +%{cargo_license_summary_online} +%{cargo_license_online} > LICENSE.dependencies +%cargo_build +mkdir -p completions +for shell in bash zsh fish; do + target/rpm/%{crate} completions $shell > completions/%{crate}-completion.$shell +done + +%install +%crate_install_bin +install -Dm644 "completions/%{crate}-completion.bash" "%{buildroot}/%{bash_completions_dir}/%{crate}" +install -Dm644 "completions/%{crate}-completion.zsh" "%{buildroot}/%{zsh_completions_dir}/_%{crate}" +install -Dm644 "completions/%{crate}-completion.fish" "%{buildroot}/%{fish_completions_dir}/%{crate}.fish" + +%if %{with check} +%check +%cargo_test +%endif + +%changelog +%autochangelog diff --git a/anda/langs/rust/typstyle/update.rhai b/anda/langs/rust/typstyle/update.rhai new file mode 100644 index 0000000000..c6e814f121 --- /dev/null +++ b/anda/langs/rust/typstyle/update.rhai @@ -0,0 +1 @@ +rpm.version(crates("typstyle"));