Thermodynamics and dynamics of systems with long-range interactions