How to Build and Install latest cURL version on CentOS and Ubuntu?

How to Build and Install latest cURL version on CentOS and Ubuntu?