Package Service application

You can find details here:

And the template code is a few posts down

That should get you started.