From ba109d9095ed77acfc7c924f6543042c0a02674c Mon Sep 17 00:00:00 2001 From: Aidan O'Mahony Date: Sat, 26 Nov 2011 18:21:41 +1100 Subject: [PATCH] adding lsyncd addon --- .../addons/networking/backup/lsyncd/addon | 27 +++++++++++++ .../addons/networking/backup/lsyncd/build | 37 ++++++++++++++++++ packages/addons/networking/backup/lsyncd/meta | 38 +++++++++++++++++++ .../backup/lsyncd/source/default.py | 23 +++++++++++ 4 files changed, 125 insertions(+) create mode 100755 packages/addons/networking/backup/lsyncd/addon create mode 100755 packages/addons/networking/backup/lsyncd/build create mode 100644 packages/addons/networking/backup/lsyncd/meta create mode 100644 packages/addons/networking/backup/lsyncd/source/default.py diff --git a/packages/addons/networking/backup/lsyncd/addon b/packages/addons/networking/backup/lsyncd/addon new file mode 100755 index 0000000000..74f163fbae --- /dev/null +++ b/packages/addons/networking/backup/lsyncd/addon @@ -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 + +mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin + cp $PKG_BUILD/lsyncd $ADDON_BUILD/$PKG_ADDON_ID/bin + chmod +x $ADDON_BUILD/$PKG_ADDON_ID/bin/lsyncd diff --git a/packages/addons/networking/backup/lsyncd/build b/packages/addons/networking/backup/lsyncd/build new file mode 100755 index 0000000000..58c4b8139d --- /dev/null +++ b/packages/addons/networking/backup/lsyncd/build @@ -0,0 +1,37 @@ +#!/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 + +export LUA_LIBS="$SYSROOT_PREFIX/usr/lib/liblua.a" +export LUA_CFLAGS="-I$SYSROOT_PREFIX/usr/include" +export LDFLAGS="-lm" + +cd $PKG_BUILD +sed -i 's/\/usr\/bin\/rsync/\/storage\/.xbmc\/addons\/network.backup.rsync\/bin\/rsync/' lsyncd.lua +./configure --host=$TARGET_NAME \ + --build=$HOST_NAME \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + +make diff --git a/packages/addons/networking/backup/lsyncd/meta b/packages/addons/networking/backup/lsyncd/meta new file mode 100644 index 0000000000..df2df3fb91 --- /dev/null +++ b/packages/addons/networking/backup/lsyncd/meta @@ -0,0 +1,38 @@ +################################################################################ +# 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 +################################################################################ + +PKG_NAME="lsyncd" +PKG_VERSION="2.0.5" +PKG_REV="0" +PKG_ARCH="any" +PKG_LICENSE="OSS" +PKG_SITE="http://code.google.com/p/lsyncd/" +PKG_URL="http://lsyncd.googlecode.com/files/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain libiconv lua" +PKG_PRIORITY="optional" +PKG_SECTION="network/backup" +PKG_SHORTDESC="Lsyncd (Live Syncing Daemon) synchronizes local directories with a remote targets" +PKG_LONGDESC="Lsyncd watches a local directory trees event monitor interface (inotify). It aggregates and combines events for a few seconds and then spawns one (or more) process(es) to synchronize the changes. By default this is rsync. Lsyncd is thus a light-weight live mirror solution that is comparatively easy to install not requiring new filesystems or blockdevices and does not hamper local filesystem performance." + +PKG_IS_ADDON="yes" +PKG_ADDON_TYPE="xbmc.python.script" + +PKG_AUTORECONF="yes" diff --git a/packages/addons/networking/backup/lsyncd/source/default.py b/packages/addons/networking/backup/lsyncd/source/default.py new file mode 100644 index 0000000000..2085a1f96d --- /dev/null +++ b/packages/addons/networking/backup/lsyncd/source/default.py @@ -0,0 +1,23 @@ +################################################################################ +# 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 +################################################################################ + +import os +import sys +import xbmcaddon