From d1eb40dd39b41377b3882fd20c4cfcaa340e9df4 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Wed, 19 Jan 2011 14:43:03 +0100 Subject: [PATCH] new package: add package 'netstatus' Signed-off-by: Stephan Raue --- packages/network/netstatus/build | 28 ++++++++++++++ packages/network/netstatus/install | 27 ++++++++++++++ packages/network/netstatus/meta | 37 +++++++++++++++++++ .../netstatus/profile.d/netstatus.conf | 29 +++++++++++++++ 4 files changed, 121 insertions(+) create mode 100755 packages/network/netstatus/build create mode 100755 packages/network/netstatus/install create mode 100644 packages/network/netstatus/meta create mode 100644 packages/network/netstatus/profile.d/netstatus.conf diff --git a/packages/network/netstatus/build b/packages/network/netstatus/build new file mode 100755 index 0000000000..53801336e5 --- /dev/null +++ b/packages/network/netstatus/build @@ -0,0 +1,28 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +#      Copyright (C) 2010-2011 Roman Weber (roman@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 + +cd $PKG_BUILD + +make diff --git a/packages/network/netstatus/install b/packages/network/netstatus/install new file mode 100755 index 0000000000..8990dd81ad --- /dev/null +++ b/packages/network/netstatus/install @@ -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) +#      Copyright (C) 2010-2011 Roman Weber (roman@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 $INSTALL/usr/bin + cp $PKG_BUILD/netstatus $INSTALL/usr/bin diff --git a/packages/network/netstatus/meta b/packages/network/netstatus/meta new file mode 100644 index 0000000000..dd56405e62 --- /dev/null +++ b/packages/network/netstatus/meta @@ -0,0 +1,37 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv) +#      Copyright (C) 2010-2011 Roman Weber (roman@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="netstatus" +PKG_VERSION="1" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://wiki.meego.com/D-Bus/Overview#D-Bus_GLib" +PKG_URL="$OPENELEC_SRC/$PKG_NAME-$PKG_VERSION.tar.bz2" +PKG_DEPENDS="dbus glib dbus-glib" +PKG_BUILD_DEPENDS="toolchain dbus glib dbus-glib" +PKG_PRIORITY="optional" +PKG_SECTION="network" +PKG_SHORTDESC="netstatus: asmall utility to know if we are online or not" +PKG_LONGDESC="netstatus is a small utility to know if we are online or not" +PKG_IS_ADDON="no" + +PKG_AUTORECONF="no" diff --git a/packages/network/netstatus/profile.d/netstatus.conf b/packages/network/netstatus/profile.d/netstatus.conf new file mode 100644 index 0000000000..3f851e0d45 --- /dev/null +++ b/packages/network/netstatus/profile.d/netstatus.conf @@ -0,0 +1,29 @@ +################################################################################ +# 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 +################################################################################ + +wait_for_network () { + if [ -x /usr/bin/netstatus ]; then + val=`/usr/bin/netstatus` + while [ "$val" != "Network state is online" ]; do + val=`/usr/bin/netstatus` + usleep 250000 + done + fi +}