rpm

package
v0.22.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(topDir, workerImg llb.State, specPath string, caches CacheInfo, opts ...llb.ConstraintsOpt) llb.State

Builds an RPM and source RPM from a spec

`topDir` is the rpmbuild top directory which should contain the SOURCES and SPECS directories along with any other necessary files

`workerImg` is the image to use for the build It is expected to have rpmbuild and any other necessary build dependencies installed

`specPath` is the path to the spec file to build relative to `topDir`

func BuildRoot added in v0.19.0

func BuildRoot(worker llb.State, spec *dalec.Spec, sOpt dalec.SourceOpts, targetKey string, opts ...llb.ConstraintsOpt) llb.State

func BuildRootWithMacros added in v0.22.0

func BuildRootWithMacros(worker llb.State, spec *dalec.Spec, sOpt dalec.SourceOpts, targetKey string, macros []SpecMacro, opts ...llb.ConstraintsOpt) llb.State

BuildRootWithMacros is like BuildRoot but also emits the provided distro-specific rpm macro overrides at the top of the generated spec.

func FormatVersionConstraint

func FormatVersionConstraint(v string) string

NOTE: This is very basic and does not handle things like grouped constraints Given this is just trying to shim things to allow either the rpm format or the deb format in its basic form, this is sufficient for now.

func RPMSpec added in v0.19.0

func RPMSpec(spec *dalec.Spec, in llb.State, targetKey, dir string, opts ...llb.ConstraintsOpt) llb.State

func RPMSpecWithMacros added in v0.22.0

func RPMSpecWithMacros(spec *dalec.Spec, in llb.State, targetKey, dir string, filter dalec.SourceFilterConfig, macros []SpecMacro, opts ...llb.ConstraintsOpt) llb.State

RPMSpecWithMacros is like RPMSpecWithSourceFilter but also emits the provided distro-specific rpm macro overrides at the top of the generated spec.

func RPMSpecWithSourceFilter added in v0.20.8

func RPMSpecWithSourceFilter(spec *dalec.Spec, in llb.State, targetKey, dir string, filter dalec.SourceFilterConfig, opts ...llb.ConstraintsOpt) llb.State

func Sources added in v0.19.0

func Sources(worker llb.State, spec *dalec.Spec, sOpt dalec.SourceOpts, opts ...llb.ConstraintsOpt) []llb.State

func ValidateSpec

func ValidateSpec(spec *dalec.Spec) (out error)

ValidateSpec makes sure all the necessary fields are present in the spec to make rpmbuild work This validation is specific to rpmbuild.

func WriteSpec

func WriteSpec(spec *dalec.Spec, target string, w io.Writer) error

WriteSpec generates an rpm spec from the provided dalec.Spec and distro target and writes it to the passed in writer

func WriteSpecWithSourceFilter added in v0.20.8

func WriteSpecWithSourceFilter(spec *dalec.Spec, target string, filter dalec.SourceFilterConfig, w io.Writer) error

Types

type CacheInfo

type CacheInfo struct {
	TargetKey string
	Caches    []dalec.CacheConfig
}

type SpecMacro added in v0.22.0

type SpecMacro struct {
	Name   string
	Value  string
	Define bool
}

SpecMacro is a single rpm macro override that a distro can request be emitted at the very top of the generated spec (before the preamble). It lets distro configs express their macro differences as data instead of the template layer hard-coding per-distro knowledge.

Define controls how the macro is written:

  • false (default) emits "%global Name Value", which expands Value eagerly at definition time. Use this for plain path/string overrides.
  • true emits "%define Name Value", which defers expansion of any macros in Value until the macro is actually used. Use this when Value references another macro that may be redefined later in the spec (e.g. __os_install_post referencing %{__strip}, which DisableStrip() overrides).

func (SpecMacro) String added in v0.22.0

func (m SpecMacro) String() string

String renders the macro as a single rpm spec directive line. It uses "%define" (deferred expansion) when Define is true and "%global" (eager expansion) otherwise. See the type doc for when to use each.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL