1) Make a new directory. cd into it.
2) Write your script, call it postinstall.
3) Make a new file named Makefile with the following contents:
include /usr/local/share/luggage/luggage.make
TITLE=name_of_your_package_with_no_spaces_or_punctuation
REVERSE_DOMAIN=com.example.corp
PAYLOAD=pack-script-postinstall
4) make dmg.
make dmg will create a dmg file named TITLE-YYYYMMDD.dmg containing the package TITLE-YYYYMMDD.pkg.