GLEN CAMPBELL is nearing the end of the line, sparking a family battle over the country legend’s $50 million fortune!

With Glen’s mind ravaged by Alzheimer’s disease, his wife Kim and their three children are locking horns with his five other kids from previous marriages, say sources.

“All the kids want a piece of dad’s pie,” declared a family insider.

AND THE BATTLE IS BOUND to get even uglier now that the 77-year-old star’s eldest daugh­ter Debby is writing a shocking tell-all.

Called “Burning Bridges” and due out in October, the book was co-written with Mark Bego and rips the lid off Campbell’s substance abuse problems, his four marriages and his tragic illness.

Debby is fuming because she believes Glen’s current wife Kim booted her and her band from the “Wichita Lineman” singer’s concert tour and replaced them with her own children.

“Debby also feels that Kim is shutting her and Glen’s other kids out of his estate,” said the source. “But she’s not about to roll over. She’s going to fight for what she believes is rightfully hers. And she’ll tell it the way she sees it in her book – warts and all.”

Glen has been shielded from the family back-biting by his heartbreaking disease because it has robbed him of his memory.

Since The ENQUIRER revealed in 2011 that he was suffering from Alzheimer’s, the condition has worsened.

“Glen leaves his home only when accompanied by others, and he no longer drives a car,” revealed the source. “He doesn’t carry a cell phone or credit cards for fear he will lose them. He is still able to go golfing with his friends, but he often forgets what hole he’s on.”

Now to complicate matters, Glen’s estranged son Kane – who’s battled drug addiction and has done prison time – wants to mend fences before the singer dies.

“I know that I haven’t led the life my father would have liked, but I still love him and I’d do anything to see him again,” Kane told The ENQUIRER.

Happily, the “Rhinestone Cowboy” singer – who music industry insiders say is worth about $50 million – will get his final wish to bow out with one last album.

His “See You There” CD is scheduled for release in August.