From baa26a466cfe294134c7817e6dc7855b4b62e68f Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 1 Aug 2024 08:21:08 +0200 Subject: [PATCH 1/3] fix linux package dependencies 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 From 31b5d5f28c02fe85f908aeedb2a83c76c317fdda Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 1 Aug 2024 08:32:26 +0200 Subject: [PATCH 2/3] depend on bash for debian systems Signed-off-by: Moritz Wiesinger --- cmd/goreleaser/internal/configure.go | 5 +++++ distributions/otelcol-contrib/.goreleaser.yaml | 3 +++ distributions/otelcol/.goreleaser.yaml | 3 +++ 3 files changed, 11 insertions(+) diff --git a/cmd/goreleaser/internal/configure.go b/cmd/goreleaser/internal/configure.go index ea1bf117..642faacb 100644 --- a/cmd/goreleaser/internal/configure.go +++ b/cmd/goreleaser/internal/configure.go @@ -146,6 +146,11 @@ func Package(dist string) config.NFPM { "/bin/sh", }, }, + "deb": { + Dependencies: []string{ + "bash", + }, + }, }, NFPMOverridables: config.NFPMOverridables{ diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index 24a8de9e..8db121f6 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -69,6 +69,9 @@ nfpms: postinstall: postinstall.sh preremove: preremove.sh overrides: + deb: + dependencies: + - bash rpm: dependencies: - /bin/sh diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index 3ffd9e4f..293acf15 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -69,6 +69,9 @@ nfpms: postinstall: postinstall.sh preremove: preremove.sh overrides: + deb: + dependencies: + - bash rpm: dependencies: - /bin/sh From 59369af034b3031ee2f9854727d9ca4cfeb05746 Mon Sep 17 00:00:00 2001 From: Moritz Wiesinger Date: Thu, 1 Aug 2024 09:45:50 +0200 Subject: [PATCH 3/3] revert bash dependency Signed-off-by: Moritz Wiesinger --- cmd/goreleaser/internal/configure.go | 5 ----- distributions/otelcol-contrib/.goreleaser.yaml | 3 --- distributions/otelcol/.goreleaser.yaml | 3 --- 3 files changed, 11 deletions(-) diff --git a/cmd/goreleaser/internal/configure.go b/cmd/goreleaser/internal/configure.go index 642faacb..ea1bf117 100644 --- a/cmd/goreleaser/internal/configure.go +++ b/cmd/goreleaser/internal/configure.go @@ -146,11 +146,6 @@ func Package(dist string) config.NFPM { "/bin/sh", }, }, - "deb": { - Dependencies: []string{ - "bash", - }, - }, }, NFPMOverridables: config.NFPMOverridables{ diff --git a/distributions/otelcol-contrib/.goreleaser.yaml b/distributions/otelcol-contrib/.goreleaser.yaml index 8db121f6..24a8de9e 100644 --- a/distributions/otelcol-contrib/.goreleaser.yaml +++ b/distributions/otelcol-contrib/.goreleaser.yaml @@ -69,9 +69,6 @@ nfpms: postinstall: postinstall.sh preremove: preremove.sh overrides: - deb: - dependencies: - - bash rpm: dependencies: - /bin/sh diff --git a/distributions/otelcol/.goreleaser.yaml b/distributions/otelcol/.goreleaser.yaml index 293acf15..3ffd9e4f 100644 --- a/distributions/otelcol/.goreleaser.yaml +++ b/distributions/otelcol/.goreleaser.yaml @@ -69,9 +69,6 @@ nfpms: postinstall: postinstall.sh preremove: preremove.sh overrides: - deb: - dependencies: - - bash rpm: dependencies: - /bin/sh