Superconductivity from repulsion: general reasoning and renormalization-group approach