A multimillion-pound deal has been made to acquire a handful of Homebase stores across the UK.