Ripon's rich military history threatened by 1,300-home barracks scheme