build 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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=[% c("var/cgo") %]
  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. #mkdir -p /var/tmp/build
  16. #tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  17. #cd /var/tmp/build/[% project %]-[% c('version') %]
  18. #mkdir -p "$GOPATH/src/github.com/namecoin"
  19. #ln -sf "$PWD" "$GOPATH/src/github.com/namecoin/ncdns"
  20. #mkdir -p out
  21. #cd out
  22. #for x in .. ../ncdumpzone ../generate_nmc_cert; do
  23. # go build -ldflags '-s' "$x"
  24. #done
  25. [% IF c("var/linux-x86_64") -%]
  26. GOPATHBIN="${GOPATH}/bin"
  27. [% ELSE -%]
  28. GOPATHBIN="${GOPATH}/bin/${GOOS}_${GOARCH}"
  29. [% END -%]
  30. ls $GOPATHBIN
  31. cp -a $GOPATHBIN/ncprop279[% IF c("var/windows") %].exe[% END %] $distdir/
  32. cd $distdir
  33. [% c('tar', {
  34. tar_src => [ '.' ],
  35. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  36. }) %]