diff --git a/anjuta-3.0.2.0.tar.bz2 b/anjuta-3.0.2.0.tar.bz2
deleted file mode 100644
index f0acb9f..0000000
--- a/anjuta-3.0.2.0.tar.bz2
+++ /dev/null
@@ -1,3 +0,0 @@
-version https://git-lfs.github.com/spec/v1
-oid sha256:5dce2cf455f9feeea31aea6bce5bae1dbd35793ba8c8009675608dae4d67bac0
-size 10389513
diff --git a/anjuta-3.1.3.tar.bz2 b/anjuta-3.1.3.tar.bz2
new file mode 100644
index 0000000..0f01da7
--- /dev/null
+++ b/anjuta-3.1.3.tar.bz2
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c491c9d1199be488eafad60b488ad5b6b8784be288fcff6e956eac61d35c6c54
+size 7093689
diff --git a/anjuta-support-libgda-5.0.patch b/anjuta-support-libgda-5.0.patch
new file mode 100644
index 0000000..9a9677f
--- /dev/null
+++ b/anjuta-support-libgda-5.0.patch
@@ -0,0 +1,37 @@
+diff -ur anjuta-3.0.2.0/configure.ac anjuta-3.0.2.0.patched/configure.ac
+--- anjuta-3.0.2.0/configure.ac	2011-05-23 21:12:40.000000000 +0200
++++ anjuta-3.0.2.0.patched/configure.ac	2011-06-10 21:14:30.486480081 +0200
+@@ -32,7 +32,8 @@
+ GTK_REQUIRED=3.0.0
+ GTHREAD_REQUIRED=2.22.0
+ GDK_PIXBUF_REQUIRED=2.0.0
+-GDA_REQUIRED=4.2.0
++GDA4_REQUIRED=4.2.0
++GDA5_REQUIRED=4.99.0
+ VTE_REQUIRED=0.27.6
+ LIBXML_REQUIRED=2.4.23
+ GDL_REQUIRED=2.91.4
+@@ -157,7 +158,9 @@
+    [gdl-3.0 >= $GDL_REQUIRED])
+ 
+ PKG_CHECK_MODULES([GDA],
+-   [libgda-4.0 >= $GDA_REQUIRED])
++   [libgda-5.0 >= $GDA5_REQUIRED],,
++   [PKG_CHECK_MODULES([GDA],
++      [libgda-4.0 >= $GDA4_REQUIRED])])
+ 	
+ PKG_CHECK_MODULES([VTE],
+    [vte-2.90 >= $VTE_REQUIRED])
+@@ -278,8 +281,10 @@
+ 
+ AM_CONDITIONAL(HAVE_PYTHON, [test x$have_python = xyes])
+ 
+-PKG_CHECK_MODULES(PLUGIN_SYMBOL_DB,
+-		[libgda-4.0 >= $GDA_REQUIRED])
++PKG_CHECK_MODULES([PLUGIN_SYMBOL_DB],
++     [libgda-5.0 >= $GDA5_REQUIRED],,
++     [PKG_CHECK_MODULES([PLUGIN_SYMBOL_DB],
++         [libgda-4.0 >= $GDA4_REQUIRED])])
+ 
+ dnl Setup Anjuta Library flags
+ dnl --------------------------
diff --git a/anjuta.changes b/anjuta.changes
index 334a5d6..7da8632 100644
--- a/anjuta.changes
+++ b/anjuta.changes
@@ -1,3 +1,42 @@
+-------------------------------------------------------------------
+Tue Jul  5 09:50:02 CEST 2011 - vuntz@opensuse.org
+
+- Update to version 3.1.3:
+  + Various improvements in the project wizard
+  + Git usability improvements
+  + Auto-completion for Gtk.Builder objects in python plugin
+  + More mallard documentation
+  + Bugs fixed: bgo#649107, bgo#651212, bgo#312667, bgo#588952,
+    bgo#590323, bgo#645516, bgo#646073, bgo#646192, bgo#652773,
+    bgo#652778, bgo#653364, bgo#647403.
+
+-------------------------------------------------------------------
+Thu Jun 16 00:31:36 CEST 2011 - dimstar@opensuse.org
+
+- Update to version 3.1.2:
+  + Autocompletion for builder objects in python
+  + Improvements in autotools backend
+  + Bugs fixed: bgo#475261, bgo#651670, bgo#651285, bgo#569994,
+    bgo#644047, bgo#588757, bgo#640470, bgo#642784, bgo#648571,
+    bgo#650930, bgo#652017, bgo#651212.
+- Add bison and flex BuildRequires: those were needed before, but
+  we failed to notice because of a bug in the configure script.
+
+-------------------------------------------------------------------
+Tue Jun  7 12:56:51 UTC 2011 - dimstar@opensuse.org
+
+- Build against libgda 4.99/5:
+  + Add anjuta-support-libgda-5.0.patch: support building against
+    libgda 5.0 and libgda 4.0 and add call to gnome-autogen.sh.
+  + Replace pkgconfig(libgda-4.0) BuildRequires with
+    pkgconfig(libgda-5.0).
+
+-------------------------------------------------------------------
+Sat Jun  4 09:21:38 UTC 2011 - badshah400@gmail.com
+
+- Enabled building glade-catalog-anjuta for use with glade for
+  gtk+3
+
 -------------------------------------------------------------------
 Mon May 23 23:30:15 CEST 2011 - dimstar@opensuse.org
 
diff --git a/anjuta.spec b/anjuta.spec
index 072b7a7..89c7fb4 100644
--- a/anjuta.spec
+++ b/anjuta.spec
@@ -16,20 +16,22 @@
 #
 
 
-%define build_glade_catalog 0
-
 Name:           anjuta
-Version:        3.0.2.0
+Version:        3.1.3
 Release:        1
 License:        GPLv2+
 Summary:        Versatile Integrated Development Environment for GNOME
 Url:            http://anjuta.sourceforge.net/
 Group:          Development/Tools/IDE
-Source:         anjuta-%{version}.tar.bz2
+Source:         http://download.gnome.org/sources/anjuta/3.1/%{name}-%{version}.tar.bz2
 Source1:        %{name}-rpmlintrc
+# PATCH-FEATURE-UPSTREAM anjuta-support-libgda-5.0.patch bgo#652047 dimstar@opensuse.org -- Also support building with libgda-5.0.
+Patch0:         anjuta-support-libgda-5.0.patch
 BuildRequires:  autogen
 BuildRequires:  binutils-devel
+BuildRequires:  bison
 BuildRequires:  fdupes
+BuildRequires:  flex
 BuildRequires:  gcc-c++
 BuildRequires:  gnome-common
 BuildRequires:  gnome-doc-utils-devel
@@ -50,14 +52,12 @@ BuildRequires:  valgrind-devel
 %endif
 BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
 BuildRequires:  pkgconfig(gdl-3.0)
-%if %{build_glade_catalog}
 BuildRequires:  pkgconfig(gladeui-2.0)
-%endif
 BuildRequires:  pkgconfig(glib-2.0)
 BuildRequires:  pkgconfig(gtk+-3.0)
 BuildRequires:  pkgconfig(gtksourceview-3.0)
 BuildRequires:  pkgconfig(libdevhelp-3.0)
-BuildRequires:  pkgconfig(libgda-4.0)
+BuildRequires:  pkgconfig(libgda-5.0)
 BuildRequires:  pkgconfig(libgraph)
 BuildRequires:  pkgconfig(libgvc)
 BuildRequires:  pkgconfig(libvala-0.12)
@@ -85,17 +85,15 @@ an integrated Valgrind memory profiler, an integrated gprof performance
 profiler, a class generator, a powerful source editor, source browsing,
 and more.
 
-%if %{build_glade_catalog}
-
-%package -n glade3-catalog-anjuta
+%package -n glade-catalog-anjuta
 License:        GPLv2+
 Summary:        Versatile Integrated Development Environment for GNOME -- Catalog for Glade
 Group:          Development/Tools/GUI Builders
 Requires:       %{name} = %{version}
-Requires:       glade3
-Supplements:    packageand(glade3:%{name}-devel)
+Requires:       glade
+Supplements:    packageand(glade:%{name}-devel)
 
-%description -n glade3-catalog-anjuta
+%description -n glade-catalog-anjuta
 Anjuta is a versatile Integrated Development Environment (IDE) for the
 GNOME desktop. It features a number of advanced programming facilities
 includes project management, application wizards, an interactive
@@ -106,7 +104,7 @@ and more.
 
 This package provides a catalog for Glade, to allow the use the Anjuta
 widgets in Glade.
-%endif
+
 
 %package devel
 License:        GPLv2+
@@ -128,9 +126,12 @@ and more.
 %lang_package
 %prep
 %setup -q
+%patch0 -p1
 translation-update-upstream
 
 %build
+# Needed by patch0
+NOCONFIGURE=1 gnome-autogen.sh
 %configure\
         --disable-static \
         --disable-scrollkeeper
@@ -184,9 +185,6 @@ rm -rf %{buildroot}
 %doc %{_datadir}/gnome/help/anjuta-faqs/C/
 %dir %{_datadir}/gnome/help/anjuta-manual/
 %doc %{_datadir}/gnome/help/anjuta-manual/C/
-%dir %{_datadir}/omf/
-%dir %{_datadir}/omf/anjuta-manual/
-%doc %{_datadir}/omf/anjuta-manual/anjuta-manual-C.omf
 %{_bindir}/anjuta
 %{_bindir}/anjuta-launcher
 %{_bindir}/anjuta-tags
@@ -208,13 +206,10 @@ rm -rf %{buildroot}
 %{_datadir}/icons/hicolor/scalable/apps/*.svg
 %doc %{_mandir}/man?/*.*
 
-%if %{build_glade_catalog}
-
-%files -n glade3-catalog-anjuta
+%files -n glade-catalog-anjuta
 %defattr(-, root, root)
-%{_libdir}/glade3/modules/libgladeanjuta.so
-%{_datadir}/glade3/catalogs/anjuta-glade.xml
-%endif
+%{_libdir}/glade/modules/libgladeanjuta.so
+%{_datadir}/glade/catalogs/anjuta-glade.xml
 
 %files devel
 %defattr(-, root, root)