5's are pretty short to fit an auto drivetrain, although I am sure it could be done. From what I understand, 7's were created to make a longer version that could fit an auto.
A guy in my 4wd club put an auto in a cj3a. He said it was a pain but he got it in. You would probably need CV on your driveshaft or I have seen other joints that can go at great angles I just can't remember what they are called. You would have to fab all of the mounting stuff. I am sure you could get an auto out of a 7 or wrangler with the same engine you have and then make the necissary mods. You may also need the T-Case if it will not adapt.
I have seen it done by moving the rear axle out toward the rear. That's a lot of work though.
The best thing to do is get on the phone with Advance Adapters and see if they can give you some dimensions on trans and tansfer case combos. Then get the tape measure out and see what the rear driveshaft length will be. In a CJ7 auto it is about 21 inches. You can tolerate shorter shafts if you don't have much lift and use CV's (double Cardan joints).
The first thing is you have to have a good idea of what combo you are going to run. The best bet would be a Torqueflight 727 or 999. They came in CJ7's with the Dana 300.
yeah it is possible i have a friend putting a chrysler 940 auto and a dana 300 in his CJ 5, he is also running a 2.5 lt engine in it and moving it forward. but it can be done, just set your mind to it and do it