Relaxation of semilinear hyperbolic systems with variable coefficients