Backporting packaging updates from 1.6 branch