From 73a756f723721dd5c9a21beae765670609ba40a0 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Tue, 6 Aug 2024 11:09:04 +0200 Subject: [PATCH] fix linux package dependencies (#620) * fix linux package dependencies Signed-off-by: Moritz Wiesinger * depend on bash for debian systems Signed-off-by: Moritz Wiesinger * revert bash dependency Signed-off-by: Moritz Wiesinger --------- Signed-off-by: Moritz Wiesinger --- cmd/goreleaser/internal/configure.go | 8 +++++++- distributions/otelcol-contrib/.goreleaser.yaml | 6 ++++-- distributions/otelcol/.goreleaser.yaml | 6 ++++-- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/cmd/goreleaser/internal/configure.go b/cmd/goreleaser/internal/configure.go index 4bc6480d..ea1bf117 100644 --- a/cmd/goreleaser/internal/configure.go +++ b/cmd/goreleaser/internal/configure.go @@ -140,6 +140,13 @@ func Package(dist string) config.NFPM { License: "Apache 2.0", Description: fmt.Sprintf("OpenTelemetry Collector - %s", dist), Maintainer: "The OpenTelemetry Collector maintainers ", + Overrides: map[string]config.NFPMOverridables{ + "rpm": { + Dependencies: []string{ + "/bin/sh", + }, + }, + }, NFPMOverridables: config.NFPMOverridables{ PackageName: dist, @@ -164,7 +171,6 @@ func Package(dist string) config.NFPM { Type: "config|noreplace", }, }, - Dependencies: []string{"/bin/sh"}, }, } } diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index 389f0029..24a8de9e 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -55,8 +55,6 @@ archives: name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' nfpms: - package_name: otelcol-contrib - dependencies: - - /bin/sh contents: - src: otelcol-contrib.service dst: /lib/systemd/system/otelcol-contrib.service @@ -70,6 +68,10 @@ nfpms: preinstall: preinstall.sh postinstall: postinstall.sh preremove: preremove.sh + overrides: + rpm: + dependencies: + - /bin/sh id: otelcol-contrib builds: - otelcol-contrib diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index f13a0327..3ffd9e4f 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -55,8 +55,6 @@ archives: name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' nfpms: - package_name: otelcol - dependencies: - - /bin/sh contents: - src: otelcol.service dst: /lib/systemd/system/otelcol.service @@ -70,6 +68,10 @@ nfpms: preinstall: preinstall.sh postinstall: postinstall.sh preremove: preremove.sh + overrides: + rpm: + dependencies: + - /bin/sh id: otelcol builds: - otelcol