Skip to content

Commit

Permalink
added patch to start xfacetrackerlk with sudo/gksudo/kdesudo commands
Browse files Browse the repository at this point in the history
by substituting /opt/xfacetrackerlk/xfacetrackerlk program with a shell
script
now embedded java version is supported again

Made /var/opt/xfacetrackerlk only writable for root
chmod -R g-wx /var/opt/XFacetrackerLK/
chmod -R o-wx /var/opt/XFacetrackerLK/
chmod -R u+wx /var/opt/XFacetrackerLK/

changed to only use lowercase applicationnames
  • Loading branch information
deinhofer committed Jan 29, 2016
1 parent c76a060 commit a92db15
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 55 deletions.
18 changes: 9 additions & 9 deletions CameraInput/XFacetrackerLK/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
</fx:resources>

<fx:application id="fxApplication"
name="XFacetrackerLK"
name="xfacetrackerlk"
mainClass="org.eclipse.core.runtime.adaptor.EclipseStarter"
version="1.0.1-AsTeRICS-2.7"
version="1.0.2-asterics-2.7"
toolkit="swing"
/>
<!--
Expand Down Expand Up @@ -71,7 +71,7 @@
includeDT="false"
offlineAllowed="true"
outdir="${build.deploy}"
outfile="XFacetrackerLK" nativeBundles="deb"
outfile="xfacetrackerlk-javaembedded" nativeBundles="deb"
updatemode="background" >


Expand All @@ -89,9 +89,9 @@

<fx:application refId="fxApplication"/>
<fx:resources refid="appRes"/>
<fx:info title="XFacetrackerLK - Head controlled mouse" vendor="AsTeRICS consortium - http://www.asterics.eu" description="Head controlled mouse" license="GPLv3 | MIT dual" category="Universal Access"/>
<fx:info title="xfacetrackerlk - Head controlled mouse" vendor="AsTeRICS consortium - http://www.asterics.eu" description="Head controlled mouse" license="GPLv3 | MIT dual" category="Universal Access"/>
</fx:deploy>
<move file="${build.deploy}/bundles/xfacetrackerlk-1.0.1-AsTeRICS-2.7.deb" tofile="${build.deploy}/bundles/xfacetrackerlk-javaembedded-1.0.1-AsTeRICS-2.7.deb"/>
<move file="${build.deploy}/bundles/xfacetrackerlk-1.0.2-asterics-2.7.deb" tofile="${build.deploy}/bundles/xfacetrackerlk-javaembedded-1.0.2-asterics-2.7.deb"/>
</target>


Expand All @@ -102,9 +102,9 @@
</fx:resources>

<fx:application id="fxApplication"
name="XFacetrackerLK"
name="xfacetrackerlk"
mainClass="org.eclipse.core.runtime.adaptor.EclipseStarter"
version="1.0.1-AsTeRICS-2.7"
version="1.0.2-asterics-2.7"
toolkit="swing"
/>
<fx:platform basedir="" id="fxPlatform">
Expand Down Expand Up @@ -145,7 +145,7 @@
includeDT="false"
offlineAllowed="true"
outdir="${build.deploy}"
outfile="XFacetrackerLK" nativeBundles="deb"
outfile="xfacetrackerlk" nativeBundles="deb"
updatemode="background" >
<fx:platform refid="fxPlatform"/>

Expand All @@ -154,7 +154,7 @@
<fx:application refId="fxApplication"/>
<fx:resources refid="appRes"/>
<fx:info id="fxInfo"
title="XFacetrackerLK - Head controlled mouse"
title="xfacetrackerlk - head controlled mouse"
vendor="AsTeRICS consortium - http://www.asterics.eu"
description="Head controlled mouse"
license="GPLv3 | MIT dual"
Expand Down

This file was deleted.

Empty file.
64 changes: 44 additions & 20 deletions CameraInput/XFacetrackerLK/package/linux/postinst
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# postinst script for XFacetrackerLK
# postinst script
#
# see: dh_installdeb(1)

Expand All @@ -17,48 +17,72 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

APPNAME="XFacetrackerLK"
#source appname
#. APE.properties
APPNAME="$DPKG_MAINTSCRIPT_PACKAGE"
APPPATH="/opt/$APPNAME/app/"
APPINSTALLDIR="/opt/$APPNAME"
WRITEDIR="/var/opt/$APPNAME/"

case "$1" in
configure)
echo "Creating desktop menu entry"
xdg-desktop-menu install --novendor /opt/XFacetrackerLK/XFacetrackerLK.desktop

echo creating symlinks for models, profile and data folders to $WRITEDIR folder
echo $DPKG_MAINTSCRIPT_PACKAGE
echo Adding shortcut to the menu

#if [ -d "$APPPATH/../runtime" ]; then
echo "Creating desktop menu entry $APPNAME"
xdg-desktop-menu install --novendor $APPINSTALLDIR/$APPNAME.desktop
#fi


echo creating symlinks for models, profile and data folders to tmp folder
rm -Rf $WRITEDIR
mkdir -p $WRITEDIR
mv $APPPATH/models $WRITEDIR
mv $APPPATH/profile $WRITEDIR
mv $APPPATH/data $WRITEDIR
mv $APPPATH/areProperties $WRITEDIR

chmod -R o+w $WRITEDIR
ln -sf $WRITEDIR/models $APPPATH/models
ln -sf $WRITEDIR/profile $APPPATH/profile
ln -sf $WRITEDIR/data $APPPATH/data
ln -sf $WRITEDIR/areProperties $APPPATH/areProperties

chmod -R g-wx $WRITEDIR
chmod -R o-wx $WRITEDIR
chmod -R u+wx $WRITEDIR

chmod +x $APPPATH/start*.sh

#embedded start-script to .bin and replace it with a shell script
mv $APPINSTALLDIR/$APPNAME $APPINSTALLDIR/$APPNAME.bin

cat << 'EOF' >> $APPINSTALLDIR/$APPNAME
#!/bin/sh
SCRIPTDIR="$(dirname "$0")"
APPNAME=$(basename $SCRIPTDIR)
if [ "false" = "true" ]; then
echo Installing daemon
cp /opt/XFacetrackerLK/xfacetrackerlk.init /etc/init.d/xfacetrackerlk
SUDO_CMD=sudo
if [ -f /usr/bin/gksudo ] ; then
SUDO_CMD=/usr/bin/gksudo
else
if [ -f /usr/bin/kdesudo ] ; then
SUDO_CMD=/usr/bin/kdesudo
fi
fi
if [ -x "/etc/init.d/xfacetrackerlk" ]; then
update-rc.d xfacetrackerlk defaults
START_CMD="$SCRIPTDIR/app/start.sh $@"
if [ -d "$SCRIPTDIR/runtime" ]; then
START_CMD="$SCRIPTDIR/$APPNAME.bin $@"
fi
if [ "false" = "true" ]; then
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d xfacetrackerlk start
else
/etc/init.d/xfacetrackerlk start
fi
fi
fi
echo Starting $SUDO_CMD $START_CMD
$SUDO_CMD $START_CMD
EOF

fi
chmod +x $APPINSTALLDIR/$APPNAME

;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down
27 changes: 10 additions & 17 deletions CameraInput/XFacetrackerLK/package/linux/prerm
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh
# prerm script for XFacetrackerLK
# prerm script
#
# see: dh_installdeb(1)

Expand All @@ -16,34 +16,27 @@ set -e
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

APPNAME="XFacetrackerLK"
#source appname
#. APE.properties
APPNAME="$DPKG_MAINTSCRIPT_PACKAGE"
APPPATH="/opt/$APPNAME/app/"
APPINSTALLDIR="/opt/$APPNAME"
WRITEDIR="/var/opt/$APPNAME/"

case "$1" in
remove|upgrade|deconfigure)
echo Removing desktop menu entry
xdg-desktop-menu uninstall --novendor /opt/XFacetrackerLK/XFacetrackerLK.desktop
echo Removing shortcut for $APPNAME

xdg-desktop-menu uninstall --novendor $APPINSTALLDIR/$APPNAME.desktop

if [ "false" = "true" ]; then
if [ "true" = "true" ]; then
echo Stopping daemon
if which invoke-rc.d >/dev/null 2>&1; then
invoke-rc.d xfacetrackerlk stop
else
/etc/init.d/xfacetrackerlk stop
fi
fi
fi

echo Removing symbolic links and $WRITEDIR
echo Removing symbolic links and write dir
rm -Rf $WRITEDIR
rm -f $APPPATH/modules
rm -f $APPPATH/profile
rm -f $APPPATH/data
rm -f $APPPATH/areProperties


mv $APPINSTALLDIR/$APPNAME.bin $APPINSTALLDIR/$APPNAME
;;

failed-upgrade)
Expand Down

0 comments on commit a92db15

Please sign in to comment.