summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild')
-rw-r--r--sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild62
1 files changed, 62 insertions, 0 deletions
diff --git a/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild b/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild
new file mode 100644
index 000000000000..d4b5068e3092
--- /dev/null
+++ b/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Allows to send commands to some microcontrollers, for example to change leds or sound a buzzer"
+HOMEPAGE="http://qnap.nas-central.org/index.php/PIC_Control_Software"
+SRC_URI="mirror://debian/pool/main/q/qcontrol/${P/-/_}.orig.tar.gz
+ mirror://debian/pool/main/q/qcontrol/${P/-/_}-6.diff.gz"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="arm"
+IUSE=""
+
+DEPEND=">=dev-lang/lua-5.1"
+RDEPEND="${DEPEND}"
+
+src_unpack () {
+ unpack ${A}
+ cd "${WORKDIR}"
+
+ epatch *.diff
+
+ cd "${S}"
+ epatch debian/patches/*.patch
+
+ epatch "${FILESDIR}"/${PV}-Makefile.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" qcontrol || die "emake failed"
+}
+
+src_install() {
+ dosbin qcontrol
+ doman "${S}"/debian/qcontrol.1
+
+ insinto /etc/qcontrol
+ doins "${S}"/debian/configs/*.lua
+
+ newconfd "${FILESDIR}"/conf.d qcontrol
+ newinitd "${FILESDIR}"/init.d qcontrol
+}
+
+pkg_postinst() {
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209")
+ dosym /etc/qcontrol/ts209.lua /etc/qcontrol.conf ;;
+ "QNAP TS-119/TS-219")
+ dosym /etc/qcontrol/ts219.lua /etc/qcontrol.conf ;;
+ "QNAP TS-409")
+ dosym /etc/qcontrol/ts409.lua /etc/qcontrol.conf ;;
+ "QNAP TS-41x")
+ dosym /etc/qcontrol/ts41x.lua /etc/qcontrol.conf ;;
+ *)
+ ewarn "Your device is unsupported" ;;
+ esac
+}