Production and evolution of perturbations of sterile neutrino dark matter