Build script update with better modularization, fedora & macports support