diff --git a/artifacts.go b/artifacts.go index f19b8677a..93592a487 100644 --- a/artifacts.go +++ b/artifacts.go @@ -12,6 +12,8 @@ import ( type Artifacts struct { // Binaries is the list of binaries to include in the package. Binaries map[string]ArtifactConfig `yaml:"binaries,omitempty" json:"binaries,omitempty"` + // Libexec is the list of additional binaries that may be invoked by the main package binary. + Libexec map[string]ArtifactConfig `yaml:"libexec,omitempty" json:"libexec,omitempty"` // Manpages is the list of manpages to include in the package. Manpages map[string]ArtifactConfig `yaml:"manpages,omitempty" json:"manpages,omitempty"` // DataDirs is a list of read-only architecture-independent data files, to be placed in /usr/share/ diff --git a/docs/spec.schema.json b/docs/spec.schema.json index 26ac5b994..71dbf8898 100644 --- a/docs/spec.schema.json +++ b/docs/spec.schema.json @@ -76,6 +76,13 @@ "type": "object", "description": "Binaries is the list of binaries to include in the package." }, + "libexec": { + "additionalProperties": { + "$ref": "#/$defs/ArtifactConfig" + }, + "type": "object", + "description": "Libexec is the list of additional binaries that may be invoked by the main package binary." + }, "manpages": { "additionalProperties": { "$ref": "#/$defs/ArtifactConfig" diff --git a/frontend/rpm/template.go b/frontend/rpm/template.go index a446308d5..e63efe8ca 100644 --- a/frontend/rpm/template.go +++ b/frontend/rpm/template.go @@ -499,6 +499,14 @@ func (w *specWrapper) Install() fmt.Stringer { } } + if w.Spec.Artifacts.Libexec != nil { + libexecFileKeys := dalec.SortMapKeys(w.Spec.Artifacts.Libexec) + for _, k := range libexecFileKeys { + le := w.Spec.Artifacts.Libexec[k] + copyArtifact(`%{buildroot}/%{_libexecdir}`, k, &le) + } + } + configKeys := dalec.SortMapKeys(w.Spec.Artifacts.ConfigFiles) for _, c := range configKeys { cfg := w.Spec.Artifacts.ConfigFiles[c] diff --git a/load.go b/load.go index 0ccccbe6c..ad6749dfe 100644 --- a/load.go +++ b/load.go @@ -445,6 +445,13 @@ func (s *Spec) FillDefaults() { s.Patches[k][i].Strip = &strip } } + + for k, ac := range s.Artifacts.Libexec { + if s.Artifacts.Libexec[k].SubPath == "" { + ac.SubPath = s.Name + s.Artifacts.Libexec[k] = ac + } + } } func (s Spec) Validate() error {