* add: NVM

* chore: Packager and changelog

(cherry picked from commit 2896419ba2)

Co-authored-by: Gilver <rockgrub@disroot.org>
This commit is contained in:
Raboneko
2025-11-30 21:40:58 -08:00
committed by GitHub
parent f3c5a91a3e
commit 7fd4e780c9
4 changed files with 54 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
project pkg {
arches = ["x86_64"]
rpm {
spec = "nvm.spec"
}
}
+5
View File
@@ -0,0 +1,5 @@
#!/usr/bin/sh
source /etc/profile.d/nvm.sh
nvm $@
+42
View File
@@ -0,0 +1,42 @@
Name: nvm
Version: 0.40.3
Release: 1%{?dist}
Summary: Node Version Manager
License: MIT
URL: https://github.com/nvm-sh/nvm
Source0: %{url}/archive/refs/tags/v%{version}.tar.gz
Source1: binscript
# Only works with POSIX compliant shells
Requires: (bash or dash or ksh or zsh)
BuildArch: noarch
Packager: Gilver E. <rockgrub@disroot.org>
%description
POSIX-compliant script to manage multiple active Node.js versions.
%pkg_completion -bz
%prep
%autosetup -n %{name}-%{version}
%build
# Anyone home?
%install
install -Dm744 %{SOURCE1} %{buildroot}%{_bindir}/%{name}
install -Dm644 bash_completion %{buildroot}%{bash_completions_dir}/%{name}.bash
# Another cursed script that uses bashcompinit to use one file for Bash and Zsh completions
install -Dm644 bash_completion %{buildroot}%{zsh_completions_dir}/_%{name}
install -Dm644 %{name}.sh -t %{buildroot}%{_sysconfdir}/profile.d
%files
%license LICENSE.md
%doc README.md
%{_bindir}/%{name}
%{_sysconfdir}/profile.d/%{name}.sh
%changelog
* Sun Nov 30 2025 Gilver E. <rockgrub@disroot.org> - 0.40.3-1
- Initial package
+1
View File
@@ -0,0 +1 @@
rpm.version(find(`nvm_echo \"v([\d.]+)\"`, gh_rawfile("nvm-sh/nvm", "master", "install.sh"), 1));