Finite‐amplitude ion‐acoustic solitons in weakly inhomogeneous plasmas