We'll assume the door fits the frame. You need to measure where the hinges are on the door EXACTLY and transfer that information onto the frame. Use a router to notch out a space for the hinge and drill pilot holes if necessary. Get a buddy to help you hold the door as you screw it into the frame.
First....do you have the old casing along with the old door ? Or just an old door you want to hang. I am guessing the new opening will accommodate the old door ? Imma kinda like a blind man here since I can't see what you have....need more detail to help you.
Place the new door slab on a set of sawhorses and lay the old door on top. Mark exactly where the hinges are, center of doorknob hole and length of door, in case it has to be cut shorter. Chisel out for the hinges and drill the knob hole and you are all set.