This film is a shotgun wedding of “Moulin Rouge” and “The Rocky Horror Picture Show,” with a bit of “Phantom of the Paradise” (remember that one?) sneaking in from beneath the woodpile.

At its best, the result is raucous, exuberant and quite funny, notably when the tag-team of Alec Baldwin and Russell Brand take the screen. But all that cheeky energy aside, “Rock of Ages” sags badly at times; it’s much too long and self-indulgent. The third and final act, when we finally cruise into it, feels more like the fifth; the wafer-thin story isn’t strong enough to support all the glitter and musical bombast.

The film is adapted from Chris D’Arienzo’s rock/jukebox musical of the same name, which opened in Los Angeles in 2005. A short Off-Broadway run eventually followed in late 2008; the show transitioned to Broadway in the spring of 2009 and has remained a popular draw ever since.

The time is 1987, a musical breakpoint in terms of both art and commerce: LPs are on their way out, rapidly being forced off store shelves in favor of new-fangled CD “longpacks.” Similarly, glam, heavy metal and power-rock are being threatened by the onset of grunge, rap and (God help us) boy bands.

Perky Sherrie Christian (country singer Julianne Hough), seeking fame and fortune, departs Tulsa, Okla., with a one-way ticket to Los Angeles. Her destination: the Bourbon Room, a landmark but now dilapidated rock ’n’ roll club (probably suggested by the Troubadour). Historically, the club is famed for having introduced many now-famous acts, none more celebrated than Stacee Jaxx (Tom Cruise), lead singer of the band Arsenal.

But the Bourbon Room is in trouble these days; owner Dennis Dupree (Baldwin) faces a whopping unpaid tax bill. And although Dennis’ right-hand man, Lonny Barnett (Brand), insists that rock ’n’ roll will never die, such pronouncements won’t keep the IRS at bay. And as if this weren’t bad enough, Dupree and his club have been targeted by Patricia Whitman (Catherine Zeta-Jones), the ultra-conservative wife of newly elected Mayor Mike Whitman (Bryan Cranston).

Sherrie’s barely off the bus when she loses her possessions to a mugger, but that’s all right; she’s just as quickly “rescued” by Drew Boley (Diego Boneta), an aspiring rocker who works behind the bar at the Bourbon Room. Just like that, Sherrie has a new job, a new boyfriend and close proximity to the music scene she loves so much.

This exposition doesn’t unfold dramatically; it sorta-kinda surfaces in a series of rock-hued song-and-dance numbers, much as the plot advanced in “Moulin Rouge.” Director Adam Shankman’s touch emerges immediately, when Sherrie breaks into song during her long bus ride, and her fellow passengers join the fun. Shankman comes by this approach honestly, having helmed several episodes of TV’s “Glee” and the big-screen adaptation of “Hairspray.”

Dramatic tension, such as it is, comes with the theatrical arrival of Jaxx, whose condescending rock god attitude has made him impossible to deal with. Rolling Stone journalist Constance Sacks (Malin Akerman) perceptively punches through Jaxx’s poseur affectations, but we’re not sure this relationship will gel; meanwhile, Drew dumps Sherrie after mistakenly thinking that she has slept with Jaxx.

She, in turn, assumes that his band’s one-off success as an opening act has turned Drew’s head.

But wait: Sherrie sinks even lower, quitting the Bourbon Room and reluctantly accepting a job as a stripper at the nearby Venus Club, run by the compassionate Justice Charlier (Mary J. Blige). Except that Sherrie never really strips — at least, not that we ever see — and so we can imagine that her virtue remains intact. Sort of. Maybe.

Which calls attention to another problem. This is the smuttiest PG-13 film I’ve ever seen, despite the fact that nobody sheds enough clothing to reveal forbidden fruit. Instead, we get double entendres, intense tongue action — to the point of nausea, more than once — and plenty of underwear, particularly by the Venus Club regulars who deliver athletic pole-dancing routines that would be the envy of a Bob Fosse musical or a Cirque du Soleil spectacular.

This adaptation of “Rock of Ages” absolutely, desperately needs to be rated R; it should embrace its naughty undertone unapologetically, as was the case with “Almost Famous.” The contrived lengths to which Shankman goes, in order to preserve his ill-advised PG-13, become quite irritating.

Such carping aside, Cruise is absolutely hilarious as the vainglorious Jaxx: the epitome of a rock god gone to seed, consumed by too much fame, too much alcohol and far too many nubile young lovelies who swoon at his mere appearance. It’s a crackerjack role, brilliantly conceived, and Cruise inhabits it with impressive credibility. Although Jaxx is a figure of derision, intended to amuse and disgust, Cruise plays it straight, with intense, method mannerisms that one would expect in a high-tone drama.

Trouble is, we eventually get tired of Jaxx and the long, extended pauses during his booze-dulled behavior and s-l-o-w speaking cadence. Too much of a good thing stops being a good thing, and Shankman makes that error with Cruise’s screen time.

Baldwin and Brand fare much better. Both are held back, injected at the fringes of various scenes, the better to insert well-timed double-takes or witty asides. I was prepared to believe that Cruise had run away with the film, until a surprise duet by Baldwin and Brand, as Dennis and Lonny do a montage cover of REO Speedwagon’s power ballad, “Can’t Fight This Feeling.”

Those few minutes, by themselves, are worth the price of admission.

Boneta and Hough are attractive and reasonably talented as singer/dancers, but uninspiring as actors. Hough is a bit better here than she was in last year’s ill-advised remake of “Footloose,” but that’s not saying much. Boneta is seeking big-screen fame after his season on the recent reboot of TV’s “90210,” but thus far nothing separates him from the hundreds of others seeking similar fame and fortune in Lotusland (much like his character in this film).

Despite D’Arienzo’s involvement with this film — he co-wrote the script with Justin Theroux and Allan Loeb — he couldn’t prevent the anticlimactic thump with which the final act descends. This celluloid version of “Rock of Ages” opens well and seems destined for greatness, but — alas — the whole is less than the sum of its rock ’n’ roll parts.

— Read more of Derrick Bang’s film criticism at derrickbang.blogspot.com. Comment on this review at www.davisenterprise.com