chore(backport): Add explicit Git dep, clean up some things (#11840) (#11843)

* chore(backport): Add explicit Git dep



* chore: Changelog



* chore: Only build once and remove unused script

---------


(cherry picked from commit 0268ffe63e)

Signed-off-by: Gilver <roachy@fyralabs.com>
Co-authored-by: Gilver <roachy@fyralabs.com>
This commit is contained in:
Raboneko
2026-05-03 10:55:15 -05:00
committed by GitHub
parent 07f3d630de
commit 01785f0c97
3 changed files with 8 additions and 30 deletions
+1
View File
@@ -1,4 +1,5 @@
project pkg {
arches = ["x86_64"]
rpm {
spec = "nodejs-backport.spec"
}
+7 -2
View File
@@ -4,10 +4,10 @@
Name: nodejs-%{npm_name}
Version: 12.0.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Backport GitHub commits
SourceLicense: Apache-2.0
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)
License: MIT AND ISC AND Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause
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
@@ -17,6 +17,7 @@ BuildRequires: nodejs-license-checker
%if %{with test}
BuildRequires: yarnpkg
%endif
Requires: git-core
Obsoletes: node-backport <= 10.2.0
BuildArch: noarch
Packager: Gilver E. <roachy@fyralabs.com>
@@ -26,7 +27,9 @@ A simple CLI tool that automates the process of backporting commits on a GitHub
%prep
%npm_prep
%if %{with test}
%fetch_node_tests /src/test/ /tests/
%endif
%build
# Empty build section, because RPM reasons
@@ -50,6 +53,8 @@ A simple CLI tool that automates the process of backporting commits on a GitHub
%{_bindir}/%{npm_name}
%changelog
* Sun May 3 2026 Gilver E. <roachy@fyralabs.com> - 12.0.0-2
- Added explicit dependency on git-core
* Wed Jan 21 2026 Gilver E. <roachy@fyralabs.com> - 10.2.0-3
- Fixed package name and licenses
* Wed Jul 2 2025 Gilver E. <rockgrub@disroot.org> - 9.6.6-1
-28
View File
@@ -1,28 +0,0 @@
#!/usr/bin/bash
## Some sources need to be fetched BEFORE the build process
# Also I'm just better at scripting in Bash and calling the Rhai sh function hundreds of times times sounded like hell
# Have I mentioned I hate runtime languages?
node=backport
# Enable logs for debugging
set -x
# I guess just $PWD doesn't work for this
builddir=$(pwd)/anda/devs/$node
# We only need the tests folder so sourcing the whole repo is overkill, Git can make a tarball of specific directories
pushd $builddir
ver=$(cat ./*.spec | grep -P -m1 'Version:' | sed -e 's/Version://g' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')
url=$(sed -n 's/^URL:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e "s/%{module}/$node/")
dir=$node
git clone --recurse-submodules -j$(nproc) $url.git
pushd $dir
# I'm not sure why .tar.bz2 is the tar format of choice for this but it's also what Fedora does so it's what I'm doing
git archive --format=tar --prefix=tests/ v${ver}:src/test/ | bzip2 > ../tests-${ver}.tar.bz2
popd
rm -rf $dir
exit 0