The calculation of optical absorption spectra using linear-scaling density-functional theory