Skip to content

Commit

Permalink
add: rust-bottom (#1961)
Browse files Browse the repository at this point in the history
(cherry picked from commit d8c5842)
  • Loading branch information
woodsb02 authored and raboneko committed Aug 19, 2024
1 parent 45fae30 commit 897b957
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 0 deletions.
5 changes: 5 additions & 0 deletions anda/langs/rust/bottom/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "rust-bottom.spec"
}
}
48 changes: 48 additions & 0 deletions anda/langs/rust/bottom/bottom-fix-metadata-auto.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
--- bottom-0.10.2/Cargo.toml 1970-01-01T00:00:01+00:00
+++ bottom-0.10.2/Cargo.toml 2024-08-18T14:28:49.594610+00:00
@@ -354,15 +354,6 @@
[target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dev-dependencies.portable-pty]
version = "0.8.1"

-[target.'cfg(target_os = "freebsd")'.dependencies.filedescriptor]
-version = "0.8.2"
-
-[target.'cfg(target_os = "freebsd")'.dependencies.serde_json]
-version = "1.0.120"
-
-[target.'cfg(target_os = "freebsd")'.dependencies.sysctl]
-version = "0.5.5"
-
[target.'cfg(target_os = "linux")'.dependencies.rustix]
version = "0.38.34"
features = [
@@ -370,24 +361,6 @@
"param",
]

-[target.'cfg(target_os = "macos")'.dependencies.core-foundation]
-version = "0.9.4"
-
-[target.'cfg(target_os = "macos")'.dependencies.mach2]
-version = "0.4.2"
-
-[target.'cfg(target_os = "windows")'.dependencies.windows]
-version = "0.58.0"
-features = [
- "Win32_Foundation",
- "Win32_Security",
- "Win32_Storage_FileSystem",
- "Win32_System_IO",
- "Win32_System_Ioctl",
- "Win32_System_ProcessStatus",
- "Win32_System_Threading",
-]
-
[target."cfg(unix)".dependencies.libc]
version = "0.2.155"

@@ -402,3 +375,4 @@
[lints.rustdoc]
broken_intra_doc_links = "deny"
missing_crate_level_docs = "deny"
+
68 changes: 68 additions & 0 deletions anda/langs/rust/bottom/rust-bottom.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Generated by rust2rpm 26
%bcond_without check

%global crate bottom

Name: rust-bottom
Version: 0.10.2
Release: %autorelease
Summary: Customizable cross-platform graphical process/system monitor for the terminal

License: MIT
URL: https://crates.io/crates/bottom
Source: %{crates_source}
# Automatically generated patch to strip dependencies and normalize metadata
Patch: bottom-fix-metadata-auto.diff

BuildRequires: anda-srpm-macros
BuildRequires: cargo-rpm-macros >= 24

%global _description %{expand:
A customizable cross-platform graphical process/system monitor for the
terminal. Supports Linux, macOS, and Windows.}

%description %{_description}

%package -n %{crate}
Summary: %{summary}
License: MIT
Packager: Ben Woods <[email protected]>

%description -n %{crate} %{_description}

%files -n %{crate}
%license LICENSE
%license LICENSE.dependencies
%doc README.md
%{_bindir}/btm
%{_datadir}/bash-completion/completions/btm
%{_datadir}/fish/vendor_completions.d/btm.fish
%{_datadir}/zsh/site-functions/_btm
%{_mandir}/man1/btm.1*

%prep
%autosetup -n %{crate}-%{version} -p1
%cargo_prep_online

%build
#cargo_build
%{cargo_license_summary_online}
%{cargo_license_online} > LICENSE.dependencies

%install
# https://github.com/ClementTsang/bottom/blob/main/docs/content/contribution/packaging-and-distribution.md#manpage-and-completion-generation
export BTM_GENERATE=true
%cargo_install
# Completions
install -Dpm 0644 target/tmp/bottom/completion/btm.bash %{buildroot}%{_datadir}/bash-completion/completions/btm
install -Dpm 0644 target/tmp/bottom/completion/btm.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/btm.fish
install -Dpm 0644 target/tmp/bottom/completion/_btm %{buildroot}%{_datadir}/zsh/site-functions/_btm
install -Dpm 0644 target/tmp/bottom/manpage/btm.1 %{buildroot}%{_mandir}/man1/btm.1

%if %{with check}
%check
%cargo_test
%endif

%changelog
%autochangelog
1 change: 1 addition & 0 deletions anda/langs/rust/bottom/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm.version(crates("bottom"));

0 comments on commit 897b957

Please sign in to comment.