Adding custom post types to a plugin isn’t much different to a theme.
I’m working on this at the moment.
One suggestion I do have for people is to use the plugin activation and deactivation hooks to flush the rewrite rules.
Here’s a great plugin to bundle all your theme functionalities like CPT, taxonomies, metaboxes, shortcodes and widgets, thought I’d share.https://github.com/billerickson/Core-Functionality
Yeah, I created a plugin soon after the requirements were announced. It gives extra steps for users to do upon installation/update but it really is for the better.
I just wish authors would stop using custom post types. The problems they cause completely outweigh the 1 or 2 positives, which means they all eventually end up causing the buyers (and authors of other themes) a lot of unnecessary headaches.