From 210fcc5ed0408e59a594d7f8d4bf252d5346f267 Mon Sep 17 00:00:00 2001 From: Gerald Pinder Date: Sun, 9 Feb 2025 16:09:05 -0500 Subject: [PATCH] feat: Create a COPR build of blue-build --- Earthfile | 8 ++++++++ bluebuild.spec | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 bluebuild.spec diff --git a/Earthfile b/Earthfile index 7d7c6db2..939acb4d 100644 --- a/Earthfile +++ b/Earthfile @@ -242,6 +242,14 @@ installer: DO --pass-args +SAVE_IMAGE --SUFFIX="-installer" SAVE ARTIFACT /out/bluebuild +rpm-build: + FROM fedora + RUN dnf -y install --refresh gcc rpm-build rpm-devel rpmlint mock make python3 bash coreutils diffutils patch rpmdevtools cargo + RUN rpmdev-setuptree + COPY bluebuild.spec $HOME/rpmbuild/SPECS/ + RUN rpmbuild -ba ~/rpmbuild/SPECS/bluebuild.spec + RUN mock -r fedora-rawhide-x86_64 --buildsrpm --spec ~/rpmbuild/SPECS/myprogram.spec --resultdir=~/rpmbuild/results + cosign: FROM ghcr.io/sigstore/cosign/cosign:v2.4.2 SAVE ARTIFACT /ko-app/cosign diff --git a/bluebuild.spec b/bluebuild.spec new file mode 100644 index 00000000..397c02e8 --- /dev/null +++ b/bluebuild.spec @@ -0,0 +1,26 @@ +Name: bluebuild +Version: 0.9.6 +Release: 1%{?dist} +Summary: BlueBuild's command line program that builds Containerfiles and custom images based on your recipe.yml. +License: Apache-2.0 +URL: https://github.com/blue-build +Source0: https://github.com/blue-build/cli/archive/refs/tags/v%{version}.tar.gz +BuildRequires: cargo +Requires: podman,buildah + +%description +%{summary} + +%prep +tar -xf %{SOURCE0} +cd v%{version}/ + +%build +cargo build --release + +%install +mkdir -p $RPM_BUILD_ROOT/usr/bin +install -Dm 755 target/release/bluebuild $RPM_BUILD_ROOT/usr/bin/bluebuild + +%clean +rm -rf $RPM_BUILD_ROOT