initial commit

Based on trunk/sm.hg, tip 2175:f3b9314bf76b. Only the files required to
build the sm RPM package are imported.