Not tested but should work:
example.com TXT "v=spf1 a mx ip:5.6.7.8/26 include:spf.yourdomain.com ~all"
example2.com TXT "v=spf1 a mx include:spf.yourdomain.com ~all"
and on your main, one domain:
spf.yourdomain.com TXT "v=spf1 (multiple common values) -all"
You can add multiple entries (a mx), IP subnets and include. All SPF mechanisms can be used multiple times, separated by spaces. Of course it is your choice about ~all or -all etc (-all is much better, but you need test it first).
Using include is nice, because later, if you need to make a change for SPF record for all domains (adding new IP, etc.) you need only change TXT record of "spf.yourdomain.com".