I've bought a little car power supply for my RPi - it wires in to a permanent 12v source, and an ignition 12v source and sends a signal to the Pi when the ignition is cut, so it shuts down gracefully.