File cargo-tauri.spec of Package cargo-tauri
#
# spec file for package cargo-tauri
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: cargo-tauri
Version: 1.4.0
Release: 0
Summary: Build smaller, faster, and more secure desktop applications with a web frontend
License: MIT
Group: Development/Tools/Building
URL: https://github.com/tauri-apps/tauri
Source0: https://github.com/tauri-apps/tauri/archive/tauri-cli-v1.4.0.tar.gz
Source1: vendor.tar.gz
BuildRequires: cargo
Suggests: %{name}-fish-completion
Suggests: %{name}-zsh-completion
%description
Tauri is a polyglot and generic system that is very composable and
allows engineers to make a wide variety of applications. It is used
for building applications for Desktop Computers using a combination
of Rust tools and HTML rendered in a Webview. Apps built with Tauri
can ship with any number of pieces of an optional JS API / Rust API
so that webviews can control the system via message passing. In
fact, developers can extend the default API with their own
functionality and bridge the Webview and Rust-based backend easily
%package zsh-completion
Summary: ZSH completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: (%{name} and zsh)
BuildArch: noarch
%description zsh-completion
zsh shell completions for %{name}.
%package fish-completion
Summary: Fish completion for %{name}
Group: System/Shells
Requires: %{name} = %{version}
Supplements: (%{name} and fish)
BuildArch: noarch
%description fish-completion
Fish command line completion support for %{name}.
%prep
%setup -q -n tauri-tauri-cli-v1.4.0
%build
tar -zxpf %{S:1}
cd tooling/cli
mkdir completions
cargo build --release --frozen
_completion="target/release/%{name} completions --shell"
$_completion fish > "completions/%{name}.fish"
$_completion zsh > "completions/_%{name}"
cargo test --frozen
%install
cd tooling/cli
install -Dm 755 target/release/%{name} %{buildroot}%{_bindir}/%{name}
install -Dm 644 completions/_%{name} %{buildroot}%{_datadir}/zsh/site-functions/_%{name}
install -Dm 644 completions/%{name}.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/%{name}.fish
%files
%license LICENSE_APACHE-2.0 LICENSE_MIT
%doc tooling/cli/README.md
%{_bindir}/%{name}
%files zsh-completion
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_%{name}
%files fish-completion
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/%{name}.fish
%changelog