There is a separate document available to help guide you through creating (and upgrading) a port called the Porter's Handbook. The Porter's Handbook is the best reference to working with the ports system. It provides details about how the ports system operates and discusses recommended practices.