From a61026cbcd351d07b1433859901cec94ab2743cf Mon Sep 17 00:00:00 2001 From: Adam Boeglin Date: Thu, 29 Dec 2011 19:43:31 -0500 Subject: [PATCH] Updated metadata, added unpack file to make versioning easier. Added scripts so boblight binaries can be called directly. --- .../addons/service/multimedia/boblightd/meta | 4 +- .../boblightd/source/bin/boblight-X11 | 29 +++++++++ .../boblightd/source/bin/boblight-constant | 29 +++++++++ .../multimedia/boblightd/source/bin/boblightd | 43 ++----------- .../boblightd/source/bin/boblightd.service | 62 +++++++++++++++++++ .../multimedia/boblightd/source/default.py | 2 +- .../service/multimedia/boblightd/unpack | 27 ++++++++ 7 files changed, 155 insertions(+), 41 deletions(-) create mode 100755 packages/addons/service/multimedia/boblightd/source/bin/boblight-X11 create mode 100755 packages/addons/service/multimedia/boblightd/source/bin/boblight-constant create mode 100755 packages/addons/service/multimedia/boblightd/source/bin/boblightd.service create mode 100755 packages/addons/service/multimedia/boblightd/unpack diff --git a/packages/addons/service/multimedia/boblightd/meta b/packages/addons/service/multimedia/boblightd/meta index be05ca82c3..01c8348641 100644 --- a/packages/addons/service/multimedia/boblightd/meta +++ b/packages/addons/service/multimedia/boblightd/meta @@ -24,13 +24,13 @@ PKG_REV="2" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="http://code.google.com/p/boblight" -PKG_URL="http://dl.dropbox.com/u/10051534/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_URL="http://dl.dropbox.com/u/10051534/$PKG_NAME.tar.gz" PKG_DEPENDS="libX11 libXext libX11 libXrender $MESA" PKG_BUILD_DEPENDS="toolchain libX11 libXext libXrender $MESA" PKG_PRIORITY="optional" PKG_SECTION="service/multimedia" PKG_SHORTDESC="boblightd: an ambilight controller." -PKG_LONGDESC="Boblight's main purpose is to create light effects from an external input, such as a video stream." +PKG_LONGDESC="Boblight's main purpose is to create light effects from an external input, such as a video stream.\n\nSee this thread on the Openelec forums for howto and demonstration: http://bit.ly/oe-boblight" PKG_IS_ADDON="yes" PKG_ADDON_TYPE="xbmc.service" diff --git a/packages/addons/service/multimedia/boblightd/source/bin/boblight-X11 b/packages/addons/service/multimedia/boblightd/source/bin/boblight-X11 new file mode 100755 index 0000000000..274c528f99 --- /dev/null +++ b/packages/addons/service/multimedia/boblightd/source/bin/boblight-X11 @@ -0,0 +1,29 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. /etc/profile + +ADDON_DIR="$HOME/.xbmc/addons/service.multimedia.boblightd" + +chmod +x $ADDON_DIR/lib/* + +LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" boblight-X11.bin $@ diff --git a/packages/addons/service/multimedia/boblightd/source/bin/boblight-constant b/packages/addons/service/multimedia/boblightd/source/bin/boblight-constant new file mode 100755 index 0000000000..3947666be0 --- /dev/null +++ b/packages/addons/service/multimedia/boblightd/source/bin/boblight-constant @@ -0,0 +1,29 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. /etc/profile + +ADDON_DIR="$HOME/.xbmc/addons/service.multimedia.boblightd" + +chmod +x $ADDON_DIR/lib/* + +LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" boblight-constant.bin $@ diff --git a/packages/addons/service/multimedia/boblightd/source/bin/boblightd b/packages/addons/service/multimedia/boblightd/source/bin/boblightd index 021ab69851..520bfb2597 100755 --- a/packages/addons/service/multimedia/boblightd/source/bin/boblightd +++ b/packages/addons/service/multimedia/boblightd/source/bin/boblightd @@ -1,10 +1,8 @@ -#!/bin/bash +#!/bin/sh ################################################################################ -# Copyright (C) 2009-2010 OpenELEC.tv -# http://www.openelec.tv -# -# Boblightd addon maintained by Adam Boeglin: adamrb@gmail.com +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,38 +23,7 @@ . /etc/profile ADDON_DIR="$HOME/.xbmc/addons/service.multimedia.boblightd" -ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.multimedia.boblightd" -mkdir -p $ADDON_HOME +chmod +x $ADDON_DIR/lib/* -LOG_FILE="$ADDON_HOME/service.log" - -# Boblight config file created by user -BOBLIGHT_CONFIG="$ADDON_HOME/boblight.conf" - -# Flag file to start boblight-x11 daemon -BOBLIGHT_X11="$ADDON_HOME/boblight.X11" - -export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" - -cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1 - -if [ -e $BOBLIGHT_CONFIG ]; then - - # Make sure the xserver has started up - wait_for_xorg - - # Start the boblight daemon - LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" $ADDON_DIR/bin/boblightd.bin -c $BOBLIGHT_CONFIG -f $@ >> $LOG_FILE 2>&1 - -fi - -if [ -e $BOBLIGHT_X11 ]; then - - # Make sure the xserver has started up - wait_for_xorg - - # Start the boblight daemon - LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" $ADDON_DIR/bin/boblight-X11.bin -f $@ >> $LOG_FILE 2>&1 - -fi +LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" boblightd.bin $@ diff --git a/packages/addons/service/multimedia/boblightd/source/bin/boblightd.service b/packages/addons/service/multimedia/boblightd/source/bin/boblightd.service new file mode 100755 index 0000000000..236c8d0744 --- /dev/null +++ b/packages/addons/service/multimedia/boblightd/source/bin/boblightd.service @@ -0,0 +1,62 @@ +#!/bin/bash + +################################################################################ +# Copyright (C) 2009-2010 OpenELEC.tv +# http://www.openelec.tv +# +# Boblightd addon maintained by Adam Boeglin: adamrb@gmail.com +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. /etc/profile + +ADDON_DIR="$HOME/.xbmc/addons/service.multimedia.boblightd" +ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.multimedia.boblightd" + +mkdir -p $ADDON_HOME + +LOG_FILE="$ADDON_HOME/service.log" + +# Boblight config file created by user +BOBLIGHT_CONFIG="$ADDON_HOME/boblight.conf" + +# Flag file to start boblight-x11 daemon +BOBLIGHT_X11="$ADDON_HOME/boblight.X11" + +export LD_LIBRARY_PATH="$ADDON_DIR/lib:$LD_LIBRARY_PATH" + +cp -R $ADDON_DIR/config/*.sample $ADDON_HOME > $LOG_FILE 2>&1 + +if [ -e $BOBLIGHT_CONFIG ]; then + + # Make sure the xserver has started up + wait_for_xorg + + # Start the boblight daemon + $ADDON_DIR/bin/boblightd -c $BOBLIGHT_CONFIG -f >> $LOG_FILE 2>&1 + +fi + +if [ -e $BOBLIGHT_X11 ]; then + + # Make sure the xserver has started up + wait_for_xorg + + # Start the boblight daemon + $ADDON_DIR/bin/boblight-X11 -f >> $LOG_FILE 2>&1 + +fi diff --git a/packages/addons/service/multimedia/boblightd/source/default.py b/packages/addons/service/multimedia/boblightd/source/default.py index 50b4fbe1c5..4ec88185a9 100644 --- a/packages/addons/service/multimedia/boblightd/source/default.py +++ b/packages/addons/service/multimedia/boblightd/source/default.py @@ -27,6 +27,6 @@ __author__ = "OpenELEC" __url__ = "http://www.openelec.tv" __settings__ = xbmcaddon.Addon(id='service.multimedia.boblightd') __cwd__ = __settings__.getAddonInfo('path') -__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd") ) +__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "boblightd.service") ) os.system(__path__) diff --git a/packages/addons/service/multimedia/boblightd/unpack b/packages/addons/service/multimedia/boblightd/unpack new file mode 100755 index 0000000000..f299ac3901 --- /dev/null +++ b/packages/addons/service/multimedia/boblightd/unpack @@ -0,0 +1,27 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +[ -d $PKG_BUILD ] && rm -rf $PKG_BUILD + +mv $BUILD/${PKG_NAME} $BUILD/$PKG_NAME-$PKG_VERSION