You can create a large dmg, add files, and then resize it:
hdiutil resize -size xxxg myImage.dmg
or create sparseimage and then convert it
hdiutil convert -format UDZO Source.sparseimage -o myImage.dmg
I have never tried the latter, not sure if he will choose the right size for dmg.
Source: http://nickcharlton.net/post/converting-a-sparseimage-to-a-dmg
Note that sparseimages must be compressed if files are deleted from them, as they do not automatically free up space from deleted files:
hdiutil compact Source.sparceimage
CNeo
source share