NEW YORK/SAN FRANCISCO (Reuters) - Hewlett-Packard Co is close to a deal to buy British software company Autonomy for $10 billion and will announce on Thursday a long-rumored spinoff of its PC division, the world's largest, two sources familiar with the company's plans said.