summarylogtreecommitdiffstats
path: root/gorsync-git.install
diff options
context:
space:
mode:
Diffstat (limited to 'gorsync-git.install')
-rw-r--r--gorsync-git.install71
1 files changed, 71 insertions, 0 deletions
diff --git a/gorsync-git.install b/gorsync-git.install
new file mode 100644
index 000000000000..92a840bd1ae7
--- /dev/null
+++ b/gorsync-git.install
@@ -0,0 +1,71 @@
+post_install() {
+ :
+#!/usr/bin/env sh
+
+#if [ -z "$1" ]; then
+ export PREFIX=/usr
+#else
+# export PREFIX=$1
+#fi
+
+if [ "$PREFIX" = "/usr" ] && [ "$(id -u)" != "0" ]; then
+ # Make sure only root can run our script
+ echo "This script must be run as root" 1>&2
+ exit 1
+fi
+
+# Check availability of required commands
+# COMMANDS="install glib-compile-schemas glib-compile-resources msgfmt desktop-file-validate gtk-update-icon-cache"
+COMMANDS="install glib-compile-schemas glib-compile-resources msgfmt desktop-file-validate gtk-update-icon-cache"
+# if [ "$PREFIX" = '/usr' ] || [ "$PREFIX" = "/usr/local" ]; then
+# COMMANDS="$COMMANDS xdg-desktop-menu"
+# fi
+# PACKAGES="coreutils glib2 glib2 gettext desktop-file-utils gtk-update-icon-cache xdg-utils"
+PACKAGES="coreutils glib2 glib2 gettext desktop-file-utils gtk-update-icon-cache xdg-utils"
+i=0
+for COMMAND in $COMMANDS; do
+ type $COMMAND >/dev/null 2>&1 || {
+ j=0
+ for PACKAGE in $PACKAGES; do
+ if [ $i = $j ]; then
+ break
+ fi
+ j=$(( $j + 1 ))
+ done
+ echo "Your system is missing command $COMMAND, please install $PACKAGE"
+ exit 1
+ }
+ i=$(( $i + 1 ))
+done
+
+echo "Installing gsettings schema to prefix ${PREFIX}"
+
+# Copy and compile schema
+echo "Copying and compiling schema..."
+install -d ${PREFIX}/share/glib-2.0/schemas
+install -m 644 gsettings/org.d2r2.gorsync.gschema.xml ${PREFIX}/share/glib-2.0/schemas/
+glib-compile-schemas ${PREFIX}/share/glib-2.0/schemas/
+
+
+}
+pre_remove() {
+ :
+#!/usr/bin/env sh
+
+#if [ -z "$1" ]; then
+ export PREFIX=/usr
+ # Make sure only root can run our script
+ if [ "$(id -u)" != "0" ]; then
+ echo "This script must be run as root" 1>&2
+ exit 1
+ fi
+#else
+# export PREFIX=$1
+#fi
+
+echo "Uninstalling gsettings schema from prefix ${PREFIX}"
+
+rm ${PREFIX}/share/glib-2.0/schemas/org.d2r2.gorsync.gschema.xml
+glib-compile-schemas ${PREFIX}/share/glib-2.0/schemas/
+
+}