mirror of
https://github.com/octoleo/syncthing.git
synced 2025-04-11 03:51:51 +00:00
Merge pull request #2702 from calmh/codesign
Codesign binaries in Mac OS X distribution packages
This commit is contained in:
commit
f88b2c11fe
23
build.go
23
build.go
@ -255,6 +255,9 @@ func buildTar() {
|
|||||||
files = append(files, archiveFile{src: file, dst: name + "/" + filepath.Base(file)})
|
files = append(files, archiveFile{src: file, dst: name + "/" + filepath.Base(file)})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if goos == "darwin" {
|
||||||
|
macosCodesign("syncthing")
|
||||||
|
}
|
||||||
tarGz(filename, files)
|
tarGz(filename, files)
|
||||||
log.Println(filename)
|
log.Println(filename)
|
||||||
}
|
}
|
||||||
@ -743,3 +746,23 @@ func lint(pkg string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func macosCodesign(file string) {
|
||||||
|
if pass := os.Getenv("CODESIGN_KEYCHAIN_PASS"); pass != "" {
|
||||||
|
bs, err := runError("security", "unlock-keychain", "-p", pass)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Codesign: unlocking keychain failed:", string(bs))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if id := os.Getenv("CODESIGN_IDENTITY"); id != "" {
|
||||||
|
bs, err := runError("codesign", "-s", id, file)
|
||||||
|
if err != nil {
|
||||||
|
log.Println("Codesign: signing failed:", string(bs))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println("Codesign: successfully signed", file)
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user