Build script based on Dan Tello's recipe.