Currently plugins, and storage engine plugins in particular, need to be compiled against an complete source tree of mysqld. That's annoying, awkward, and it makes packaging plugins very difficult. Packages need source packages, and thus technically we'd now have to include an entire MySQL source tree into a plugin's source package.
So, here's the solution. Antony built me a little perl script and adapted the makefile infrastructure, so that an include bundle is generated from the current source tree. That include bundle can then be separately packaged as a mariadb-plugin-dev package, and that in turn can be made a build-dependency by the plugin packages. Problem solved.
Since this is isn't a source change but just an addition to the make env, can this please be added into the 5.1 tree?
Then we can easily build separate plugin packages and get whole of lot really cool and useful things "out there" soon!
Patch is attached.