On-ground characterization of Rosetta/VIRTIS-M. I. Spectral and geometrical calibrations