You may need help moving the door. Attach two pieces of scrap wood in the upper corners of the doorway on the interior side. The wood will act as a brace to help hold the door upright. Set the bottom of the door in place, and raise the top into position. Make sure it's plumb and level, and temporarily nail the frame into place.
Place shims behind every hinge as well as any other place that appears to be bowed inward.
Open and close the door to test the operation. Apply exterior trim such as brick molding. When the trim is in place, run a bead of caulk between it and the exterior wall. Attach interior trim around the door. If you're not reusing your original interior trim, try to find something that will be large enough to cover any imperfections you might have caused when you removed the door.