Superconducting transition temperatures for spin-fluctuation superconductivity: Application to heavy-fermion compounds