And then again you had the Martini-Henry Artillery Carbine MkII which was a Mk II rifle cut down to 23" barrel by Enfield - for garrison artillery (always last in line).
Any gunsmith could do it. Military longarms were always long and awkward to handle for the civilian market. The stock would be altered to fit, often a forshortened fore-stock too. (Look at the Martinis available.) It depended on barrel bedding - again something the local gunsmiths could do. That is why they tend to be one-offs, they were never a production item. Don't forget, before mass production, the gunsmiths made their own guns themselves, lock, stock and barrel (which is why the parts were not interchangable). Some did it better than others.
I have a Canadian Lancaster (.577 oval bore) Sapper and Miners carbine which was advertised a s a 20-bore smoothbore (highly unusual - even for a smoothbored .577 which comes out as a 22 or 23-bore.) It was cheap so I bought it. You look down the barrel and it LOOKS smoothbore. It was dirty, so I cleaned out the barrel. After about 4", the rod needed more push and then began to turn. The top 4" had been 'cleaned', the rest of the bore was still oval bore.