MISV, I have a script I use to build tomboy-ng, its based around lazbuild and assumes a lazarus install with necessary packages added.
I don't drop the lib directory, has not proven necessary.
I point lazbuild to the project and specify the build mode - so, assume the project already has the appropriate build mode. Does not do other things you want but its a start.
See it here :
https://github.com/tomboy-notes/tomboy-ng/blob/master/package/mk_cocoa_dmg.bashI have also, recently, been experimenting with a script that just calls fpc and all options are specified there. Interested in it because its not dependent on a particular lazarus build for packages, I can easily change the package when experimenting with different versions. And, its perhaps a lot more command line friendly in that you can download Lazarus source, make lazbuild, LCL and Components and away you go. No need to start the gui interactively, a lot quicker.
You do still need lazbuild to build any packages you are downloading at the same time ...
Neither model answers any more than a very small part of your question ....
Davo