make build script compatible with both el5 and el6