summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Barisione <marco.barisione@collabora.co.uk>2014-04-08 15:07:04 +0100
committerMarco Barisione <marco.barisione@collabora.co.uk>2014-04-08 16:17:09 +0100
commitd497e3db52ccb7d41a83d26034f7edb5f186dfb8 (patch)
treede0f50e32437be8324d06cc77e606e4af487fc96
parent3808c9dcbe0c5d56356f58938344eced3756b3fa (diff)
downloadgraynard-d497e3db52ccb7d41a83d26034f7edb5f186dfb8.tar.gz
graynard-d497e3db52ccb7d41a83d26034f7edb5f186dfb8.zip
Add a script to run maynard
-rw-r--r--.gitignore3
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac1
-rw-r--r--maynard.in30
4 files changed, 35 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index d044d85..0eff5c0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ _gen
/missing
/stamp-h1
/maynard-*.tar.xz
+/maynard
shell/desktop-shell-client-protocol.h
shell/desktop-shell-protocol.c
shell/shell-helper-client-protocol.h
@@ -49,4 +50,4 @@ data/gschemas.compiled
data/org.raspberrypi.maynard.gschema.valid
data/org.raspberrypi.maynard.gschema.xml
po/POTFILES
-po/stamp-it \ No newline at end of file
+po/stamp-it
diff --git a/Makefile.am b/Makefile.am
index fd9d709..0ef78ad 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1,3 @@
SUBDIRS = data protocol shell po
+
+bin_SCRIPTS = maynard
diff --git a/configure.ac b/configure.ac
index f30adcd..a7366ca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,7 @@ GLIB_GSETTINGS
WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
+AC_CONFIG_FILES([maynard], [chmod +x maynard])
AC_CONFIG_FILES([Makefile
data/Makefile
shell/Makefile
diff --git a/maynard.in b/maynard.in
new file mode 100644
index 0000000..209a6ad
--- /dev/null
+++ b/maynard.in
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+PREFIX=@prefix@
+LIBEXECDIR=$PREFIX/libexec
+ABS_BUILDDIR=@abs_builddir@
+
+md5() {
+ cat "$1" 2> /dev/null | md5sum
+}
+
+check_install() {
+ local_maynard="$ABS_BUILDDIR/shell/maynard"
+ installed_maynard="$LIBEXECDIR/maynard"
+ if [ ! -e "$local_maynard" -o \
+ ! -e "$installed_maynard" -o \
+ "`md5 \"$local_maynard\"`" != "`md5 \"$installed_maynard\"`" ]; then
+ echo "It looks like you forgot to run 'make install'." >&1
+ exit 1
+ fi
+}
+
+xdpyinfo > /dev/null 2>&1
+if [ "$?" = "0" ]; then
+ # We are running under X, so let's assume this is a development
+ # installation.
+ check_install
+ XDG_DATA_DIRS=$XDG_DATA_DIRS:$PREFIX/share/ $PREFIX/bin/weston
+else
+ weston-launch
+fi