How to install and configure CiviCRM on Praxis/Gentoo Linux using command line drush

Requirements

You have to have dev-lang/php installed, and a web-server.

drupal="drupal-7.16"
mkdir -p /opt/civi
pushd /opt/civi
curl "http://ftp.drupal.org/files/projects/$drupal.tar.gz" | tar -zx
chown -R root:root ./$drupal
cd ./$drupal
mkdir -p sites/all/modules
mkdir -p sites/default/files
# chown -R www-data:www-data sites/default/settings.php
# chown -R www-data:www-data sites/default/files
chown -R www-data:www-data sites/default
# mysql -u root -proot
echo "create user 'civi'@'localhost' identified by 'civi'" | mysql -uroot -proot || true
echo "create database civi character set utf8 collate utf8_unicode_ci" | mysql -uroot -proot || true
echo "grant select,insert,update,delete,create,drop,index,alter,create temporary tables,lock tables ON civi.* TO 'civi'@'localhost' IDENTIFIED BY 'civi' " | mysql -uroot -proot || true
# Install Drupal via Drush
drush site-install --yes standard --site-name="Civi-Demo" --account-name=root --account-pass=root

# Enable Extra Modules
drush pm-enable --yes admin ctools views views_ui
drush pm-download --yes backup_migrate devel
drush pm-enable --yes backup_migrate devel
 drush pm-download memcache
 drush pm-enable memcache memcache_admin

# Get Civi
cd sites/all/modules
curl -q --location  'http://sourceforge.net/projects/civicrm/files/civicrm-stable/4.2.2/civicrm-4.2.2-drupal.tar.gz/download' | tar -zx