From b8d05a72c6fbb530050a075d4e0f62acbcc193d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20M=2E=20G=C3=B3mez?= Date: Mon, 18 Jun 2018 13:54:44 +0200 Subject: [PATCH] #750: Process to build OGAgent for ogLive package. --- oglive/build-packages.sh | 11 +++++++++++ oglive/debian/ogagent-oglive.postinst.debhelper | 5 +++++ oglive/debian/ogagent-oglive.postrm.debhelper | 12 ++++++++++++ oglive/scripts/OGAgentTool | 6 ++++++ oglive/scripts/OGAgentTool-startup | 10 ++++++++++ 5 files changed, 44 insertions(+) create mode 100755 oglive/build-packages.sh create mode 100644 oglive/debian/ogagent-oglive.postinst.debhelper create mode 100644 oglive/debian/ogagent-oglive.postrm.debhelper create mode 100644 oglive/scripts/OGAgentTool create mode 100644 oglive/scripts/OGAgentTool-startup diff --git a/oglive/build-packages.sh b/oglive/build-packages.sh new file mode 100755 index 0000000..4d5eb8d --- /dev/null +++ b/oglive/build-packages.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +cd $(dirname "$0") +top=`pwd` + +[ -r ../src/VERSION ] && VERSION="$(cat ../src/VERSION)" || VERSION="1.1.0" +RELEASE="1" + +# Debian based +dpkg-buildpackage -b -d + diff --git a/oglive/debian/ogagent-oglive.postinst.debhelper b/oglive/debian/ogagent-oglive.postinst.debhelper new file mode 100644 index 0000000..e75924d --- /dev/null +++ b/oglive/debian/ogagent-oglive.postinst.debhelper @@ -0,0 +1,5 @@ +# Automatically added by dh_installinit +if [ -x "/etc/init.d/ogagent" ]; then + update-rc.d ogagent defaults >/dev/null || exit $? +fi +# End automatically added section diff --git a/oglive/debian/ogagent-oglive.postrm.debhelper b/oglive/debian/ogagent-oglive.postrm.debhelper new file mode 100644 index 0000000..3167f1f --- /dev/null +++ b/oglive/debian/ogagent-oglive.postrm.debhelper @@ -0,0 +1,12 @@ +# Automatically added by dh_installinit +if [ "$1" = "purge" ] ; then + update-rc.d ogagent remove >/dev/null +fi + + +# In case this system is running systemd, we make systemd reload the unit files +# to pick up changes. +if [ -d /run/systemd/system ] ; then + systemctl --system daemon-reload >/dev/null || true +fi +# End automatically added section diff --git a/oglive/scripts/OGAgentTool b/oglive/scripts/OGAgentTool new file mode 100644 index 0000000..5b30052 --- /dev/null +++ b/oglive/scripts/OGAgentTool @@ -0,0 +1,6 @@ +#!/bin/sh + +FOLDER=/usr/share/OGAgent + +cd $FOLDER +python OGAgentUser.py $@ diff --git a/oglive/scripts/OGAgentTool-startup b/oglive/scripts/OGAgentTool-startup new file mode 100644 index 0000000..bb3a848 --- /dev/null +++ b/oglive/scripts/OGAgentTool-startup @@ -0,0 +1,10 @@ +#!/bin/sh + +# Simple hack to wait for systray to be present +# Exec tool if not already runned by session manager +ps -ef | grep "$USER" | grep -v grep | grep -v OGAgentTool-startup | grep 'OGAgentTool' -q +# If not already running +if [ $? -eq 1 ]; then + sleep 5 + exec /usr/bin/OGAgentTool +fi \ No newline at end of file