Running Addons on PC


git clone
cd /home/login/dSS/sysroot/share/dss-web/webroot
ln -s ~/dSS/dss-addon-framework framework


Clone the add-on repositories into folders according to the actual name used on the target. E.g.:

git clone system-addon-timed-events
git clone system-addon-user-defined-actions


cd ~/dSS/sysroot/share/dss/data/subscriptions.d
ln -s ~/dSS/hle-edit/config/system-addon-user-defined-actions.xml
ln -s ~/dSS/timed-events/config/system-addon-timed-events.xml .

The subscription files contain absolute paths. In order to get the add-ons workin properly those path have to be changed. Use one for the following two options:

A. use git to fix paths:

This will automatically and transparently rewrite the subscription files to use the locally valid paths.

  1. (once) add the following to ~/.gitconfig and replace <PATH_TO_YOUR_DSS> with the real path:
    [filter "appxml"]
        smudge = perl -pe "s:/usr/share/dss/add-ons/system-addon-scene-responder/:$(pwd)/../system-addon-scene-responder/scripts/:" | perl -pe "s:/usr/share/dss/add-ons/.*?/:$(pwd)/scripts/:" | perl -pe "s:/usr/share/dss/data/scripts/:<PATH_TO_YOUR_DSS>/data/scripts/:" 
        clean = perl -pe "s:$(pwd)/../system-addon-scene-responder/scripts/:/usr/share/dss/add-ons/system-addon-scene-responder/:" | perl -pe "s:$(pwd)/scripts/:/usr/share/dss/add-ons/$(basename $(pwd))/:" | perl -pe "s:<PATH_TO_YOUR_DSS>/data/scripts/:/usr/share/dss/data/scripts/:" 
  2. in the root of each add-on git checkout create the file .gitattributes with the following content:
    *.xml filter=appxml

B. fix absolute paths:

sed -i s@/usr/share/dss/add-ons/system-addon-user-defined-actions@/home/login/dSS/hle-edit/scripts@ system-addon-user-defined-actions.xml
sed -i s@/usr/share/dss/add-ons/system-addon-timed-events@/home/login/dSS/timed-events/scripts@ system-addon-timed-events.xml
function convert
    sed -i s@/usr/share/dss/add-ons/$1@/home/login/dSS/addons/$1/scripts@ $2 

convert huecontrol huecontrol.xml
convert metering metering.xml
convert upnp-controller upnp-controller.xml 
convert system-addon-presence-simulator system-addon-presence-simulator.xml


cd /home/login/dSS/sysroot/share/dss-web/webroot
mkdir addons
cd addons
ln -s ~/dSS/hle-edit/ui uda
ln -s ~/dSS/timed-events/ui te
ls ~/dSS/addons/ | while read a; do
    if [ ! -d ~/dSS/addons/$a ] ; then
        echo not dir $a
    echo ln -s ~/dSS/addons/$a/ui $a