From 37a210324e90e2bf8f3835b1bfe167e0584069fb Mon Sep 17 00:00:00 2001 From: madomado Date: Sun, 5 Nov 2023 19:39:56 +0800 Subject: [PATCH] add: nushell (#767) * add: nushell close #766 * Update nushell.spec Signed-off-by: madomado * Update nushell.spec Signed-off-by: madomado * Update nushell.spec Signed-off-by: madomado * maybe rm `.cargo`? Signed-off-by: madomado --------- Signed-off-by: madomado --- anda/rust/nushell/anda.hcl | 5 ++++ anda/rust/nushell/nushell.spec | 47 ++++++++++++++++++++++++++++++++++ anda/rust/nushell/update.rhai | 1 + 3 files changed, 53 insertions(+) create mode 100644 anda/rust/nushell/anda.hcl create mode 100644 anda/rust/nushell/nushell.spec create mode 100644 anda/rust/nushell/update.rhai diff --git a/anda/rust/nushell/anda.hcl b/anda/rust/nushell/anda.hcl new file mode 100644 index 0000000000..a7f37bd92f --- /dev/null +++ b/anda/rust/nushell/anda.hcl @@ -0,0 +1,5 @@ +project pkg { + rpm { + spec = "nushell.spec" + } +} diff --git a/anda/rust/nushell/nushell.spec b/anda/rust/nushell/nushell.spec new file mode 100644 index 0000000000..6f7d66f7aa --- /dev/null +++ b/anda/rust/nushell/nushell.spec @@ -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 diff --git a/anda/rust/nushell/update.rhai b/anda/rust/nushell/update.rhai new file mode 100644 index 0000000000..039accd131 --- /dev/null +++ b/anda/rust/nushell/update.rhai @@ -0,0 +1 @@ +rpm.version(gh("nushell/nushell"));