Poudriere is the tool for building all of ports/dports, and Michael W. Lucas has written up his experience using it to build a custom ports set. He’s doing on FreeBSD, but if you ignore the geom-specific parts, it should generally apply to DragonFly.