How to turn off passive mob spawning in Minecraft?

I'm making a city map in Minecraft and I want hostile mobs (ex. Zombies, skeletons, creepers) for players to battle. I don't want passive mobs (ex. Pigs, cows, sheep) to be walking around being annoying like they are. They only get in the way and don't help my build look very much like a city. I need some kind of command to prevent them from spawning naturally on my grass. (NO MODS Please) I will not get rid of any grass.

Added (1). I want hostile mobs to spawn naturally at night. That's why I'm not using /gamerule doMobSpawning false.

/gamerule doMobSpawning false

Use this command it stops all mobs from spawning passive and hostile except from spawn eggs command blocks and spawners.

Sorry. I don't think that possible without mods. You'll have to install bukkit or something and use a plugin.