Five men have been jailed for their role in growing almost £4m worth of cannabis at sites across West Yorkshire.