Sold Rental Propery - How To Allocate Gains To Various Assets

I sold a rental property I have been renting out for the last two years.  I have been depreciating a new roof on the rental property.  How do I allocate the gain and expenses between the land, structure and roof?  For example, assume at the time of first rental, cost basis of the house is $500,000, the cost basis of the roof is $30,000.  Assume the sales price of the rental property is $700,000 and the expenses for the sale are $10,000.  I can see in the tax records that the land is assessed at $100,000 but was only $95,000 when I bought the house.  I know similar questions have been asked before, but I can't find a situation similar to this one.  Thanks for any help.