simple idea, put some gold in your inventory, and just right click on a Pigman to give him a piece of gold and he'll follow you around for a time.
Give any pigman following you another piece of gold, and he'll stay still and guard that spot. only leaving his station to respond to the following.
Attack anyone who hurts him, or his fellow pigmen within sight.
Attack anyone destroying blocks within his sight.
Attack anyone placing a TNT block within his sight.