From 776e8459f0807322930cc509dd9cfcc2af0acc85 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Sun, 7 Dec 2025 03:47:55 -0800 Subject: [PATCH] add: nodejs-license-checker (#7611) (#8149) * add: js-license-checker * add: nodejs-license-checker * Trying something since RPMBuild * ??? * . * cleanup: Weird whitespace * js > nodejs * chore: Remove _jsdir * Bump dep? * Lua test * Really shouldn't be editing code on the buggy mobile editor * THIS IS EXACTLY WHY YOU DON'T EDIT ON MOBILE I DIDN'T TOUCH THIS LINE * A * Testing something * Stat is so annoying * Let's scheme * Whoops I forgot this one needs this * This is killing me * I bet you this does not work * ? * Figure out what's going wrong * HUH??? * Actually what is going on * Genuinely like. What the hell is happening * Update nodejs-license-checker.spec * I...? * Update nodejs-license-checker.spec * Update nodejs-license-checker.spec * Update nodejs-license-checker.spec * cleanup: Everything * chore: May as well bump this * Bbbbb --------- (cherry picked from commit 37c3deb32c1ca0ab10facac5b99098c74b01d783) Signed-off-by: Gilver Co-authored-by: Gilver --- anda/tools/license-checker/anda.hcl | 6 +++ .../nodejs-license-checker.spec | 53 +++++++++++++++++++ anda/tools/license-checker/update.rhai | 1 + 3 files changed, 60 insertions(+) create mode 100644 anda/tools/license-checker/anda.hcl create mode 100644 anda/tools/license-checker/nodejs-license-checker.spec create mode 100644 anda/tools/license-checker/update.rhai diff --git a/anda/tools/license-checker/anda.hcl b/anda/tools/license-checker/anda.hcl new file mode 100644 index 0000000000..5b22891ed7 --- /dev/null +++ b/anda/tools/license-checker/anda.hcl @@ -0,0 +1,6 @@ +project pkg { + arches = ["x86_64"] + rpm { + spec = "nodejs-license-checker.spec" + } +} diff --git a/anda/tools/license-checker/nodejs-license-checker.spec b/anda/tools/license-checker/nodejs-license-checker.spec new file mode 100644 index 0000000000..ba3d8f5266 --- /dev/null +++ b/anda/tools/license-checker/nodejs-license-checker.spec @@ -0,0 +1,53 @@ +# The original is dead and has vulnerabilities due to it, this fork is maintainted +%global npm_name license-checker-rseidelsohn +# Disabled for now. Requires ESLint. +%bcond test 0 + +Name: nodejs-license-checker +Version: 4.4.2 +Release: 1%{?dist} +Summary: Check NPM package licenses +SourceLicense: BSD-3-Clause +License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND CC-BY-3.0 AND ISC AND (MIT AND CC-BY-3.0) AND MIT +URL: https://github.com/RSeidelsohn/license-checker-rseidelsohn +BuildRequires: anda-srpm-macros >= 0.2.25 +BuildRequires: nodejs-devel +BuildRequires: nodejs-npm +BuildRequires: nodejs-packaging +ExclusiveArch: %{nodejs_arches} noarch +BuildArch: noarch +Packager: Gilver E. + +%description +Extract NPM package licenses. +Enhanced and updated fork of Dav Glass' original (but abandoned) license-checker. + +%prep +%npm_prep +%if %{with test} +%fetch_node_tests /tests .eslintrc.json .eslintignore +%endif + +%build + +%install +%npm_install -s license-checker + +# Bootstrap the license fetching +# Environment variable is one set during execution of %%npm_install +./bin/%{npm_name}$_js --limitAttributes licenses --out LICENSE.modules + +%if %{with test} +%check +%npm_audit +%npm_test +%endif + +%files +%license LICENSE +%license LICENSE.modules +%doc CHANGELOG.md +%doc README.md +%doc SECURITY.md +%{_bindir}/license-checker +%{nodejs_sitelib}/%{npm_name} diff --git a/anda/tools/license-checker/update.rhai b/anda/tools/license-checker/update.rhai new file mode 100644 index 0000000000..d4ee8eef8b --- /dev/null +++ b/anda/tools/license-checker/update.rhai @@ -0,0 +1 @@ +rpm.version(npm("license-checker-rseidelsohn"));