Please use both these patches. These patches for the scripts are very useful for repetitive builds/testing. They work on EC2 and on standalone machines.
install_trafficserver works on Ubuntu & Fedora.
set_trafficserver.sh works on Ubuntu.
These are the scripts which I've used to create and maintain the Ubuntu Karmic based TrafficServer EC2 AMI instance for public consumption/testing.
Note: Karmic was chosen as it's very popular on EC2 and gets frequent bug fixes from Canonical.
Note: the next generation of these scripts which I'm working on now, are ruby chef recipes. This will allow compatibility with any AMI distro.