add: nushell (#767)

* add: nushell

close #766

* Update nushell.spec

Signed-off-by: madomado <madonuko@outlook.com>

* Update nushell.spec

Signed-off-by: madomado <madonuko@outlook.com>

* Update nushell.spec

Signed-off-by: madomado <madonuko@outlook.com>

* maybe rm `.cargo`?

Signed-off-by: madomado <madonuko@outlook.com>

---------

Signed-off-by: madomado <madonuko@outlook.com>
This commit is contained in:
madomado
2023-11-05 19:39:56 +08:00
committed by GitHub
parent 458aa1ebda
commit 37a210324e
3 changed files with 53 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "nushell.spec"
}
}
+47
View File
@@ -0,0 +1,47 @@
Name: nushell
Version: 0.86.0
Release: 1%{?dist}
Summary: A new type of shell
License: MIT
URL: https://www.nushell.sh/
Source0: https://github.com/nushell/nushell/archive/refs/tags/%version.tar.gz
BuildRequires: anda-srpm-macros rust-packaging openssl-devel
Requires: glibc gcc-libs openssl zlib
%description
%summary.
%prep
%autosetup
%cargo_prep_online
%build
%{cargo_build -f extra,dataframe} --workspace
%install
%cargo_install -f extra,dataframe
rm -rf .cargo
%post
if [ "$1" = 1 ]; then
if [ ! -f %{_sysconfdir}/shells ] ; then
echo "%{_bindir}/nu" > %{_sysconfdir}/shells
echo "/bin/nu" >> %{_sysconfdir}/shells
else
grep -q "^%{_bindir}/nu$" %{_sysconfdir}/shells || echo "%{_bindir}/nu" >> %{_sysconfdir}/shells
grep -q "^/bin/nu$" %{_sysconfdir}/shells || echo "/bin/nu" >> %{_sysconfdir}/shells
fi
%postun
if [ "$1" = 0 ] && [ -f %{_sysconfdir}/shells ] ; then
sed -i '\!^%{_bindir}/nu$!d' %{_sysconfdir}/shells
sed -i '\!^/bin/nu$!d' %{_sysconfdir}/shells
fi
%files
%doc README.md
%license LICENSE
%_bindir/nu*
%changelog
%autochangelog
+1
View File
@@ -0,0 +1 @@
rpm.version(gh("nushell/nushell"));