build 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. [% c("var/set_default_env") -%]
  3. distdir="/var/tmp/dist/[% project %]"
  4. [% IF c("var/linux") -%]
  5. [% c("var/set_PTDIR_DOCSDIR") -%]
  6. mkdir -p $PTDIR
  7. [% END -%]
  8. [% IF c("var/windows") -%]
  9. [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
  10. [% END -%]
  11. mkdir -p /var/tmp/build
  12. unzip -d /var/tmp/build $rootdir/[% project %]-[% c('version') %].zip
  13. cd /var/tmp/build/[% project %]-[% c('version') %]
  14. [% IF c("var/windows") -%]
  15. find -type f -print0 | xargs -0 [% c("var/touch") %]
  16. pydir="$distdir/python"
  17. mkdir -p $pydir/Lib/site-packages
  18. export PYTHONPATH="$(wine winepath -w $pydir)\\Lib\\site-packages"
  19. export FAKETIME="[% USE date; GET date.format(c('timestamp'), format = '%Y-%m-%d %H:%M:%S') %]"
  20. LD_PRELOAD= $PYTHON setup.py build_ext -c mingw32
  21. $PYTHON setup.py install --single-version-externally-managed --record /dev/null --prefix=$(wine winepath -w $pydir)
  22. # Must create this file in order for py2exe to find the package.
  23. touch $pydir/Lib/site-packages/zope/__init__.py
  24. [% ELSE -%]
  25. export PYTHON=python2
  26. $PYTHON setup.py build --build-lib build
  27. cp -a build/zope $PTDIR/
  28. [% END -%]
  29. cd $distdir
  30. [% c('tar', {
  31. tar_src => [ '.' ],
  32. tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
  33. }) %]