AVENAL, CALIF. -- Eight years ago, Avenal was a onetime boom town gone bust, a dusty, two-bit slice of nowhere traveling at warp speed toward oblivion.

Then Nick Ivans saw a six-paragraph item in an out-of-town newspaper. The California Department of Corrections had a $495 million budget for new prisons but nowhere to spend it.

Why not Avenal? Ivans thought. He called a special meeting at the Chamber of Commerce that night to present what he called "a good idea for Avenal." People laughed but then thought about it some more. What did they have to lose?

Five years later, Avenal State Prison opened, and today it is the pride of the community. Nick Ivans is a local hero, and the state of California voted him "Pharmacist of the Year." Now Avenal has a bright town emblem bearing the inscription, "Avenal -- Oasis in the Sun."

For the hardscrabble, rural towns of central California, Avenal has become the shining example of how to use an oddball idea to bootstrap the way back to respectability.

Since Avenal pioneered the scheme, other towns have followed suit. Nearby Corcoran has a new maximum-security facility that has Charles Manson among its inmates. Madera is building a prison, and Wasco, Chowchilla and Delano are planning for the near future.

The Department of Corrections, whose officials were surprised when Avenal stepped forward to volunteer the first new site in 1982, now puts out a tempting, four-color brochure touting the virtues of "California State Prisons -- Good Neighbors, Good Employers, Good Community Partners."

"It was a love affair with the Department of Corrections almost from the beginning," said Ivans, a cheerful 66-year-old who has run the Tomer Drug Co. in downtown Avenal for four decades. "As far as I can see, the department has done about eveything they said they would do. I'm real happy."

For the first 40 years of its life, Avenal did not need much of a helping hand. The town sprung up almost overnight when wildcatters struck oil in the hot, brown hills about 50 miles southwest of Fresno on the edge of California's San Joaquin Valley.

Houses went up, schools were built and Avenal soon had a movie theater, a bowling alley, a couple of banks and a haberdashery.

"Stuff they had there was as good as you could get in Fresno," Ivans said. "Had two pharmacies then, too, and we both made a good living."

The oil dried up in the late 1950s, however, and over the next 10 years, the oil companies pulled out bit by bit, taking employees, and their paychecks, with them.

By 1980, Avenal, never a gorgeous garden spot, was three-fourths of a square-mile of dusty streets and rundown clapboard houses populated by about 5,000 oil company pensioners and migrant farm workers.

Chevron was caretaker of the oil fields, where nothing was left except derricks and lengths of rusty pipeline crisscrossing steep, ugly hillsides burned by the sun.

The bowling alley shut down, the haberdasher retired and Ivans's competitor moved away. Bank of America, the last one left, stuck it out until the mid-1980s but finally departed. There was not enough money in Avenal.

When Ivans got his inspiration in mid-1982, California had not built a prison in a quarter-century. Inmate population was quadrupling over a 10-year period. Corrections had plenty of money to spend on prisons but no takers until Avenal.

"When they came down here the first time, they minimized the effects it would have," Ivans said. "They were trying to sell us, but we were already sold."

Avenal prison, on the southern edge of town, is a modern, minimum-security facility that holds about 4,500 inmates and employs about 1,000 people, 700 of whom are guards.

Benefits to the town have been mixed. An expected influx of 450 new residents did not materialize, and a new housing development and apartment complex remain half-empty. About 75 percent of the prison workers live in surrounding towns as far away as Fresno, and Avenal residents hold fewer than 100 prison jobs.

But there are significant advantages, chief among them the fact that the prisoners are counted in Avenal's census for tax purposes.

This means that the town's population doubled overnight, bringing an extra $200,000 in state revenue each year. Avenal is using some of it to erect 75 street lights and otherwise landscape Skyline Boulevard, the town's main drag. The city manager has decided to spruce up the old movie house, hoping to tempt someone to reopen it.

Also in progress is a project to put in sidewalks, gutters and curbs, all of which are unknown in most of Avenal, and to revamp residential homes. Half of Avenal's 1,600 dwellings are substandard.

Ivans sees it all as part of a grand plan that will take time to complete but cannot fail to succeed.

"You can't expect people to move here until you make the place nice," he said. "The prison has given us an opportunity. Before the prison, we were going down the tubes."