functions to make the spm files and put them on the server