Files
nodejs-bash-language-server/nodejs-bash-language-server.spec

117 lines
4.6 KiB
RPMSpec
Raw Permalink Normal View History

2021-07-08 16:34:42 +00:00
#
2023-11-04 08:39:01 +00:00
# spec file for package nodejs-bash-language-server
2021-07-08 16:34:42 +00:00
#
# Copyright (c) Andreas Schneider <asn@cryptomilk.org>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define pkg_name bash-language-server
Name: nodejs-bash-language-server
2025-04-14 07:05:58 +00:00
Version: 5.6.0
2021-07-08 16:34:42 +00:00
Release: 0
Summary: A language server for Bash
License: MIT
Url: https://github.com/bash-lsp/bash-language-server
Source0: %{url}/archive/server-%{version}/%{pkg_name}-%{version}.tar.gz
2023-01-27 13:23:32 +00:00
Source1: %{pkg_name}-%{version}-vendor.tar.zst
2022-02-22 15:42:21 +00:00
Source2: bashls-launcher.sh
2023-09-05 20:20:03 +00:00
Source3: bash-language-server-bundled-licenses.txt
2025-12-04 18:34:44 +00:00
Patch0: bashls-no-vscode.patch
2021-07-08 16:34:42 +00:00
BuildRequires: fdupes
2021-08-26 09:42:44 +00:00
BuildRequires: typescript
2023-02-26 15:13:21 +00:00
BuildRequires: npm >= 16
2023-09-05 18:06:44 +00:00
BuildRequires: pnpm >= 8
2021-07-08 19:28:04 +00:00
BuildRequires: perl
2023-01-27 13:23:32 +00:00
BuildRequires: zstd
2022-08-19 07:34:53 +00:00
Recommends: ShellCheck
2023-02-26 15:14:16 +00:00
Recommends: bash-completion
2021-07-08 16:34:42 +00:00
BuildArch: noarch
%description
Bash language server implementation based on Tree Sitter and its grammar for
Bash with explainshell integration.
%prep
2022-02-22 15:42:21 +00:00
%autosetup -n %{pkg_name}-server-%{version} -p1 -a1
2021-07-08 16:34:42 +00:00
2023-09-05 20:20:03 +00:00
cp %{SOURCE3} .
2022-02-22 15:42:21 +00:00
%build
2025-12-04 18:34:44 +00:00
pnpm install --offline --ignore-scripts --frozen-lockfile --store-dir="$(pwd)/.pnpm-store"
2022-02-22 15:42:21 +00:00
npm run compile
%install
# Only install production dependencies in node_modules
rm -rf node_modules/
2025-12-04 18:34:44 +00:00
pnpm install --production --offline --ignore-scripts --frozen-lockfile --package-import-method copy --store-dir="$(pwd)/.pnpm-store"
2022-02-17 09:30:34 +00:00
2021-07-08 19:36:37 +00:00
for S in $(grep -l '#!.*node' \
2023-09-05 18:06:44 +00:00
server/out/cli.js \
2021-07-08 19:36:37 +00:00
server/node_modules/ajv/scripts/* \
server/node_modules/escodegen/bin/* \
server/node_modules/esprima/bin/* \
server/node_modules/performance-now/test/scripts/* \
server/node_modules/pn/scripts/* \
server/node_modules/sshpk/bin/* \
server/node_modules/uuid/bin/* \
server/node_modules/vscode-languageserver/bin/* \
) ; do
2021-07-08 19:28:04 +00:00
SB="${S}.backup"
cp ${S} ${SB}
perl -p -i -e 's|#!/usr/bin/env node|#!%{_bindir}/node|g' $S
diff -urN ${SB} ${S} || :
rm ${SB}
done
2021-07-08 16:34:42 +00:00
install -d -m 0755 %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/
2023-09-05 18:06:44 +00:00
cp -av server %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/
cp -av node_modules %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/
2021-07-08 16:34:42 +00:00
install -d -m 0755 %{buildroot}%{_bindir}
2023-02-06 11:41:21 +00:00
install -m 0755 %{SOURCE2} %{buildroot}%{_bindir}/%{pkg_name}
2021-07-08 16:34:42 +00:00
2021-07-08 19:13:29 +00:00
find %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name} -name "*.bak" -delete
find %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name} -type f -name "\.*" -delete
2022-02-22 15:42:21 +00:00
find %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name} -type d -name "\.bin" -print0 | xargs -0 rm -rf
2022-08-19 07:34:53 +00:00
find %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name} -type d -name "\.github" -print0 | xargs -0 rm -rf
2025-12-04 18:34:44 +00:00
find %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name} -type d -name "\.yarn" -print0 | xargs -0 rm -rf
rm -f %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/node_modules/.pnpm/editorconfig@*/node_modules/editorconfig/bin/editorconfig
rm -f %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/node_modules/.pnpm/semver@*/node_modules/semver/bin/semver.js
2022-02-22 15:42:21 +00:00
rm -rf %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/node_modules/ajv/scripts/
rm -rf %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/node_modules/dashdash/etc/
rm -rf %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/node_modules/performance-now/test/
2025-12-04 18:34:44 +00:00
rm -f %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/src/get-options.sh
2022-02-22 15:42:21 +00:00
2023-11-04 08:39:01 +00:00
# dangling symlinks
2025-12-04 18:34:44 +00:00
rm -f %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/node_modules/@types/fuzzy-search
rm -f %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/node_modules/@types/node-fetch
rm -f %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/node_modules/@types/turndown
rm -f %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}/server/node_modules/@types/urijs
2023-11-04 08:39:01 +00:00
2021-07-08 16:34:42 +00:00
%fdupes %{buildroot}%{_prefix}/lib/node_modules/%{pkg_name}
%files
2023-09-05 20:20:03 +00:00
%license LICENSE bash-language-server-bundled-licenses.txt
2024-04-25 09:10:30 +00:00
%doc README.md server/CHANGELOG.md
2021-07-08 16:34:42 +00:00
%dir %{_prefix}/lib/node_modules
%{_bindir}/%{pkg_name}
%{_prefix}/lib/node_modules/%{pkg_name}/
%changelog