Index: trunk/ppbgrestore/src/Makefile.am
===================================================================
--- trunk/ppbgrestore/src/Makefile.am	(revision 25972)
+++ trunk/ppbgrestore/src/Makefile.am	(revision 25973)
@@ -4,4 +4,28 @@
 noinst_HEADERS = \
 	ppbgrestore.h
+
+if HAVE_SVNVERSION
+PPBGRESTORE_VERSION=`$(SVNVERSION) ..`
+else
+PPBGRESTORE_VERSION="UNKNOWN"
+endif
+
+if HAVE_SVN
+PPBGRESTORE_BRANCH=`$(SVN) info .. | $(SED) -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'`
+PPBGRESTORE_SOURCE=`$(SVN) info | $(SED) -n -e 's/Repository UUID: // p'`
+else
+PPBGRESTORE_BRANCH="UNKNOWN"
+PPBGRESTORE_SOURCE="UNKNOWN"
+endif
+
+# Force recompilation of ppbgrestoreVersion.c, since it gets the version information
+ppbgrestoreVersion.c: ppbgrestoreVersionDefinitions.h
+ppbgrestoreVersionDefinitions.h: ppbgrestoreVersionDefinitions.h.in FORCE
+	-$(RM) ppbgrestoreVersionDefinitions.h
+	$(SED) -e "s|@PPBGRESTORE_VERSION@|\"$(PPBGRESTORE_VERSION)\"|" -e "s|@PPBGRESTORE_BRANCH@|\"$(PPBGRESTORE_BRANCH)\"|" -e "s|@PPBGRESTORE_SOURCE@|\"$(PPBGRESTORE_SOURCE)\"|" ppbgrestoreVersionDefinitions.h.in > ppbgrestoreVersionDefinitions.h
+FORCE: ;
+
+
+BUILT_SOURCES = ppbgrestoreVersionDefinitions.h
 
 ppbgrestore_CPPFLAGS = $(PSPHOT_CFLAGS)  $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS)
