Thermodynamics based on a work inequality