Oohhh, I couldn't even tell it was your trunk in the OP pics.
The shit in the trunk jamb is a liquid epoxy (basically) that's applied at the factory to prevent moisture rot. I've never had to re-apply that stuff so I'm a little out of my league here but I know you can get that stuff from a paint shop and re-apply it. If I were you I'd find a paint shop and have them take a quick look at it and see what suggestions they give you. It also couldn't hurt to go to an auto body shop and try to get some info about how to go about applying it. As far as the rust next to the epoxy goes, it looks like it's just surface rust so some 220 followed by 400 (so you don't see the deep scratches) should fix that. Obviously get rid of the rust before you fill the epoxy.
As for the rust inside the trunk - sand it down with 220 so there's nothing but bare metal where there was rust. Be sure to check the back side of that bracket, too. Grab a can of E-Coat (made by SEM) and spray the area you sanded. The Ecoat can be gotten at any auto paint shop. They make it in that color also so there won't be a noticeably shitty looking area.