Compare commits
1 commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfd7aa9981 |
5 changed files with 84 additions and 64 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -10,3 +10,5 @@
|
|||
/bash-language-server-4.6.1-vendor.tar.xz
|
||||
/bash-language-server-4.10.0-vendor.tar.xz
|
||||
/bash-language-server-4.10.0.tar.gz
|
||||
/bash-language-server-5.1.1.tar.gz
|
||||
/bash-language-server-5.1.1-vendor.tar.zst
|
||||
|
|
|
|||
3
bash-language-server-5.1.1-bundled-licenses.txt
Normal file
3
bash-language-server-5.1.1-bundled-licenses.txt
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
"BSD-2-Clause"
|
||||
"ISC"
|
||||
"MIT"
|
||||
|
|
@ -3,21 +3,22 @@
|
|||
%define pkg_name bash-language-server
|
||||
|
||||
Name: nodejs-bash-language-server
|
||||
Version: 4.10.0
|
||||
Release: 2%{?dist}
|
||||
Version: 5.1.1
|
||||
Release: 1%{?dist}
|
||||
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
|
||||
# Create with `bash prepare_vendor.sh`
|
||||
Source1: %{pkg_name}-%{version}-vendor.tar.xz
|
||||
Source1: %{pkg_name}-%{version}-vendor.tar.zst
|
||||
# Create with: nodejs-packaging-bundler bash-language-server 5.1.1
|
||||
Source2: bash-language-server-%{version}-bundled-licenses.txt
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: nodejs-typescript
|
||||
BuildRequires: nodejs-packaging
|
||||
BuildRequires: npm
|
||||
BuildRequires: perl-interpreter
|
||||
BuildRequires: rsync
|
||||
BuildRequires: yarnpkg
|
||||
BuildRequires: pnpm
|
||||
BuildArch: noarch
|
||||
ExclusiveArch: %{nodejs_arches} noarch
|
||||
Recommends: ShellCheck
|
||||
|
|
@ -29,21 +30,20 @@ Bash with explainshell integration.
|
|||
%prep
|
||||
%autosetup -n %{pkg_name}-server-%{version} -a1 -p1
|
||||
|
||||
cp %{SOURCE2} .
|
||||
|
||||
%build
|
||||
export YARN_CACHE_FOLDER="$(pwd)/.package-cache"
|
||||
yarn install --offline --frozen-lockfile
|
||||
pnpm install --offline --frozen-lockfile --store-dir="$(pwd)/.pnpm-store"
|
||||
|
||||
npm run compile
|
||||
|
||||
%install
|
||||
export YARN_CACHE_FOLDER="$(pwd)/.package-cache"
|
||||
|
||||
# Only install production dependencies in node_modules
|
||||
yarn install --production --offline --frozen-lockfile
|
||||
rm -rf node_modules/
|
||||
pnpm install --production --offline --frozen-lockfile --package-import-method copy --store-dir="$(pwd)/.pnpm-store"
|
||||
|
||||
for S in $(grep -l '#!.*node' \
|
||||
server/bin/* \
|
||||
server/node_modules/acorn/bin/* \
|
||||
server/out/cli.js \
|
||||
server/node_modules/ajv/scripts/* \
|
||||
server/node_modules/escodegen/bin/* \
|
||||
server/node_modules/esprima/bin/* \
|
||||
|
|
@ -53,43 +53,57 @@ for S in $(grep -l '#!.*node' \
|
|||
server/node_modules/uuid/bin/* \
|
||||
server/node_modules/vscode-languageserver/bin/* \
|
||||
) ; do
|
||||
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}
|
||||
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
|
||||
|
||||
install -d -m 0755 %{buildroot}%{_bindir}
|
||||
install -d -m 0755 %{buildroot}%{nodejs_sitelib}/%{pkg_name}/
|
||||
|
||||
cp -av server %{buildroot}%{nodejs_sitelib}/%{pkg_name}/
|
||||
cp -av node_modules %{buildroot}%{nodejs_sitelib}/%{pkg_name}/
|
||||
|
||||
install -d -m 0755 %{buildroot}%{_bindir}
|
||||
cat << EOF > %{buildroot}%{_bindir}/%{pkg_name}
|
||||
#!/bin/sh
|
||||
export NODE_ENV=production
|
||||
|
||||
exec /usr/bin/node %{nodejs_sitelib}/%{pkg_name}/out/cli.js "\$@"
|
||||
exec /usr/bin/node %{nodejs_sitelib}/%{pkg_name}/server/out/cli.js "\$@"
|
||||
EOF
|
||||
chmod +x %{buildroot}%{_bindir}/%{pkg_name}
|
||||
|
||||
install -d -m 0755 %{buildroot}%{nodejs_sitelib}/%{pkg_name}/
|
||||
rsync -av server/ %{buildroot}%{nodejs_sitelib}/%{pkg_name}/
|
||||
|
||||
rm -rf %{buildroot}%{nodejs_sitelib}/%{pkg_name}/node_modules/performance-now/test/
|
||||
chmod 0644 %{buildroot}%{nodejs_sitelib}/%{pkg_name}/tree-sitter-bash.wasm \
|
||||
%{buildroot}%{nodejs_sitelib}/%{pkg_name}/node_modules/web-tree-sitter/tree-sitter.wasm
|
||||
|
||||
find %{buildroot}%{nodejs_sitelib}/%{pkg_name} -name "*.bak" -delete
|
||||
find %{buildroot}%{nodejs_sitelib}/%{pkg_name} -type f -name "\.*" -delete
|
||||
find %{buildroot}%{nodejs_sitelib}/%{pkg_name} -type d -name "\.bin" -print0 | xargs -0 rm -rf
|
||||
find %{buildroot}%{nodejs_sitelib}/%{pkg_name} -type d -name "\.github" -print0 | xargs -0 rm -rf
|
||||
|
||||
rm -rf %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/node_modules/ajv/scripts/
|
||||
rm -rf %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/node_modules/dashdash/etc/
|
||||
rm -rf %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/node_modules/performance-now/test/
|
||||
|
||||
rm %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/src/get-options.sh
|
||||
|
||||
# dangling symlinks
|
||||
rm %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/node_modules/@types/fuzzy-search
|
||||
rm %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/node_modules/@types/node-fetch
|
||||
rm %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/node_modules/@types/turndown
|
||||
rm %{buildroot}%{nodejs_sitelib}/%{pkg_name}/server/node_modules/@types/urijs
|
||||
|
||||
%fdupes %{buildroot}%{nodejs_sitelib}/%{pkg_name}
|
||||
|
||||
%files
|
||||
%license LICENSE
|
||||
%license LICENSE bash-language-server-%{version}-bundled-licenses.txt
|
||||
%doc README.md
|
||||
%{_bindir}/%{pkg_name}
|
||||
%{nodejs_sitelib}/%{pkg_name}/
|
||||
|
||||
%changelog
|
||||
* Tue Jan 02 2024 Andreas Schneider <asn@redhat.com> - 5.1.1-1
|
||||
- Update to version 5.1.1
|
||||
* https://github.com/bash-lsp/bash-language-server/blob/server-5.1.1/server/CHANGELOG.md
|
||||
|
||||
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.10.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
|
|
|
|||
|
|
@ -1,22 +1,23 @@
|
|||
#!/bin/bash
|
||||
# shellcheck disable=2181
|
||||
|
||||
BASHLS_URL=$(rpmspec -P *.spec | grep Source0 | sed -e 's/Source0:[ ]*//g')
|
||||
BASHLS_TARBALL=$(basename $BASHLS_URL)
|
||||
BASHLS_PKGVERSION=$(rpmspec -P *.spec | grep ^Version | sed -e 's/Version:[ ]*//g')
|
||||
BASHLS_URL="$(rpmspec -P ./*.spec | grep Source0 | sed -e 's/Source0:[ ]*//g')"
|
||||
BASHLS_TARBALL="$(basename "${BASHLS_URL}")"
|
||||
BASHLS_PKGVERSION="$(rpmspec -P ./*.spec | grep ^Version | sed -e 's/Version:[ ]*//g')"
|
||||
BASHLS_PKGNAME="bash-language-server"
|
||||
BASHLS_PKGDIR="$(pwd)"
|
||||
BASHLS_TMPDIR=$(mktemp --tmpdir -d bashls-XXXXXXXX)
|
||||
BASHLS_PATH="$BASHLS_TMPDIR/$BASHLS_PKGNAME-server-$BASHLS_PKGVERSION"
|
||||
BASHLS_TMPDIR="$(mktemp --tmpdir -d bashls-XXXXXXXX)"
|
||||
BASHLS_PATH="${BASHLS_TMPDIR}/${BASHLS_PKGNAME}-server-${BASHLS_PKGVERSION}"
|
||||
|
||||
echo "URL: $BASHLS_URL"
|
||||
echo "TARBALL: $BASHLS_TARBALL"
|
||||
echo "NAME: $BASHLS_PKGNAME"
|
||||
echo "VERSION: $BASHLS_PKGVERSION"
|
||||
echo "PATH: $BASHLS_PATH"
|
||||
echo "URL: ${BASHLS_URL}"
|
||||
echo "TARBALL: ${BASHLS_TARBALL}"
|
||||
echo "NAME: ${BASHLS_PKGNAME}"
|
||||
echo "VERSION: ${BASHLS_PKGVERSION}"
|
||||
echo "PATH: ${BASHLS_PATH}"
|
||||
|
||||
cleanup_tmpdir() {
|
||||
popd 2>/dev/null
|
||||
rm -rf $BASHLS_TMPDIR
|
||||
popd 2>/dev/null || true
|
||||
rm -rf "${BASHLS_TMPDIR}"
|
||||
}
|
||||
trap cleanup_tmpdir SIGINT
|
||||
|
||||
|
|
@ -29,56 +30,56 @@ cleanup_and_exit() {
|
|||
fi
|
||||
}
|
||||
|
||||
if [ ! -w "$BASHLS_TARBALL" ]; then
|
||||
if [ ! -w "${BASHLS_TARBALL}" ]; then
|
||||
wget "$BASHLS_URL"
|
||||
fi
|
||||
|
||||
|
||||
tar -xf $BASHLS_TARBALL -C $BASHLS_TMPDIR
|
||||
tar -xf "${BASHLS_TARBALL}" -C "${BASHLS_TMPDIR}"
|
||||
|
||||
|
||||
pushd $BASHLS_PATH || cleanup_and_exit 1
|
||||
pushd "${BASHLS_PATH}" || cleanup_and_exit 1
|
||||
|
||||
export YARN_CACHE_FOLDER="$(pwd)/.package-cache"
|
||||
PNPM_STORE_DIR="$(pwd)/.pnpm-store"
|
||||
echo ">>>>>> Install npm modules"
|
||||
yarn install --frozen-lockfile
|
||||
pnpm install --store-dir="${PNPM_STORE_DIR}"
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "ERROR: yarn install failed"
|
||||
cleanup_and_exit 1
|
||||
fi
|
||||
|
||||
echo ">>>>>> Cleanup object dirs"
|
||||
find ${YARN_CACHE_FOLDER}/ -type d -name "*.o.d" | xargs rm -rf
|
||||
find ${YARN_CACHE_FOLDER}/ -type d -name "__pycache__" | xargs rm -rf
|
||||
find "${PNPM_STORE_DIR}/" -type d -name "__pycache__" -print0 | xargs -0 rm -rf
|
||||
find "${PNPM_STORE_DIR}/" -type d -name "*.o.d" -print0 | xargs -0 rm -rf
|
||||
|
||||
|
||||
echo ">>>>>> Cleanup object files"
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.node" | xargs rm -rf
|
||||
find "${PNPM_STORE_DIR}/" -name "*.node" -print0 | xargs -0 rm -rf
|
||||
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.dll" | grep -v signal-client | xargs rm -f
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.dylib" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.so" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.o" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.a" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.snyk-*.flag" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "builderror.log" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name ".deps" -type d | xargs rm -rf
|
||||
find "${PNPM_STORE_DIR}/" -name "*.dll" | grep -v signal-client | xargs rm -f
|
||||
find "${PNPM_STORE_DIR}/" -name "*.dylib" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "*.so" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "*.o" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "*.a" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "*.snyk-*.flag" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "builderror.log" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name ".deps" -type d -print0 | xargs -0 rm -rf
|
||||
|
||||
|
||||
echo ">>>>>> Cleanup build info"
|
||||
find ${YARN_CACHE_FOLDER}/ -name "Makefile" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "*.target.mk" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "config.gypi" -delete
|
||||
find ${YARN_CACHE_FOLDER}/ -name "package.json" -exec sed -i "s#$BASHLS_PATH#/tmp#g" {} \;
|
||||
find "${PNPM_STORE_DIR}/" -name "Makefile" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "*.target.mk" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "config.gypi" -delete
|
||||
find "${PNPM_STORE_DIR}/" -name "package.json" -exec sed -i "s#${BASHLS_PATH}#/tmp#g" {} \;
|
||||
|
||||
|
||||
echo ">>>>>> Package vendor files"
|
||||
rm -f $BASHLS_PKGDIR/${BASHLS_PKGNAME}-${BASHLS_PKGVERSION}-vendor.tar.xz
|
||||
XZ_OPT="-T$(nproc)" tar cJf $BASHLS_PKGDIR/${BASHLS_PKGNAME}-${BASHLS_PKGVERSION}-vendor.tar.xz .package-cache
|
||||
rm -f "${BASHLS_PKGDIR}/${BASHLS_PKGNAME}-${BASHLS_PKGVERSION}-vendor.tar.zst"
|
||||
XZ_OPT="-T$(nproc)" tar --zstd -cf "${BASHLS_PKGDIR}/${BASHLS_PKGNAME}-${BASHLS_PKGVERSION}-vendor.tar.zst" .pnpm-store
|
||||
if [ $? -ne 0 ]; then
|
||||
cleanup_and_exit 1
|
||||
fi
|
||||
|
||||
popd
|
||||
popd || cleanup_and_exit 1
|
||||
|
||||
cleanup_and_exit 0
|
||||
|
|
|
|||
4
sources
4
sources
|
|
@ -1,2 +1,2 @@
|
|||
SHA512 (bash-language-server-4.10.0-vendor.tar.xz) = e2c5ba5c593825bd9ec484d3f0849304cad8ffed4db6017ee4b164b327af0dd638ac6508173d436b23ddc9635a02abfb8dcd7e2409eabe5aa234b7420cdd3cf9
|
||||
SHA512 (bash-language-server-4.10.0.tar.gz) = 9970397cf2af702878da9c6cf4b81b6b5a478527be6f501a3e70a5bb83c7733f7313c20e4edb66c636dfc4c8a8d996dc5784c03e99c04d8dc0e8a0ea8072b171
|
||||
SHA512 (bash-language-server-5.1.1.tar.gz) = a8b5b31fc2952c89163fd2bdd53d541bf5c5589ea1101b65c543fc16e144070cae828b49e658a86695e77adfd42562cf5e2fbf60eed3f8b66966dd50567abfda
|
||||
SHA512 (bash-language-server-5.1.1-vendor.tar.zst) = a00f8a0842ffc54f991ac8a167d4119b29ae61364c4043e542663979b55a7318ebcf9734a4e2896c112fef736e9a2e321b0412f8f9577642dfa2194f71897128
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue