The SlackBuild site and src2pkg are a good resources
to use or to learn from.
The source repository of the slackware distribution is also
a good resource. You can look at the way the building scripts
were written and learn a lot.
When I started writing my own slackbuild scripts, these are the
3 main resources I used to learn, borrow/steal ideas ...