## START: Set by rpmautospec ## (rpmautospec version 0.8.4) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %{?nodejs_default_filter} %global pkg_name yaml-language-server Name: nodejs-yaml-language-server Version: 2.0.0 Release: %autorelease Summary: Language Server for YAML # yaml-language-server itself is MIT, the rest are bundled dependencies, # see yaml-language-server-bundled-licenses.txt License: MIT AND BSD-3-Clause AND ISC URL: https://github.com/redhat-developer/yaml-language-server Source0: %{url}/archive/%{version}/%{pkg_name}-%{version}.tar.gz # Create with `bash prepare_vendor.sh` Source1: %{pkg_name}-%{version}-vendor.tar.zst # Created by `bash prepare_vendor.sh` as well Source2: %{pkg_name}-bundled-licenses.txt Source3: prepare_vendor.sh BuildArch: noarch ExclusiveArch: %{nodejs_arches} noarch BuildRequires: fdupes BuildRequires: nodejs-devel BuildRequires: nodejs-npm BuildRequires: nodejs-packaging Requires: nodejs >= 22.13.0 %description A language server for YAML providing validation (with JSON Schema support, including built-in Kubernetes and SchemaStore schemas), completion, hover, document outline, formatting and more, usable from any editor supporting the Language Server Protocol. %prep %autosetup -p1 -a1 -n %{pkg_name}-%{version} cp -p %{SOURCE2} . # Upstream ships it executable chmod -x README.md %build export npm_config_cache="$(pwd)/npm-cache" npm ci --offline --ignore-scripts --no-audit --no-fund npm run compile %install # Only install production dependencies in node_modules rm -rf node_modules export npm_config_cache="$(pwd)/npm-cache" npm ci --offline --ignore-scripts --no-audit --no-fund --omit=dev install -d -m 0755 %{buildroot}%{nodejs_sitelib}/%{pkg_name} cp -a package.json bin l10n node_modules %{buildroot}%{nodejs_sitelib}/%{pkg_name}/ install -d -m 0755 %{buildroot}%{nodejs_sitelib}/%{pkg_name}/out cp -a out/src %{buildroot}%{nodejs_sitelib}/%{pkg_name}/out/ pushd %{buildroot}%{nodejs_sitelib}/%{pkg_name} # Not needed at runtime find . -type d -name .bin -prune -exec rm -rf {} + find . -type d -name .github -prune -exec rm -rf {} + find . -type f \( -name '.*' -o -name '*.map' -o -name '*.ts' -o -name '*.mts' -o -name '*.cts' \) -delete # Use the system node in shebangs grep -rlZ --include='*' '^#!/usr/bin/env node' . | xargs -0r \ sed -i -e '1s|^#!/usr/bin/env node|#!%{__nodejs}|' popd chmod 0755 %{buildroot}%{nodejs_sitelib}/%{pkg_name}/bin/%{pkg_name} install -d -m 0755 %{buildroot}%{_bindir} ln -s ../lib/node_modules/%{pkg_name}/bin/%{pkg_name} \ %{buildroot}%{_bindir}/%{pkg_name} %fdupes %{buildroot}%{nodejs_sitelib}/%{pkg_name} # Mark license files of the bundled modules as %%license find %{buildroot}%{nodejs_sitelib}/%{pkg_name} -mindepth 1 \ \( -type d -printf '%%%%dir "/%%P"\n' \) -o \ \( -iregex '.*/node_modules/[^/]+\(/[^/]+\)?/\(licen[cs]e\|copying\|notice\)[^/]*' \ -printf '%%%%license "/%%P"\n' \) -o \ -printf '"/%%P"\n' \ | sed -e 's|"/|"%{nodejs_sitelib}/%{pkg_name}/|' > %{pkg_name}.files %check export npm_config_cache="$(pwd)/npm-cache" # Restore the full dependency tree for the test suite npm ci --offline --ignore-scripts --no-audit --no-fund # Skipped tests need network access (remote Kubernetes / SchemaStore schemas) node --test \ --test-skip-pattern='Kubernetes Integration Tests' \ --test-skip-pattern='Should find errors in (both|second) document' \ --test-skip-pattern='should show completion items in the middle of map in array' \ --test-skip-pattern='schema works with [Kk]ubernetes resolution' \ --test-skip-pattern='Kubernetes standalone-strict/all\.json' \ --test-skip-pattern='correct schema based on the GroupVersionKind' \ --test-skip-pattern='should add proper source to diagnostic' \ --test-skip-pattern='schema should validate additionalProp oneOf' \ out/test/*.test.js %{buildroot}%{_bindir}/%{pkg_name} --version | grep -Fx %{version} %files -f %{pkg_name}.files %license LICENSE %{pkg_name}-bundled-licenses.txt %doc README.md CHANGELOG.md %{_bindir}/%{pkg_name} %dir %{nodejs_sitelib}/%{pkg_name}/ %changelog ## START: Generated by rpmautospec * Wed Nov 11 2026 John Doe - 2.0.0-1 - Uncommitted changes ## END: Generated by rpmautospec