You might want to look at these resources:
/usr/portage/skel.ebuild
- a default ebuild with lots of comments.
man 5 ebuild
- the man page for the .ebuild format.
- http://devmanual.gentoo.org/ - has lots of information about ebuilds and the Gentoo ecosystem
To answer your question.. It would depend on if the plugin has to be compiled with Nginx or if it is a module. If it has to be compiled with Nginx, it's probably a patch, and then you'd use epatch
in the src_prepare
step. You might have to use the ebuild
command to unpack everything and go browse around in /var/tmp/portage to figure out the structure of the unpacked archives. If it's a module that can be installed after Nginx is installed, then you need to make a new ebuild. I'd personally gank the ebuild from another Nginx module (if one exists) and change it around.