First case: The attack bonus is correct, +4 for strength, +1 BAB, +1 WF. The damage is also correct, 1-1/2 strength bonus.
Second case, attack bonus is correct, but the damage is incorrect.
You can choose to take a –1 penalty on all melee attack rolls and combat maneuver checks to gain a +2 bonus on all melee damage rolls. This bonus to damage is increased by half (+50%) if you are making an attack with a two-handed weapon
This actually means that its supposed to be 2d6 + 9, as the bonus is +3.
Third case, your raging strength is 22. That is a +6 bonus, meaning +8 normal raging attack bonus, and +7 when power attacking. The damage is 2d6 + 12, just as stated.
- Greatsword +6, 2d6 + 6
- Power attack: Greatsword +5, 2d6 + 9
- Rage, Power attack: Greatsword +7, 2d6 + 12
- Rage: Greatsword + 8, 2d6 + 9
Correct (and downvote) me if I'm wrong, not exactly a PF expert
Edit: I'll add how to calculate it for future reference:
Attack bonus: That is your BAB + strength modifier + any feats and buffs
BAB: in the barbarian case, it is equal to your class level
Strength modifier: not 1-1/2. In ranged attacks, it is the Dex modifier.
Feats: In your case, Weapon Focus, although others may apply.
The damage bonus: your strength modifier (or 1-1/2 of it when fighting with two hands and a non-light weapon) + any relevant feat bonuses
Feat bonus, in your case is the Power attack, described above.
As Rob noted in the comments, it is extremely helpful to have a character sheet when enraged, and when not. It means that you have all your stats written down, including the attacks, and you can just switch as you start raging.