# Generated by rust2rpm 27 (originally, but heavily modified) %global __requires_exclude_from ^%{bash_completions_dir}/.*$ %global __requires_exclude_from ^%{fish_completions_dir}/.*$ %global __requires_exclude_from ^%{zsh_completions_dir}/.*$ %global debug_package %{nil} %define git_url https://github.com/%{name}sh/%{name} %ifarch x86_64 %define build_target x86_64-unknown-linux-gnu %else %define build_target aarch64-unknown-linux-gnu %endif Name: atuin Version: 18.10.0 Release: 1%{?dist} Summary: ✨ Magical shell history License: MIT URL: https://atuin.sh/ Source: %{git_url}/releases/download/v%{version}/source.tar.gz#/%{name}-v%{version}_source.tar.gz BuildRequires: rust cargo %description Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. Additionally, it provides optional and fully encrypted synchronisation of your history between machines, via an Atuin server. %prep %autosetup -n ./%{name}-%{version} %build export CARGO_HOME="$(realpath ./.cargo)" # Build atuin cargo build "-j$(nproc)" --profile dist --target %build_target # # Generate a clean dependency graph # cargo tree --workspace --edges 'no-build,no-dev,no-proc-macro' \ # --no-dedupe --target all --prefix none \ # --format '# {l}' | # sed -e "s: / :/:g" -e "s:/: OR :g" | # sort -u # Generate a LICENSE file for all cargo dependencies cargo tree --workspace --edges 'no-build,no-dev,no-proc-macro' \ --no-dedupe --target all --prefix none \ --format '{l}: {p}' | sed -e "s: ($(pwd)[^)]*)::g" -e 's: / :/:g' -e 's:/: OR :g' | sort -u > ./LICENSE.dependencies %install # Create important directories in the buildroot install -d %{buildroot}{%{_bindir},%{bash_completions_dir},%{fish_completions_dir},%{zsh_completions_dir}} # install atuin target_exe='./target/%{build_target}/dist/%{name}' install -Dm 0755 "$target_exe" -t %{buildroot}%{_bindir} # generate completions "$target_exe" gen-completions --shell bash > ./%{name}.bash "$target_exe" gen-completions --shell fish > ./%{name}.fish "$target_exe" gen-completions --shell zsh > ./%{name}.zsh # install completions install -Dm 0644 ./%{name}.bash %{buildroot}%{bash_completions_dir}/%{name} install -Dm 0644 ./%{name}.fish -t %{buildroot}%{fish_completions_dir} install -Dm 0644 ./%{name}.zsh %{buildroot}%{zsh_completions_dir}/_%{name} %files %{_bindir}/%{name} %{bash_completions_dir}/%{name} %{fish_completions_dir}/%{name}.fish %{zsh_completions_dir}/_%{name} %license ./LICENSE ./LICENSE.dependencies %doc ./README.md %changelog %autochangelog