build 927 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
  4. export CGO_ENABLED=0
  5. distdir=/var/tmp/dist/[% project %]
  6. mkdir -p $distdir
  7. [% FOREACH dep = c("var/go_lib_deps") -%]
  8. tar -C /var/tmp/dist -xf [% c('input_files_by_name/' _ dep) %]
  9. [% END -%]
  10. mkdir -p $GOPATH/src/github.com/namecoin
  11. tar -C $GOPATH/src/github.com/namecoin -xf [% project %]-[% c('version') %].tar.gz
  12. mv $GOPATH/src/github.com/namecoin/ncprop279-[% c('version') %] $GOPATH/src/github.com/namecoin/ncprop279
  13. TAGS="-tags no_namecoin_tls"
  14. go install $TAGS -ldflags '-s' github.com/namecoin/ncprop279
  15. [% IF c("var/linux-x86_64") -%]
  16. GOPATHBIN="${GOPATH}/bin"
  17. [% ELSE -%]
  18. GOPATHBIN="${GOPATH}/bin/${GOOS}_${GOARCH}"
  19. [% END -%]
  20. cp -a $GOPATHBIN/ncprop279 $distdir/
  21. cd $distdir
  22. [% c('tar', {
  23. tar_src => [ '.' ],
  24. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  25. }) %]