While I agree fully with the content of Rollo's post, it doesn't directly answer your question.
EU law requires any member state to admit anyone who can prove that they're an EU citizen (either by producing a valid passport or by showing a national identity card). The Spanish authorities would have to admit you if you only had one minute left on your passport.. So (assuming that you hold a British or other EU passport) you'll have no problems using your current passport in July.
Chris