# Creating and testing a release package
# --------------------------------------
# Create the dist::

  python setup.py sdist

# Unpack for testing::
  
   cd dist
   tar xvfz trash-cli-*.tar.gz
   cd trash-cli-*

# Prepare the virtualenv

   virtualenv testing
   source testing/bin/activate
   
# prepare the test scripts so they can tested 
   
   python setup.py develop --script-dir scripts
  
# launch tests with python nose

  python setup.py test

# test the scripts with bashunit
  command-test/create-test-volume
  command-test/run-tests scripts command-test/test-volume
  sudo umount command-test/test-volume

# test the creation of .rpm
  python setup.py bdist_rpm

# in case of errors:
  python setup.py bdist_rpm --install-script=install-rpm.sh

echo "All done"
