diff --git a/internal/pipe/nfpm/nfpm.go b/internal/pipe/nfpm/nfpm.go index babc6216be2..cd9e317a2da 100644 --- a/internal/pipe/nfpm/nfpm.go +++ b/internal/pipe/nfpm/nfpm.go @@ -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, diff --git a/pkg/config/config.go b/pkg/config/config.go index 21814ea1e79..bd0ee74603a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -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"` } diff --git a/www/docs/customization/nfpm.md b/www/docs/customization/nfpm.md index 8301733bfe8..cf1083da377 100644 --- a/www/docs/customization/nfpm.md +++ b/www/docs/customization/nfpm.md @@ -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 @@ -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