build 1.1 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. [% pc('go', 'var/setup', { go_tarfile => c('input_files_by_name/go') }) %]
  4. distdir=/var/tmp/dist/[% project %]
  5. [% c("var/set_PTDIR_DOCSDIR") -%]
  6. mkdir -p $PTDIR
  7. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goptlib') %]
  8. tar -C /var/tmp/dist -xf [% c('input_files_by_name/ed25519') %]
  9. tar -C /var/tmp/dist -xf [% c('input_files_by_name/siphash') %]
  10. tar -C /var/tmp/dist -xf [% c('input_files_by_name/uniuri') %]
  11. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goxcrypto') %]
  12. tar -C /var/tmp/dist -xf [% c('input_files_by_name/goxnet') %]
  13. mkdir -p /var/tmp/build
  14. tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
  15. cd /var/tmp/build/[% project %]-[% c('version') %]
  16. mkdir -p "$GOPATH/src/git.torproject.org/pluggable-transports"
  17. ln -sf "$PWD" "$GOPATH/src/git.torproject.org/pluggable-transports/obfs4.git"
  18. cd obfs4proxy
  19. go build -ldflags '-s'
  20. cp -a obfs4proxy[% IF c("var/windows") %].exe[% END %] $PTDIR
  21. cd $distdir
  22. [% c('tar', {
  23. tar_src => [ '.' ],
  24. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  25. }) %]