As stated, you need a signal source, and two KNOWN gain antenna standards. You set up your test with the gain standard antennas, sweep the frequency, record the results, and that is your "calibration". You then replace one of the gain standards with your device under test, and can figure out the gain vs. frequency and angle.
Many spectrum analyzers have poor VSWR on the input, so resist the temptation of removing all of the passive attenuator padding in the front end when making the measurement.