From a5a2e02ea872c2f177d2b179a7c48111fc1c5215 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 15 Mar 2021 16:55:56 +0000 Subject: [PATCH] build: make arm .deb packages be armel architecture This is as recommended by debian. Fixes #5107 --- bin/cross-compile.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bin/cross-compile.go b/bin/cross-compile.go index 536327723..0024931e7 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -161,7 +161,15 @@ func buildZip(dir string) string { // Build .deb and .rpm packages // // It returns a list of artifacts it has made -func buildDebAndRpm(dir, version, goarch string) []string { +func buildDebAndRpm(dir, version, goarchBuild string) []string { + goarch := stripVersion(goarchBuild) + + // Base ARM build we will mark as "arm5" so nfpm puts the + // architecture in as armel not armhf + if goarchBuild == "arm" { + goarch = "arm5" + } + // Make internal version number acceptable to .deb and .rpm pkgVersion := version[1:] pkgVersion = strings.Replace(pkgVersion, "β", "-beta", -1) @@ -376,7 +384,7 @@ func compileArch(version, goos, goarch, dir string) bool { artifacts := []string{buildZip(dir)} // build a .deb and .rpm if appropriate if goos == "linux" { - artifacts = append(artifacts, buildDebAndRpm(dir, version, stripVersion(goarch))...) + artifacts = append(artifacts, buildDebAndRpm(dir, version, goarch)...) } if *copyAs != "" { for _, artifact := range artifacts {