-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge evan-goode/bootc
branch to master
#2203
Merged
ppisar
merged 7 commits into
rpm-software-management:master
from
evan-goode:evan-goode/bootc
Feb 6, 2025
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6b985e7
copr: Add Copr build files
dcantrell 58fafe3
Add support for --transient
evan-goode 0da8dc1
bootc: Document `--transient` and `persistence`
evan-goode 5776b1a
bootc: Use ostree GObject API to get deployment status
evan-goode 825cdb8
bootc: "Re-locking": use ostree admin unlock --transient
evan-goode d22e532
spec: Add dnf-bootc subpackage
evan-goode d455f2d
Require libdnf >= 0.74.0 with `persistence` option
evan-goode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Copyright David Cantrell <[email protected]> | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
# Set the top level source directory | ||
topdir := $(shell realpath $(dir $(lastword $(MAKEFILE_LIST)))/..) | ||
|
||
# Install packages before anything else | ||
_install := $(shell dnf install -y git) | ||
_safedir := $(shell git config --global --add safe.directory $(topdir)) | ||
|
||
# Pass BUILDTYPE=release to generate a release SRPM | ||
BUILDTYPE ?= copr | ||
|
||
# Spec file and template | ||
SPEC_TEMPLATE = $(shell ls -1 $(topdir)/*.spec) | ||
SPEC = $(topdir)/$(shell basename $(SPEC_TEMPLATE)) | ||
|
||
# Replace placeholders in the spec file template | ||
RPMDATE = $(shell date +'%a %b %d %Y') | ||
#RPMAUTHOR = $(shell git log | grep ^Author: | head -n 1 | cut -d ' ' -f 2,3,4) | ||
RPMAUTHOR = David Cantrell <[email protected]> | ||
|
||
# Various things we need to generate a tarball | ||
PKG = $(shell rpmspec -P "$(SPEC_TEMPLATE)" | grep ^Name: | awk '{ print $$2; }') | ||
VER = $(shell rpmspec -P "$(SPEC_TEMPLATE)" | grep ^Version: | awk '{ print $$2; }') | ||
|
||
ifeq ($(BUILDTYPE),copr) | ||
GITDATE = $(shell date +'%Y%m%d%H%M') | ||
GITHASH = $(shell git rev-parse --short HEAD) | ||
TARBALL_BASENAME = $(PKG)-$(VER)-$(GITDATE)git$(GITHASH) | ||
TAG = HEAD | ||
else | ||
TAG = $(shell git describe --tags --abbrev=0) | ||
endif | ||
|
||
ifeq ($(BUILDTYPE),release) | ||
TARBALL_BASENAME = $(PKG)-$(VER) | ||
endif | ||
|
||
# Where to insert the changelog entry | ||
STARTING_POINT = $(shell expr $(shell grep -n ^%changelog "$(SPEC)" | cut -d ':' -f 1) + 1) | ||
|
||
srpm: | ||
sed -i -e '1i %global source_date_epoch_from_changelog 0' "$(SPEC)" | ||
sed -e 's|%%VERSION%%|$(VER)|g' < "$(SPEC_TEMPLATE)" > "$(SPEC)".new | ||
mv "$(SPEC)".new "$(SPEC)" | ||
ifeq ($(BUILDTYPE),copr) | ||
sed -i -e '/^Release:/ s/1[^%]*/0.1.$(GITDATE)git$(GITHASH)/' "$(SPEC)" | ||
sed -i -e 's|^Source0:.*$$|Source0: $(TARBALL_BASENAME).tar.gz|g' "$(SPEC)" | ||
sed -i -e 's|^%autosetup.*$$|%autosetup -n $(TARBALL_BASENAME)|g' "$(SPEC)" | ||
sed -i -e '$(STARTING_POINT)a\\' "$(SPEC)" | ||
sed -i -e '$(STARTING_POINT)a - Build $(PKG)-$(VER)-$(GITDATE)git$(GITHASH) snapshot' "$(SPEC)" | ||
sed -i -e '$(STARTING_POINT)a * $(RPMDATE) $(RPMAUTHOR) - $(VER)-$(GITDATE)git$(GITHASH)' "$(SPEC)" | ||
endif | ||
git archive \ | ||
--format=tar \ | ||
--output='$(topdir)/$(TARBALL_BASENAME).tar' \ | ||
--prefix='$(TARBALL_BASENAME)/' $(TAG) $(topdir) | ||
gzip -9f $(topdir)/$(TARBALL_BASENAME).tar | ||
rpmbuild \ | ||
-bs --nodeps \ | ||
--define "_sourcedir $(topdir)" \ | ||
--define "_srcrpmdir $(outdir)" \ | ||
--define "_rpmdir $(outdir)" "$(SPEC)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
%define __cmake_in_source_build 1 | ||
|
||
# default dependencies | ||
%global hawkey_version 0.73.1 | ||
%global hawkey_version 0.74.0 | ||
%global libcomps_version 0.1.8 | ||
%global libmodulemd_version 2.9.3 | ||
%global rpm_version 4.14.0 | ||
|
@@ -190,6 +190,17 @@ Requires: python3-%{name} = %{version}-%{release} | |
%description automatic | ||
Systemd units that can periodically download package upgrades and apply them. | ||
|
||
%package bootc | ||
Summary: %{pkg_summary} - additional bootc dependencies | ||
Requires: python3-%{name} = %{version}-%{release} | ||
Requires: ostree | ||
Requires: ostree-libs | ||
Requires: python3-gobject-base | ||
Requires: util-linux-core | ||
|
||
%description bootc | ||
Additional dependencies needed to perform transactions on booted bootc (bootable containers) systems. | ||
|
||
|
||
%prep | ||
%autosetup | ||
|
@@ -420,6 +431,9 @@ popd | |
%{python3_sitelib}/%{name}/automatic/ | ||
%endif | ||
|
||
%files bootc | ||
# bootc subpackage does not include any files | ||
|
||
%changelog | ||
* Tue Nov 12 2024 Evan Goode <[email protected]> - 4.22.0-1 | ||
- doc: Naming of source and debug repos | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There will always be a "transient". A few lines above is
assert self.conf.persistence in ("auto", "transient")
. And "auto" is handled.But, OK. The extra
assert
doesn't break anything.