Skip to content
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

feat: nfpm rpm.summary and nfpm.ghost_files #1892

Merged
merged 2 commits into from Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/pipe/nfpm/nfpm.go
Expand Up @@ -197,8 +197,10 @@ func create(ctx *context.Context, fpm config.NFPM, format, arch string, binaries
},
},
RPM: nfpm.RPM{
Summary: overridden.RPM.Summary,
Group: overridden.RPM.Group,
Compression: overridden.RPM.Compression,
GhostFiles: overridden.RPM.GhostFiles,
ConfigNoReplaceFiles: overridden.RPM.ConfigNoReplaceFiles,
Signature: nfpm.RPMSignature{
KeyFile: overridden.RPM.Signature.KeyFile,
Expand Down
2 changes: 2 additions & 0 deletions pkg/config/config.go
Expand Up @@ -331,10 +331,12 @@ type NFPMRPMSignature struct {

// NFPMRPM is custom configs that are only available on RPM packages.
type NFPMRPM struct {
Summary string `yaml:"summary,omitempty"`
Group string `yaml:"group,omitempty"`
Compression string `yaml:"compression,omitempty"`
// https://www.cl.cam.ac.uk/~jw35/docs/rpm_config.html
ConfigNoReplaceFiles map[string]string `yaml:"config_noreplace_files,omitempty"`
GhostFiles []string `yaml:"ghost_files,omitempty"`
Signature NFPMRPMSignature `yaml:"signature,omitempty"`
}

Expand Down
18 changes: 18 additions & 0 deletions www/docs/customization/nfpm.md
Expand Up @@ -165,6 +165,10 @@ nfpms:

# Custon configuration applied only to the RPM packager.
rpm:
# The package summary.
# Defaults to the first line of the description.
summary: Explicit Summary for Sample Package

# The package group. This option is deprecated by most distros
# but required by old distros like CentOS 5 / EL 5 and earlier.
group: Unspecified
Expand All @@ -177,6 +181,20 @@ nfpms:
config_noreplace_files:
path/to/local/bar.con: /etc/bar.conf

# These files are not actually present in the package, but the file names
# are added to the package header. From the RPM directives documentation:
#
# "There are times when a file should be owned by the package but not
# installed - log files and state files are good examples of cases you might
# desire this to happen."
#
# "The way to achieve this, is to use the %ghost directive. By adding this
# directive to the line containing a file, RPM will know about the ghosted
# file, but will not add it to the package."
ghost_files:
- /etc/casper.conf
- /var/log/boo.log

# The package is signed if a key_file is set
signature:
# PGP secret key (can also be ASCII-armored). The passphrase is taken
Expand Down