-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
rust-anda-git.spec
79 lines (57 loc) · 1.87 KB
/
rust-anda-git.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Generated by rust2rpm 22
%bcond_without check
%define debug_package %{nil}
%global crate anda
%global _version 0.4.5
Name: rust-anda
Version: %{_version}.%{autogitversion}
Release: 1%{?dist}
Summary: Andaman Build toolchain
License: MIT
URL: https://crates.io/crates/anda
%global version %{_version}
Source: https://github.com/FyraLabs/anda/archive/%{autogitcommit}.tar.gz
ExclusiveArch: %{rust_arches}
BuildRequires: rust-packaging >= 21
BuildRequires: anda-srpm-macros
BuildRequires: openssl-devel
BuildRequires: git-core
Requires: mock
Requires: rpm-build
Requires: createrepo_c
Requires: git-core
%global _description %{expand:
Andaman Build toolchain.}
%description %{_description}
%package -n %{crate}
Summary: %{summary}
%description -n %{crate} %{_description}
%files -n %{crate}
%{_bindir}/anda
%{_mandir}/man1/anda*.1*
%{_sysconfdir}/bash_completion.d/anda.bash
%{_datadir}/zsh/site-functions/_anda
%{_datadir}/fish/completions/anda.fish
%prep
%autosetup -n %{crate}-%{autogitcommit} -p1
%cargo_prep_online
%build
%cargo_build
cargo run --release -p xtask -- manpage
cargo run --release -p xtask -- completion
%install
%cargo_install
mkdir -p %{buildroot}%{_mandir}/man1/
# Install shell completions
COMPDIR="target/assets/completion"
mkdir -p %{buildroot}%{_sysconfdir}/bash_completion.d/
cp -v $COMPDIR/bash/anda.bash %{buildroot}%{_sysconfdir}/bash_completion.d/anda.bash
mkdir -p %{buildroot}%{_datadir}/zsh/site-functions/
cp -v $COMPDIR/zsh/_anda %{buildroot}%{_datadir}/zsh/site-functions/_anda
mkdir -p %{buildroot}%{_datadir}/fish/completions/
cp -v $COMPDIR/fish/anda.fish %{buildroot}%{_datadir}/fish/completions/anda.fish
# install man pages
cp -v target/assets/man_pages/* %{buildroot}%{_mandir}/man1/
rm -rf %{buildroot}%{cargo_registry}
%changelog
%autochangelog