Vapor and liquid equilibria in porous media