For the storage ring of the Spallation Neutron Source (SNS) at Oak Ridge, and for the Proton Storage Ring (PSR) at Los Alamos, both with intense and very long bunches, the electron cloud develops primarily by the mechanism of trailing-edge multipacting. We show, by means of simulations for the PSR, how the resonant nature of this mechanism may be effectively broken by tailoring the longitudinal bunch profile at fixed bunch charge, resulting in a significant decrease in the electron-cloud effect. We briefly discuss the experimental difficulties expected in the implementation of this cure.