Photometric and spectroscopic evolution of the peculiar Type IIn SN 2012ab