@task
def package(options):
 import tarfile
 import geonode
 version = geonode.get_version()
 pkgname = ('GeoNode-%s-all' % version)
 out_pkg = path(pkgname)
 out_pkg_tar = path(('%s.tar.gz' % pkgname))
 dist_dir = path('dist')
 dist_dir.rmtree()
 sh('python setup.py sdist --formats=zip')
 with pushd('package'):
  for f in glob.glob('GeoNode*.tar.gz'):
   old_package = path(f)
   if (old_package != out_pkg_tar):
    old_package.remove()
  if out_pkg_tar.exists():
   info(('There is already a package for version %s' % version))
   return
  out_pkg.rmtree()
  out_pkg.makedirs()
  support_folder = path('support')
  install_file = path('install.sh')
  justcopy(support_folder, (out_pkg / 'support'))
  justcopy(install_file, out_pkg)
  geonode_dist = (((path('..') / 'dist') / 'GeoNode-%s.zip') % version)
  justcopy(geonode_dist, out_pkg)
  tar = tarfile.open(out_pkg_tar, 'w:gz')
  for file in out_pkg.walkfiles():
   tar.add(file)
  tar.add('README', arcname=('%s/README.rst' % out_pkg))
  tar.close()
  out_pkg.rmtree()
 info(('%s created' % out_pkg_tar.abspath()))

@ task def package ( options ) : import tarfile import geonode version = geonode . get_version ( ) pkgname = ( 'GeoNode-%s-all' % version ) out_pkg = path ( pkgname ) out_pkg_tar = path ( ( '%s.tar.gz' % pkgname ) ) dist_dir = path ( 'dist' ) dist_dir . rmtree ( ) sh ( 'python setup.py sdist --formats=zip' ) with pushd ( 'package' ) : for f in glob . glob ( 'GeoNode*.tar.gz' ) : old_package = path ( f ) if ( old_package != out_pkg_tar ) : old_package . remove ( ) if out_pkg_tar . exists ( ) : info ( ( 'There is already a package for version %s' % version ) ) return out_pkg . rmtree ( ) out_pkg . makedirs ( ) support_folder = path ( 'support' ) install_file = path ( 'install.sh' ) justcopy ( support_folder , ( out_pkg / 'support' ) ) justcopy ( install_file , out_pkg ) geonode_dist = ( ( ( path ( '..' ) / 'dist' ) / 'GeoNode-%s.zip' ) % version ) justcopy ( geonode_dist , out_pkg ) tar = tarfile . open ( out_pkg_tar , 'w:gz' ) for file in out_pkg . walkfiles ( ) : tar . add ( file ) tar . add ( 'README' , arcname = ( '%s/README.rst' % out_pkg ) ) tar . close ( ) out_pkg . rmtree ( ) info ( ( '%s created' % out_pkg_tar . abspath ( ) ) )
require a deb package to be installed .