Density-functional theory of classical systems