@@ -85,6 +85,13 @@ var archFlags = map[string][]string{
8585 "arm-v7" : {"GOARM=7" },
8686}
8787
88+ // Map Go architectures to NFPM architectures
89+ // Any missing are passed straight through
90+ var goarchToNfpm = map [string ]string {
91+ "arm" : "arm6" ,
92+ "arm-v7" : "arm7" ,
93+ }
94+
8895// runEnv - run a shell command with env
8996func runEnv (args , env []string ) error {
9097 if * debug {
@@ -167,11 +174,15 @@ func buildDebAndRpm(dir, version, goarch string) []string {
167174 pkgVersion := version [1 :]
168175 pkgVersion = strings .Replace (pkgVersion , "β" , "-beta" , - 1 )
169176 pkgVersion = strings .Replace (pkgVersion , "-" , "." , - 1 )
177+ nfpmArch , ok := goarchToNfpm [goarch ]
178+ if ! ok {
179+ nfpmArch = goarch
180+ }
170181
171182 // Make nfpm.yaml from the template
172183 substitute ("../bin/nfpm.yaml" , path .Join (dir , "nfpm.yaml" ), map [string ]string {
173184 "Version" : pkgVersion ,
174- "Arch" : goarch ,
185+ "Arch" : nfpmArch ,
175186 })
176187
177188 // build them
@@ -377,7 +388,7 @@ func compileArch(version, goos, goarch, dir string) bool {
377388 artifacts := []string {buildZip (dir )}
378389 // build a .deb and .rpm if appropriate
379390 if goos == "linux" {
380- artifacts = append (artifacts , buildDebAndRpm (dir , version , stripVersion ( goarch ) )... )
391+ artifacts = append (artifacts , buildDebAndRpm (dir , version , goarch )... )
381392 }
382393 if * copyAs != "" {
383394 for _ , artifact := range artifacts {
0 commit comments