@ -24,8 +24,8 @@ import (
)
)
type tgzTarget struct {
type tgzTarget struct {
filenameArch string // arch to use in filename instead of deriving from go e nv["GOARCH"]
filenameArch string // arch to use in filename instead of deriving from go E nv["GOARCH"]
go e nv map [ string ] string
go E nv map [ string ] string
signer crypto . Signer
signer crypto . Signer
}
}
@ -33,11 +33,11 @@ func (t *tgzTarget) arch() string {
if t . filenameArch != "" {
if t . filenameArch != "" {
return t . filenameArch
return t . filenameArch
}
}
return t . go e nv[ "GOARCH" ]
return t . go E nv[ "GOARCH" ]
}
}
func ( t * tgzTarget ) os ( ) string {
func ( t * tgzTarget ) os ( ) string {
return t . go e nv[ "GOOS" ]
return t . go E nv[ "GOOS" ]
}
}
func ( t * tgzTarget ) String ( ) string {
func ( t * tgzTarget ) String ( ) string {
@ -46,18 +46,18 @@ func (t *tgzTarget) String() string {
func ( t * tgzTarget ) Build ( b * dist . Build ) ( [ ] string , error ) {
func ( t * tgzTarget ) Build ( b * dist . Build ) ( [ ] string , error ) {
var filename string
var filename string
if t . go e nv[ "GOOS" ] == "linux" {
if t . go E nv[ "GOOS" ] == "linux" {
// Linux used to be the only tgz architecture, so we didn't put the OS
// Linux used to be the only tgz architecture, so we didn't put the OS
// name in the filename.
// name in the filename.
filename = fmt . Sprintf ( "tailscale_%s_%s.tgz" , b . Version . Short , t . arch ( ) )
filename = fmt . Sprintf ( "tailscale_%s_%s.tgz" , b . Version . Short , t . arch ( ) )
} else {
} else {
filename = fmt . Sprintf ( "tailscale_%s_%s_%s.tgz" , b . Version . Short , t . os ( ) , t . arch ( ) )
filename = fmt . Sprintf ( "tailscale_%s_%s_%s.tgz" , b . Version . Short , t . os ( ) , t . arch ( ) )
}
}
ts , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscale" , t . go e nv)
ts , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscale" , t . go E nv)
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
tsd , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscaled" , t . go e nv)
tsd , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscaled" , t . go E nv)
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
@ -173,19 +173,19 @@ func (t *tgzTarget) Build(b *dist.Build) ([]string, error) {
}
}
type debTarget struct {
type debTarget struct {
go e nv map [ string ] string
go E nv map [ string ] string
}
}
func ( t * debTarget ) os ( ) string {
func ( t * debTarget ) os ( ) string {
return t . go e nv[ "GOOS" ]
return t . go E nv[ "GOOS" ]
}
}
func ( t * debTarget ) arch ( ) string {
func ( t * debTarget ) arch ( ) string {
return t . go e nv[ "GOARCH" ]
return t . go E nv[ "GOARCH" ]
}
}
func ( t * debTarget ) String ( ) string {
func ( t * debTarget ) String ( ) string {
return fmt . Sprintf ( "linux/%s/deb" , t . go e nv[ "GOARCH" ] )
return fmt . Sprintf ( "linux/%s/deb" , t . go E nv[ "GOARCH" ] )
}
}
func ( t * debTarget ) Build ( b * dist . Build ) ( [ ] string , error ) {
func ( t * debTarget ) Build ( b * dist . Build ) ( [ ] string , error ) {
@ -193,11 +193,11 @@ func (t *debTarget) Build(b *dist.Build) ([]string, error) {
return nil , errors . New ( "deb only supported on linux" )
return nil , errors . New ( "deb only supported on linux" )
}
}
ts , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscale" , t . go e nv)
ts , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscale" , t . go E nv)
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
tsd , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscaled" , t . go e nv)
tsd , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscaled" , t . go E nv)
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
@ -284,15 +284,16 @@ func (t *debTarget) Build(b *dist.Build) ([]string, error) {
}
}
type rpmTarget struct {
type rpmTarget struct {
goenv map [ string ] string
goEnv map [ string ] string
signFn func ( io . Reader ) ( [ ] byte , error )
}
}
func ( t * rpmTarget ) os ( ) string {
func ( t * rpmTarget ) os ( ) string {
return t . go e nv[ "GOOS" ]
return t . go E nv[ "GOOS" ]
}
}
func ( t * rpmTarget ) arch ( ) string {
func ( t * rpmTarget ) arch ( ) string {
return t . go e nv[ "GOARCH" ]
return t . go E nv[ "GOARCH" ]
}
}
func ( t * rpmTarget ) String ( ) string {
func ( t * rpmTarget ) String ( ) string {
@ -304,11 +305,11 @@ func (t *rpmTarget) Build(b *dist.Build) ([]string, error) {
return nil , errors . New ( "rpm only supported on linux" )
return nil , errors . New ( "rpm only supported on linux" )
}
}
ts , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscale" , t . go e nv)
ts , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscale" , t . go E nv)
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
tsd , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscaled" , t . go e nv)
tsd , err := b . BuildGoBinary ( "tailscale.com/cmd/tailscaled" , t . go E nv)
if err != nil {
if err != nil {
return nil , err
return nil , err
}
}
@ -375,6 +376,11 @@ func (t *rpmTarget) Build(b *dist.Build) ([]string, error) {
Conflicts : [ ] string { "tailscale-relay" } ,
Conflicts : [ ] string { "tailscale-relay" } ,
RPM : nfpm . RPM {
RPM : nfpm . RPM {
Group : "Network" ,
Group : "Network" ,
Signature : nfpm . RPMSignature {
PackageSignature : nfpm . PackageSignature {
SignFn : t . signFn ,
} ,
} ,
} ,
} ,
} ,
} ,
} )
} )