The following tutorial might be of help:
Creating and Using Packages