Spec can be short for specification of for speculation.
To build on spec can mean built to specifications, to meet a specific demand. This sense is often used in manufacturing. It can also mean built on the speculation (hope) that someone will want to buy it – this sense is used in real estate.
'Spec' might be considered an contronym.