School auditoriums, church halls and state properties in San Francisco are being looked at as potential shelters as the city scrambles during the coronavirus crisis to temporarily house people who are either homeless or live in tight quarters such as residential hotels, officials said Tuesday.

The effort is being mirrored across the Bay Area and California at the direction of Gov. Gavin Newsom, who said Sunday that he would like to see all 108,000 of the state’s unsheltered homeless people under roofs while the COVID-19 danger persists. The Legislature approved a funding package late Monday that includes millions of dollars aimed toward Newsom’s goal — and already the state has leased two hotels in Oakland with 400 rooms for that purpose, plus two hotels in San Mateo County.

Sacramento Mayor Darrell Steinberg, who co-chairs Newsom’s homelessness task force, said the goal of sheltering most of the state’s homeless population is reachable. He called the governor’s call for shelter “a silver lining, even though it’s hard to see it as that because we are in the midst of a crisis in ways that are very serious.”

“But the drive to bring people indoors is even more paramount now than it was two weeks ago,” Steinberg said. “And it was always paramount. So this presents an opportunity to really shelter people.”

As head of San Francisco’s Human Services Agency, Trent Rhorer is in charge of the city’s emergency housing effort, and he said he is looking at large facilities that can be quickly turned into shelters for at least a few weeks. The goal, he said, is to house at least 3,500 people who are either unsheltered or who live in congregant settings where they have to share bathrooms and kitchens and cannot self-quarantine.

With the school district shut down, campuses are one likely place to put people, Rhorer said. Churches around the city are being asked to open their halls as well.

San Francisco Unified School District spokeswoman Gentle Blythe said the district is working with the city on options.

So far Rhorer has secured about 500 hotel rooms. Now he has to coordinate with other departments to set up case managers, drug rehabilitation and other counselors — all the services that come with a typical homeless shelter.

Regular shelters will probably have to be reconfigured, perhaps cutting their capacities in half to allow for more social distancing space, he said. That will then necessitate the creation of other emergency spots.

“It’s not like just setting up an emergency shelter in an earthquake,” Rhorer said. “But we can do this. We don’t have a cash flow issue in this city, so we can move fast.”

He said the goal is to start filling beds this week, with priority for anyone who has tested positive for COVID-19 and needs to be quarantined. Whether the effort has to continue for weeks or months is unknown, he said, but it will all probably cost tens of millions of dollars.

“You brace for the worst and hope for the best,” Rhorer said.

Newsom said he hopes to scale up the number of available hotel rooms around the state to thousands in the coming weeks. “We will overwhelm ourselves if we don’t move with real urgency in this space,” he said.

The coronavirus crisis shoved the state into a near-warlike footing. The governor’s declaration of a state of emergency loosened regulations to transform state properties such as fairgrounds into quarantine centers and shelters, and cities and counties are being funded to take emergency actions.

Steinberg’s state task force has asked for a measure to be placed on the November ballot mandating that California’s localities make every effort to house their homeless populations.

“For a long time one of the compelling arguments for creating a legally enforceable mandate for shelter was the potential spread of communicable diseases among the homeless. And now we have that very situation before us,” Steinberg said.

Longtime homeless advocate Paul Boden said the governor’s goal was good, but that he doubts it can be reached given what he called a slow response to the effect the crisis is having on homeless people.

“This isn’t like an earthquake where you can’t see it coming. They’ve had a month to plan for this, both locally and statewide, and they’re just now paying attention,” said Boden, head of the Western Regional Advocacy Project, which works on homelessness issues.

“You need to be putting out tents for people, putting a moratorium on sweeping camps, putting out hand sanitizer and sanitation facilities everywhere,” Boden said. “Maybe get the Army Corps of Engineers on it. Apply the same standards and provisions for health and safety that you do for housed people.”

Oakland Mayor Libby Schaaf said she was more interested in leasing hotels or expanding the city’s homeless cabin settlements than in using auditoriums, because of the need for social distancing. She has increased hygiene efforts at homeless camps, and said a big challenge of adding shelter spaces is providing the services to go with them.

“We will need more state funding to do that,” she said.

San Francisco Chronicle staff writer Jill Tucker contributed to this report.

Kevin Fagan is a San Francisco Chronicle staff writer. Email: kfagan@sfchronicle.com Twitter: @KevinChron