diff --git a/README.md b/README.md index 223cd3d17..754469995 100644 --- a/README.md +++ b/README.md @@ -331,6 +331,13 @@ GoReleaser can be wired to [fpm]() to generate `.deb`, `.rpm` and other archives ```yml # goreleaser.yml fpm: + # Options used in deb control file etc. + options: + vendor: "Drum Roll Inc." + url: "https://example.com/" + maintainer: "" + description: "Software to create fast and easy drum rolls." + license: "Apache 2.0" # Formats to generate as output formats: - deb diff --git a/config/config.go b/config/config.go index 5fb6554a7..668b64b12 100644 --- a/config/config.go +++ b/config/config.go @@ -68,6 +68,16 @@ type FPM struct { Formats []string Dependencies []string Conflicts []string + Options FPMOptions +} + +// FPM config options +type FPMOptions struct { + Vendor string + URL string + Maintainer string + Description string + License string } // Project includes all project configuration diff --git a/pipeline/fpm/fpm.go b/pipeline/fpm/fpm.go index 74d8ef564..626fa560c 100644 --- a/pipeline/fpm/fpm.go +++ b/pipeline/fpm/fpm.go @@ -70,6 +70,22 @@ func create(ctx *context.Context, format, archive, arch string) error { "--package", file, "--force", } + + if ctx.Config.FPM.Options.Vendor != "" { + options = append(options, "--vendor", ctx.Config.FPM.Options.Vendor) + } + if ctx.Config.FPM.Options.URL != "" { + options = append(options, "--url", ctx.Config.FPM.Options.URL) + } + if ctx.Config.FPM.Options.Maintainer != "" { + options = append(options, "--maintainer", ctx.Config.FPM.Options.Maintainer) + } + if ctx.Config.FPM.Options.Description != "" { + options = append(options, "--description", ctx.Config.FPM.Options.Description) + } + if ctx.Config.FPM.Options.License != "" { + options = append(options, "--license", ctx.Config.FPM.Options.License) + } for _, dep := range ctx.Config.FPM.Dependencies { options = append(options, "--depends", dep) }