Ab initio Hartree-Fock calculations of periodic compounds: application to semiconductors