build 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. distdir="/var/tmp/dist/[% project %]"
  4. [% c("var/set_PTDIR_DOCSDIR") -%]
  5. mkdir -p $PTDIR $DOCSDIR
  6. [% IF c("var/windows") -%]
  7. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  8. [% ELSE -%]
  9. [% END -%]
  10. mkdir -p $distdir
  11. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/pycrypto') %]
  12. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/twisted') %]
  13. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/argparse') %]
  14. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/parsley') %]
  15. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/pyptlib') %]
  16. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/pyyaml') %]
  17. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/txsocksx') %]
  18. tar -C $distdir -xf $rootdir/[% c('input_files_by_name/zope.interface') %]
  19. mkdir -p /var/tmp/build
  20. tar -C /var/tmp/build -xf $rootdir/[% project %]-[% c('version') %].tar.gz
  21. cd /var/tmp/build/[% project %]-[% c('version') %]
  22. [% IF c("var/windows") -%]
  23. pydir="$distdir/python"
  24. export PYTHONPATH="$(wine winepath -w $pydir)\\Lib\\site-packages"
  25. $PYTHON setup_py2exe.py py2exe
  26. $PYTHON setup.py install --prefix=$(wine winepath -w $pydir)
  27. py2exe_zip_timestomp py2exe_bundle/dist/obfsproxy.zip
  28. cp -an py2exe_bundle/dist/{*.pyd,*.exe,*.zip} $PTDIR/
  29. # http://bugs.winehq.org/show_bug.cgi?id=3591
  30. cp -a /var/tmp/dist/winpython/python27.dll $PTDIR
  31. [% ELSE -%]
  32. export PYTHON=python2
  33. $PYTHON setup.py build --build-lib build
  34. cp -a build/obfsproxy $PTDIR/
  35. cp -a bin/obfsproxy $PTDIR/obfsproxy.bin
  36. [% END -%]
  37. cp -a {LICENSE,README} $DOCSDIR
  38. cd $distdir
  39. [% c('tar', {
  40. tar_src => [ '.' ],
  41. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  42. }) %]