[buildout]
extends =
  ../../component/golang/buildout.cfg

parts =
  gowork

[gowork]
install =
buildflags =  -v --tags server --ldflags "-extldflags 'static' -w -s -X main.GoOS=linux -X main.GoArch=amd64 -X main.Version=2.1 -X main.FullVersion=$FULLVERSION -X main.Build=$(date +%FT%T%z) -X main.WithProvisioning=ON -X main.WithOpenSVC=OFF -X main.WithHaproxy=ON -X main.WithMaxscale=ON  -X main.WithMariadbshardproxy=ON -X  main.WithProxysql=ON -X  main.WithSphinx=ON -X main.WithArbitration=OFF -X main.WithArbitrationClient=ON -X main.WithMonitoring=ON -X main.WithHttp=ON -X main.WithBackup=ON -X main.WithMail=ON -X main.WithEnforce=ON -X main.WithDeprecate=ON"

[gowork.goinstall]
depends_gitfetch  =
    ${git.signal18.io_signal18_repman:recipe}

command = set -e
  . ${gowork:env.sh}
  cd ${git.signal18.io_signal18_repman:location}
  export GO111MODULE=on
  export FULLVERSION=$(git describe --tags)
  go build ${gowork:buildflags} -o ${gowork:bin}/replication-manager
  chmod -R u+w .
# Remove binary files provided with replication manager else testnode will complain with 'libXXX => not found'.
  rm -f ${git.signal18.io_signal18_repman:location}/share/amd64/darwin/*
  rm -f ${git.signal18.io_signal18_repman:location}/share/amd64/linux/*

[git.signal18.io_signal18_repman]
<= go-git-package
go.importpath = github.com/signal18/replication-manager
repository =  https://github.com/signal18/replication-manager
#branch = 2.1
branch = develop
revision = 838ffeb205ea4477f1c1bda607940fa07d8bcf51