--- /dev/null
+#!/bin/sh
+#
+# We are tricking the builds process into executing this so that we can
+# extract an svn revision number from the source directory
+
+# do nothing if we are not in a svn repository
+if [ ! -d .svn ]; then
+ exit
+fi
+
+svnrev=$(svnversion | cut -f1 -d:)
+
+cat <<EOF > R/svnversion.R
+# Autogenerated by configure. Do not edit.
+svnversion <- function() {
+ return("$svnrev")
+}
+EOF
+