Gravity waves on water of variable depth