Backport travis script into 3.2