It has been 50 years since British secret service agent 007 first appeared on the big screen in the James Bond movie Dr. No.

Coinciding with the anniversary is the release of Adele's theme song for the next Bond movie, Skyfall, as well as a new documentary about how the franchise evolved.

The series is one of the longest-running in history, having made $4.9 billion US in ticket sales over 22 films. The 23rd Bond movie is set to premiere Oct. 23 in London and Nov. 8 in North America.

Since the 1962 debut of Dr. No, starring Scottish actor Sean Connery as 007, the owners of the franchise have had heart-stopping crises as thrilling as the ones that face their fictional secret agent.

They’ve nearly gone bust more than once and have come close to losing all of their rights in court. But the franchise has survived and thrived under the family of late producer Albert "Cubby" Broccoli, whose name has graced every official Bond intro since Dr. No in 1962.

The son of Italian immigrants was a risk-taker, and his earlier ventures included farming the vegetable bearing the Broccoli name that his uncle brought to America.

After years of hustling his way into Hollywood, Broccoli fought for the movie rights to the Ian Fleming novels and passed his faith in the British spy tales to his children.

"Cubby used to say, ‘This is the goose that laid the golden egg, keep it safe,’ " said Broccoli’s youngest daughter, Barbara, now the series’ co-producer, in a phone interview from London.

"One of the things he said was we’re temporary people making permanent decisions. When you have a franchise, and you’re invested in it as emotionally as we are, you make decisions based on the health of the franchise going forward."

Steady franchise ownership over 5 decades

For five decades, the Broccoli family has held on to its 50 per cent stake in the "007" movies, while studio partner Metro-Goldwyn-Mayer owns the other half.

It’s not like the formula for action, sex and intrigue has always worked perfectly. Some films fell flat, like On Her Majesty’s Secret Service, George Lazenby’s infamous one-Bond wonder.

si-dr-no-ursula-andress-300-cp-03369137

Ursula Andress appears in a scene from the 1962 James Bond film Dr. No, making the Bond girl an instant icon. (United Artists and Danjaq/LLC/Associated Press)

The franchise has occasionally needed new blood to keep it fresh, and there have been six Bonds so far. For Skyfall, the family is making another noticeable change: It cast 31-year-old Ben Whishaw as Bond’s gadget guru, Q.

The last two movies did without the longtime sidekick, who had been played by the late Desmond Llewelyn in an epic 16 Bond films.

"The decision was made to make him a younger man, as would be the case these days," said Michael Wilson, Albert Broccoli’s stepson who is also co-producer of the series, by phone.

"Let’s hope he goes on as long as Desmond Llewelyn did." It may seem a minor casting decision, but nothing is taken lightly by the family that has stuck with Bond this long.

Their tribulations are brought to life in the documentary, Everything Or Nothing, which debuts Friday on U.S. video-on-demand channel EPIX. In one incident from the 1970s, the film explains, Broccoli’s Canadian co-producer, Harry Saltzman, had squandered his Bond fortune on outside investments.

Instead of turning to his partner for help, Saltzman pledged their production partnership Danjaq as collateral on nearly $20 million in personal loans from Swiss bank UBS.

Broccoli enlisted Wilson, a practising lawyer, to prevent the production company from being foreclosed on by the bank. Wilson argued Saltzman couldn’t pledge 100 per cent of the production entity without consulting his partner.

In the end, the Saltzman-Broccoli partnership broke up. Saltzman bitterly sold his stake to United Artists, now a subsidiary of MGM, and was left penniless.

Bond narrowly escaped unscathed. In another segment, the family faces off against real-life nemesis Kevin McClory, an Irishman whose early script work with Fleming allowed him to win the movie rights to Thunderball.

The rights form the basis for Never Say Never Again, a 1983 remake. The film brought leading man Sean Connery back as Bond after a 12-year hiatus, and was a way for Connery to snub the producers that he felt had shortchanged him.

That year, Connery’s Bond and Roger Moore’s Bond in Octopussy hit theatres just months apart, though Octopussy won the box-office battle. Due to the bitter rivalry, Never Say Never Again isn’t included in Danjaq’s count of 23 Bond flicks.

The documentary also explains why Casino Royale, Fleming’s first Bond book, was made twice.

Financial squabbles mark franchise's turbulent history

The first version debuted in 1967 and was a ridiculous mashup featuring multiple Bonds played by the likes of David Niven, Peter Sellers and even Woody Allen.

si-sean-connery-bond-300-ap-03368549

Sean Connery appears as James Bond in Never Say Never Again, released in 1983. (Associated Press)

The spoof was possible because Fleming had sold that book’s rights to Columbia Pictures, now owned by Sony, for a measly $6,000 US. Sony gave the rights back to the Broccolis in a legal settlement in 1999.

Sony later became the distributor of the last two films and Skyfall. That’s why a Sony Vaio laptop is among Bond’s arsenal of gadgets these days, despite Sony’s former archenemy status. (Heineken, not a shaken martini, is also a new favourite Bond libation, thanks to the brewer’s corporate sponsorship.)

But the curtain has yet to fall on the financial drama surrounding Bond. In July, MGM made a preliminary filing with the Securities and Exchange Commission to prepare for an initial public offering of stock.

The move would help pay off MGM’s owners, including Highland Capital Management and Anchorage Advisors, who lent the studio $5 billion US but booked a big loss in a bankruptcy that left them with a less valuable stake.

The IPO could happen before Skyfall or potentially before MGM’s other major coproduction, the J.R.R. Tolkien tale The Hobbit, which MGM is cofinancing with Warner Bros. and is set for release in December.

According to a person familiar with the matter, the timing is meant to take advantage of the hype surrounding the two movies, which promise to be among the year’s biggest moneymakers.

Barbara Broccoli said that this is the sort of financial engineering that her father never liked — but which the family has had to deal with many times over the years.

Wilson, who fought hard to keep Bond from being hijacked by financial shenanigans, said his focus is different now than when he first stepped in to protect the family business.]

"We just keep our heads down and make movies," Wilson said. "We keep it on track. That’s our job really. That’s what we do."