This module allows you to generate a hook_install() implementation that creates the chosen roles with their associated permissions. The main purpose for creating this module was to transfer roles from a local dev machine to a remote stage/live server.
Features was considered for this requirement however there doesn't seem to be a consensus on if or how to do it ( ).
The current functionality in Features requires you to select all the permissions manually.
This module was developed by Brightec.