Unconventional superconductivity in the extended Hubbard model: Weak-coupling renormalization group