Based on the Odyssey, since Odysseus tells the story of the Trojan War and its end while he is being helped by a family and the Aenied is almost an exact copy of the Odyssey (replacing Odysseus with Aeneas, of course), that was writted by Virgil almost as a joke to give Caesar Augustus some Godly ancestry.
Though the Aenied is not a mere knockoff for the Odyssey. It incorporates both the Odyssey in the first half of the book and the Iliad towards the last part of the book. It was not written to merely glorify the Judo-Claudian line, but to also give the Romans a national epic, a book of beginnings, to remind Modern Romans that the characteristics that Aeneas shared, should be also followed by patrotic and pius fearing Romans.
If an author is commissioned by a Caesar in order to show his godly ancestry, then how is it not meant to glorify him. Same goes for the ancient pharaohs, who lost almost all their power once they exposed as not being chosen by God to be the leaders of their people.