How can 'programatically' configure my site? I often find myself re-creating the same site: a 'clean' instance of what I have developed so far. It takes me several hours to do. So, I have created a .install file to create all of my content types and fields when I install the first of my custom modules. I also need to:


Create two menus
Configure some blocks
Configure the user permissions
Alter some of the default theme settings


What is the best approach to achieving the above 'programatically'? At the moment I do all of these tasks through the various user interfaces, but like I say it's time cosuming to keep doing it every time I want to start afresh.

Thanks
So You Want to Build a Drupal Distro 

Take a look at Packaging a distribution on Drupal.org

Here are the steps:


Assemble the pre-requisites
Create a Drush Make file
Convert to a Drupal.org-specific Drush Make file
Build and verify it works
Commit your code to Git
Release your code on Drupal.org
Maintain your distribution


Another great tutorial How to Write a Drupal 7 Installation Profile

Also there is Profiler Builder module.


  Profiler Builder is a module for automating the creation of
  installation profiles and distributions. It has support for the
  Profiler installation profile simplifier library but is able to run
  independent of it (1.0-RC4+). This module creates a downloadable tar
  package that gives you a well made installation profile and associated
  drush make file based on the site its installed on.