Could someone please help me with the steps required to create a custom site
definition in SharePoint 2007. I need to create it so that it has its own
Master page.

This is how far I got:

1) Make copy of ...
12\TEMPLATE\SiteTemplates\sts
and called it STS2

2) Modified new copy of
12\TEMPLATE\SiteTemplates\STS2\xml
file ONET.XML tag <Project> to include
alternates .css and .js files.

3) In folder ...
12\TEMPLATE\LAYOUTS\1033
created Custom\STS2 folders
to include .css and .js
files related to 2) above

4) In folder ...
12\TEMPLATE\1033\XML
created STS2.xml
to point to new template

All this seems to work because I can select it from the site tempaltes and I
am able to create a site based on it.

I now need to know how to define custom master pages.

Please help.