Place the door frame with the door in it into the rough opening.
Tap pairs of cedar shims into the space between the door frame and the inside face of the rough opening. Tap in one shim from the outside and one from the inside so they overlap, creating a flat bearing surface against the face of the finish frame. Place pairs of shims every 12 inches around the perimeter of the door frame. If the distance between parts of the rough opening and the door frame are more than the thickness of two shims apart because of the lack of square in the rough opening, stack up as many shims as needed in those locations to span the distance between the door frame and the rough opening.
Check the level of the door frame by holding a 4-foot level across the top of the door frame and vertically on each side of the door frame. If any part of the frame is out of square, adjust the shims by backing them off or tapping them in further to move the frame.
Secure the door frame by driving 3-inch-long finish nails through the inside face of the door frame, through the shims and into the rough opening.