Spain will grant legal status to half million undocumented people in the country.