A gunman entered a Catholic cathedral in the Brazilian city of Campinas on Tuesday and shot dead four people before killing himself, the GloboNews TV channel has reported.