Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions anda/multimedia/ncspot/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "ncspot.spec"
}
}
58 changes: 58 additions & 0 deletions anda/multimedia/ncspot/ncspot.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
%global crate ncspot
%global cargo_features cover

Name: ncspot
Version: 1.3.3
Release: 1%{?dist}
Summary: Cross-platform ncurses Spotify client written in Rust
Packager: like-engels <higashikataengels@icloud.com>
License: BSD-2-Clause
URL: https://crates.io/crates/%{crate}
Source0: %{crates_source}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Source0: %{crates_source}
Source0: https://github.com/hrkfdn/ncspot/archive/refs/tags/v%version.tar.gz


Requires: dbus
Requires: glibc
Requires: libxcb
Requires: pipewire-pulseaudio
Requires: pulseaudio-libs
Requires: openssl

Comment on lines +13 to +19
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you have specified the buildrequires you don't need to specify these

Copy link
Copy Markdown
Contributor Author

@like-engels like-engels Mar 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of them are runtime dependencies (such as the pulseaudio libs) that's why I explicitly added them as package dependencies.

I'm not an RPM expert so I'd appreciate some guidance on this, because runtime dependencies are what I'm concerned about.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so basically at the end of the build RPM will look at what the binary dynamically links to and add all these runtime requirements automatically, including information about the sover (that is the ABI version).

The only case where you need to manually add these runtime dependencies would be when the binary needs these runtime dependencies but it's not dynamically linked to them. As an example, if I create a program that runs the sed program, then I need to add sed as a runtime dependency when I package the program into an RPM.

BuildRequires: anda-srpm-macros
BuildRequires: cargo-rpm-macros >= 24
BuildRequires: gcc
BuildRequires: binutils
BuildRequires: mold
BuildRequires: dbus-devel
BuildRequires: libxcb-devel
BuildRequires: ncurses-devel
BuildRequires: openssl-devel
BuildRequires: pulseaudio-libs-devel

%global _description %{expand:
ncurses Spotify client written in Rust using librespot.
It is heavily inspired by ncurses MPD clients, such as ncmpc.
It provides a simple and resource-friendly alternative to the
official Spotify client.}

%description %{_description}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
%pkg_completion -befz

%files -n %{crate}
%license LICENSE
%license LICENSE.dependencies
Comment thread
Owen-sz marked this conversation as resolved.
%doc README.md
%{_bindir}/%{crate}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
%{_bindir}/%{crate}
%{_bindir}/%{crate}
%{_appsdir}/%{crate}.desktop
%{_mandir}/man1/*.1.gz

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a CLI tool, so I'll skip the desktop file


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

%build
%cargo_build -f "%{cargo_features}"
%{cargo_license_summary_online}
%{cargo_license_online} > LICENSE.dependencies

%install
%crate_install_bin
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
%crate_install_bin
%crate_install_bin
cargo xtask generate-manpage
cargo xtask generate-shell-completion
install -Dpm644 misc/%{crate}.desktop -t %buildroot%_appsdir
install -Dm644 misc/*.1 -t %buildroot%_mandir/man1
install -Dm755 misc/%{crate}.bash -t %buildroot%bash_completions_dir
install -Dm755 misc/%{crate}.elv -t %buildroot%elvish_completions_dir
install -Dm755 misc/%{crate}.fish -t %buildroot%fish_completions_dir
install -Dm755 misc/_%{crate} -t %buildroot%zsh_completions_dir


%changelog
%autochangelog
Comment thread
like-engels marked this conversation as resolved.
Outdated
1 change: 1 addition & 0 deletions anda/multimedia/ncspot/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm.version(crates("ncspot"))
Loading