From 9b2a4e426ab0e008d320764a88faaec36da9844f Mon Sep 17 00:00:00 2001 From: Peter Oliver Date: Feb 13 2026 13:58:46 +0000 Subject: Node.js: Check that License field is synced with bundled licenses It would be easy to overlook a change/addition to the bundled licences, so suggest an automated check that they’re still as specified in the `.spec`. --- diff --git a/guidelines/modules/ROOT/pages/Node.js.adoc b/guidelines/modules/ROOT/pages/Node.js.adoc index 6749664..d206637 100644 --- a/guidelines/modules/ROOT/pages/Node.js.adoc +++ b/guidelines/modules/ROOT/pages/Node.js.adoc @@ -80,17 +80,28 @@ but the requirement to verify the licenses also applies to it, see the :xref:JavaScript.adoc[JavaScript guidelines]. List all unique licenses on the License: line of your spec file. -https://docs.fedoraproject.org/en-US/legal/license-field/#_basic_rule[Separate each license with the word "and"]. +https://docs.fedoraproject.org/en-US/legal/license-field/#_basic_rule[Separate each license with the word "AND"]. .... License: AND AND ... Source3: %{npm_name}-%{version}-bundled-licenses.txt ... +BuildRequires: /usr/bin/jq +... %prep ... cp %{SOURCE3} . ... +%check +# Check that License field is synced with bundled licenses +jq --arg license '%{license}' \ + --exit-status \ + --slurp \ + '$license == join(" AND ")' \ + %{npm_name}-%{version}-bundled-licenses.txt \ + >/dev/null +... %files %license LICENSE %{npm_name}-%{version}-bundled-licenses.txt .... @@ -319,6 +330,7 @@ ExclusiveArch: %{nodejs_arches} noarch Requires: nodejs BuildRequires: nodejs-devel +BuildRequires: /usr/bin/jq %description %{summary}. @@ -366,6 +378,14 @@ popd # Run tests ./node_modules/.bin/tap test/*.js +# Check that License field is synced with bundled licenses +jq --arg license '%{license}' \ + --exit-status \ + --slurp \ + '$license == join(" AND ")' \ + %{npm_name}-%{version}-bundled-licenses.txt \ + >/dev/null + %files %doc readme.markdown