diff --git a/globals.mak b/globals.mak
index 2f1b5bf855a25bd33c23345582e6f37b12b41b85..7d95ebce52e7f799437add766da5a591214ab31a 100644
--- a/globals.mak
+++ b/globals.mak
@@ -18,6 +18,9 @@ if BUILD_GSM
 GSMCODEC=-DHAVE_GSM_CODEC
 endif
 
+RING_DIRTY_REPO ?= $(shell git diff-index --quiet HEAD || echo dirty)
+RING_REVISION ?= $(shell git log -1 --format="%h" --abbrev=10)
+
 # Preprocessor flags
 AM_CPPFLAGS = \
 	-I$(src)/src \
@@ -29,6 +32,8 @@ AM_CPPFLAGS = \
 	-DPREFIX=\"$(prefix)\" \
 	-DPROGSHAREDIR=\"${datadir}/ring\" \
 	-DENABLE_TRACE \
+	-DRING_REVISION=\"${RING_REVISION}\" \
+	-DRING_DIRTY_REPO=\"${RING_DIRTY_REPO}\" \
 	$(SPEEXCODEC) \
 	$(GSMCODEC) \
 	$(OPUSCODEC)
diff --git a/src/Makefile.am b/src/Makefile.am
index d7cd0e82f83af7b486c369855ef562aa01e239b4..411aed9c7eb1d0334528f603173a137f6f2fa912 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -105,7 +105,9 @@ if USE_DHT
 libring_la_CFLAGS += $(OPENDHT_CFLAGS)
 endif
 
-libring_la_SOURCES = conference.cpp \
+libring_la_SOURCES = \
+		buildinfo.cpp \
+		conference.cpp \
 		account_factory.cpp \
 		call_factory.cpp \
 		preferences.cpp \
@@ -168,3 +170,5 @@ if RING_VIDEO
 nobase_include_HEADERS+= \
 		dring/videomanager_interface.h
 endif
+
+.PHONY: buildinfo.cpp
diff --git a/src/buildinfo.cpp b/src/buildinfo.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..8ca73e22f4813e3c30aafe222ff4710b7521aed7
--- /dev/null
+++ b/src/buildinfo.cpp
@@ -0,0 +1,46 @@
+/*
+ *  Copyright (C) 2015 Savoir-faire Linux Inc.
+ *  Author: Guillaume Roguez <Guillaume.Roguez@savoirfairelinux.com>
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
+ *
+ *  Additional permission under GNU GPL version 3 section 7:
+ *
+ *  If you modify this program, or any covered work, by linking or
+ *  combining it with the OpenSSL project's OpenSSL library (or a
+ *  modified version of that library), containing parts covered by the
+ *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
+ *  grants you additional permission to convey the resulting work.
+ *  Corresponding Source for a non-source form of such a combination
+ *  shall include the source code for the parts of OpenSSL used as well
+ *  as that of the covered work.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "dring.h"
+#include <string>
+
+namespace DRing {
+
+const char*
+version() noexcept
+{
+    return RING_DIRTY_REPO[0] ? PACKAGE_VERSION "-" RING_REVISION "-" RING_DIRTY_REPO : PACKAGE_VERSION "-" RING_REVISION;
+}
+
+} // namespace DRing
diff --git a/src/ring_api.cpp b/src/ring_api.cpp
index 37efc095d971acecfa562377529a4ab748b12eb9..e06be3d120cbf7fbcb3436bd284cbcbf8372c1d3 100644
--- a/src/ring_api.cpp
+++ b/src/ring_api.cpp
@@ -50,12 +50,6 @@
 
 namespace DRing {
 
-const char*
-version() noexcept
-{
-    return PACKAGE_VERSION;
-}
-
 bool
 init(enum InitFlag flags) noexcept
 {