if yo make fixture with a flat top for the router to slide on two simple fences on either side of the stock will do just fine.
make what is essentially a table with a space in the top for the stock to come through and a cradle to hold/clamp the stock flush to the table top. then by knowing the width of your router's plate and the diameter of the router bit, a fence on each side can be set in place on the table top to act as a guide for the router to cut the channel.
it is best and easiest done when the blank is still square and flat sidded...clamping is easier to rig up. if you use a 45 degree chamfer bit, the angled flats and the bottom will be done as you sink the bit into the blank.
if you have the inkling and the knowledge to do it, a single fence that follows the profile on a swamped barrel can be made to inlet the sides of the channel by first routing the fence using the barrel as a template to route the swamped profile on the face of the fence. then, by anchoring the profiled fence down to the table top on the same side of the channel you want to cut, you can do one side at a time and be able to make minute adjustments to the blank in the clamp with shims to get the fit perfect.
again, the key to having it come out accuratly, is to cut the channel while the stock blank is slab sided, using the very top of the blank as the top of your forearm. do any cleaning up and/or straightening of the top so it's just about down to finished condition before you start, so that you have good surfaces to clamp to and index off of. don't forget to cut the entire channel deep enough to leave the hump at the breech end of the channel where the stock kicks up to the height of the barrel top.
i would build th system and then test it on a glued up soft wood blank first to de-bug the fixture and design. it might take a while to do, but if you build guns more than just every once in a while it might be worth doing and if you already have a router, the cost of the fixture wouldn't be much at all.