Design and construction of an automatic scanning X-ray spectrometer and study of bond character in zinc compounds