From 238e6754c4d04039188f259573b4cd700d40b3e2 Mon Sep 17 00:00:00 2001 From: Alex Deryskyba Date: Tue, 23 Dec 2014 01:12:34 +0100 Subject: [PATCH] Add a package to support IR remote configuration utility for Amlogic-based devices --- packages/sysutils/amremote/package.mk | 43 +++++++++++++++++++ .../system.d/amlogic-remotecfg.service | 10 +++++ packages/virtual/remote/package.mk | 4 ++ tools/mkpkg/mkpkg_amremote | 43 +++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 packages/sysutils/amremote/package.mk create mode 100644 packages/sysutils/amremote/system.d/amlogic-remotecfg.service create mode 100755 tools/mkpkg/mkpkg_amremote diff --git a/packages/sysutils/amremote/package.mk b/packages/sysutils/amremote/package.mk new file mode 100644 index 0000000000..02e4ecc7a8 --- /dev/null +++ b/packages/sysutils/amremote/package.mk @@ -0,0 +1,43 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2014 Alex Deryskyba (alex@codesnake.com) +# +# OpenELEC 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 of the License, or +# (at your option) any later version. +# +# OpenELEC 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. If not, see . +################################################################################ + +PKG_NAME="amremote" +PKG_VERSION="aa0a9e8" +PKG_REV="1" +PKG_ARCH="arm" +PKG_LICENSE="other" +PKG_SITE="http://www.amlogic.com" +PKG_URL="https://github.com/codesnake/amremote/releases/download/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_DEPENDS_TARGET="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="sysutils/remote" +PKG_SHORTDESC="amremote - IR remote configuration utility for Amlogic-based devices" +PKG_LONGDESC="amremote - IR remote configuration utility for Amlogic-based devices" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +makeinstall_target() { + mkdir -p $INSTALL/usr/bin + cp remotecfg $INSTALL/usr/bin +} + +post_install() { + enable_service amlogic-remotecfg.service +} diff --git a/packages/sysutils/amremote/system.d/amlogic-remotecfg.service b/packages/sysutils/amremote/system.d/amlogic-remotecfg.service new file mode 100644 index 0000000000..1b00383524 --- /dev/null +++ b/packages/sysutils/amremote/system.d/amlogic-remotecfg.service @@ -0,0 +1,10 @@ +[Unit] +Description=Amlogic IR remote support + +[Service] +Type=oneshot +ExecStart=/bin/sh -c '[ -f /storage/.config/remote.conf ] && /usr/bin/remotecfg /storage/.config/remote.conf || /usr/bin/remotecfg /etc/remote.conf' +RemainAfterExit=yes + +[Install] +WantedBy=basic.target diff --git a/packages/virtual/remote/package.mk b/packages/virtual/remote/package.mk index 722d8b617a..dca699e128 100644 --- a/packages/virtual/remote/package.mk +++ b/packages/virtual/remote/package.mk @@ -39,3 +39,7 @@ fi if [ "$IRSERVER_SUPPORT" = "yes" ]; then PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET irserver" fi + +if [ "$AMREMOTE_SUPPORT" = "yes" ]; then + PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET amremote" +fi diff --git a/tools/mkpkg/mkpkg_amremote b/tools/mkpkg/mkpkg_amremote new file mode 100755 index 0000000000..f454d76cc0 --- /dev/null +++ b/tools/mkpkg/mkpkg_amremote @@ -0,0 +1,43 @@ +#!/bin/sh +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 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, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +echo "getting sources..." + if [ ! -d libamcodec.git ]; then + git clone https://github.com/codesnake/amremote.git amremote.git + fi + + cd amremote.git + git pull + GIT_REV=`git log -n1 --format=%h` + cd .. + +echo "copying sources..." + rm -rf amremote-$GIT_REV + cp -R amremote.git amremote-$GIT_REV + +echo "cleaning sources..." + rm -rf amremote-$GIT_REV/.git + +echo "packing sources..." + tar cvJf amremote-$GIT_REV.tar.xz amremote-$GIT_REV + +echo "remove temporary sourcedir..." + rm -rf amremote-$GIT_REV