The longtime head of the National Rifle Association says he is resigning, just days before the start of a civil trial over allegations he diverted millions of dollars from the powerful gun rights organisation to pay for personal travel and other lavish perks.