Shallow water waves over an uneven bottom and an inhomogeneous KP equation