From b826995f7508ee5ffedb5b5d86fbf835e03831e1 Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Wed, 21 Jan 2026 06:33:39 -0800 Subject: [PATCH] fix(nodejs-backport): Licenses, name, and use new macros (#9423) (#9427) * fix(nodejs-backport): Licenses, name, and use new macros * chore: Changelog and update tests (cherry picked from commit dd70a85e1d56a5904ce0369bf28318543413e301) Co-authored-by: Gilver --- anda/devs/backport/anda.hcl | 1 - anda/devs/backport/nodejs-backport.spec | 56 ++++++++++++------------- anda/devs/backport/post.rhai | 1 - 3 files changed, 26 insertions(+), 32 deletions(-) delete mode 100644 anda/devs/backport/post.rhai diff --git a/anda/devs/backport/anda.hcl b/anda/devs/backport/anda.hcl index 4ba8d7de29..37ceb921f6 100644 --- a/anda/devs/backport/anda.hcl +++ b/anda/devs/backport/anda.hcl @@ -1,6 +1,5 @@ project pkg { rpm { spec = "nodejs-backport.spec" - pre_script = "setup.sh" } } diff --git a/anda/devs/backport/nodejs-backport.spec b/anda/devs/backport/nodejs-backport.spec index 32ec4ed420..92ec52ef11 100644 --- a/anda/devs/backport/nodejs-backport.spec +++ b/anda/devs/backport/nodejs-backport.spec @@ -1,60 +1,56 @@ -%global debug_package %{nil} -%global module backport -%bcond test 1 +%global npm_name backport +# Requires Jest so currently disabled +%bcond test 0 -Name: node-%{module} +Name: nodejs-%{npm_name} Version: 10.2.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Backport GitHub commits SourceLicense: Apache-2.0 -License: Apache-2.0 AND -URL: https://github.com/sorenlouv/%{module} -%dnl Source0: http://registry.npmjs.org/%{module}/-/%{module}-%{version}.tgz -# Source the tests -Source1: tests-%{version}.tar.bz2 -BuildRequires: bsdtar -BuildRequires: nodejs-devel +License: 0BSD AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND CC0-1.0 AND ISC AND MIT AND (MIT OR CC0-1.0) AND (WTFPL OR ISC) +URL: https://github.com/sorenlouv/%{npm_name} +Source0: http://registry.npmjs.org/%{npm_name}/-/%{npm_name}-%{version}.tgz +BuildRequires: anda-srpm-macros >= 0.3.0 BuildRequires: nodejs-packaging BuildRequires: nodejs-npm -ExclusiveArch: %{nodejs_arches} noarch +BuildRequires: nodejs-license-checker +%if %{with test} +BuildRequires: yarnpkg +%endif +Obsoletes: node-backport <= 10.2.0 +BuildArch: noarch Packager: Gilver E. %description A simple CLI tool that automates the process of backporting commits on a GitHub repo. %prep -# Maybe I should make some NodeJS online macros... -# Global flag is needed or the module WILL NOT WORK via commandline without some manual intervention -npm install -g %{module}@%{version} --prefix=. -%setup -T -D -n lib/node_modules/%{module} -tar xjf %{SOURCE1} +%npm_prep +%fetch_node_tests /src/test/ /tests/ %build # Empty build section, because RPM reasons %install -mkdir -p %{buildroot}%{nodejs_sitelib}/%{module} -mkdir -p %{buildroot}%{_bindir} -cp -r ./* -t %{buildroot}%{nodejs_sitelib}/%{module} -ln -sf %{nodejs_sitelib}/%{module}/bin/%{module} %{buildroot}%{_bindir}/%{module} +%npm_install -# Should maybe package this so it's easier to call... -npm install -g license-checker --prefix=. -# This could also be made into a macro maybe? -bin/license-checker | sed '/.*repository:.*/d;/.*publisher:.*/d;/.*email:.*/d;/.*url:.*/d;/.*path:.*/d;/.*licenseFile:.*/d;/.*noticeFile:.*/d' > LICENSE.modules +%npm_license_summary +%npm_license -o LICENSE.modules -%check %if %{with test} -NODE_ENV=test %{builddir}/bin/%{module} -R tests +%check +%yarn_test %endif %files %doc README.md %license LICENSE.txt %license LICENSE.modules -%{nodejs_sitelib}/%{module}/ -%{_bindir}/%{module} +%{nodejs_sitelib}/%{npm_name}/ +%{_bindir}/%{npm_name} %changelog +* Wed Jan 21 2026 Gilver E. - 10.2.0-3 +- Fixed package name and licenses * Wed Jul 2 2025 Gilver E. - 9.6.6-1 - Initial package diff --git a/anda/devs/backport/post.rhai b/anda/devs/backport/post.rhai deleted file mode 100644 index 7ec2290326..0000000000 --- a/anda/devs/backport/post.rhai +++ /dev/null @@ -1 +0,0 @@ -sh("rm -rfv anda/devs/backport/*.tar.bz2", #{});