summaryrefslogtreecommitdiff
path: root/sys-apps/qcontrol
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-apps/qcontrol
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-apps/qcontrol')
-rw-r--r--sys-apps/qcontrol/Manifest9
-rw-r--r--sys-apps/qcontrol/files/0.4.2-Makefile.patch22
-rw-r--r--sys-apps/qcontrol/files/conf.d5
-rw-r--r--sys-apps/qcontrol/files/init.d74
-rw-r--r--sys-apps/qcontrol/metadata.xml12
-rw-r--r--sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild61
6 files changed, 183 insertions, 0 deletions
diff --git a/sys-apps/qcontrol/Manifest b/sys-apps/qcontrol/Manifest
new file mode 100644
index 000000000000..20d06f2c027e
--- /dev/null
+++ b/sys-apps/qcontrol/Manifest
@@ -0,0 +1,9 @@
+AUX 0.4.2-Makefile.patch 706 SHA256 af1ad2aa6db4198c23d2b5a4643e97bf5526801af57d4f29bd45a1cdb18532a7 SHA512 c5f2066b6df7724f3eab33e2f8b93e1b981268863b7e9eec2ab0591fa00de4c9ee98566b0469c495ad04b27c977a06ed81afdfdeee6de687cd5382c7ca14a8e3 WHIRLPOOL cdb2500ea0817c311439a8b096f96dc9acd36bc9e7799dd54c883f412fe9decfcb1f557386fc220c8899651ce989e8b610ec0dc1038cd37222242bedbfd878cb
+AUX conf.d 133 SHA256 b25115ebda4ed6ccb5292efdc686d00e3bcacdb4dbb991d498d00c1c87fa548b SHA512 d2b0d1e75eb42c3be65065cb45efaeb3acece3f857cf77b5baf1db9d199d7676e42363ac4f84682e26f81da13ba700bb4f9fbb1b6d483c45a5864e87bc3f2db4 WHIRLPOOL 3c8433155531d03775425e1eb77738db17350cd9b45633f733ac8d1d19be8930517159a50dd7040d3be741445ab392b4e33456af9a0a9b09c02422979c3c6c98
+AUX init.d 2211 SHA256 2e5d58533de6be8a00d7ee5a4d3b2bee669be75b87a0515fd1949e1ddf8f17c6 SHA512 66c6c4f30e93f759ca7a9875e23ed82843d9cc728c14c7bc7fffee3fbbafefa57244155649986c547264f500a21d0099efd1195d1810b47370c8f77ed79e4dde WHIRLPOOL 1919f7735a284e5aa6bebafd4051748ccf19e201bec49a9b6ff6339fcfd96b4880251d4b1c9a33b40614ca5fb2056176c20e3c97b8f1770c4711201534bf6d86
+DIST qcontrol_0.4.2-6.diff.gz 11426 SHA256 11d45cebfe217a8bc0a0dbfc641fc098510c4b521cc83b993bd1fd493b834625 SHA512 ce450d04c72052c8e7ce0bf26d21d9942d3ea02b958b510efdf26d368ee69778eaf61bec2084c4d21cc1a5d281d1331e40b7bcaf388b4b59174a37ed037dd984 WHIRLPOOL 2d058db16afbb6b0a3b48bbc81887aad2aa0765e695544968ffa379026a9d38c06d2501133c3e49fef2f82bdb4c7a5d4b6907bdd2625c7ef489fdfab5c3562ee
+DIST qcontrol_0.4.2.orig.tar.gz 18344 SHA256 efe7311cdd460a51475d22f737540e7bb3c4303e5eba97b782d765c8f1e67055 SHA512 f132faff54833f11ae79622dc8e33b4e0f2516f7377633ff47a4ebe71335503c5e4892723c049b00888622ce059026cd97c6856b425b94163ec09887bd21e81e WHIRLPOOL 88e251dc4cd42a0f185a04742fbfe7d55d784322483c16c2b74593c20dd84a66b4937fe3f7e6b894c003f580df2fd896527e04b47fa6b2895dfc94a3b6e0ec47
+EBUILD qcontrol-0.4.2-r1.ebuild 1464 SHA256 969a90a421c72a6d0f20fa63170275cd71b053bc6a30f3cedd04a548d3ddfc2f SHA512 30c3015badece1cc6fff3769ce1cda6b91f5c1e640df2916d1c083228c63aba28c35ec059504f02ff0ca99df7a7ddd2592277f50afda70e1aef885b11ccacb16 WHIRLPOOL e2e9aec8c17a9b9458a75513545be5a32bf68e97e1032792d3daad6acc4212119d18ffb1c846b8dd6caf12b64e9fe439df1057cc17f0ad788ff0c1655daaf57c
+MISC ChangeLog 2744 SHA256 c3039248f722741398f0990a9a0f791fdf0af7600480cfb264b6292baa379421 SHA512 5334c3fe184a8ca20bb78ff65001b1c70d27720e84b7d142388033ce90bfc7253174678dfc77ccbcaf3cd423de601b1aec87f43f858902c66209f6b1fa249f28 WHIRLPOOL bb3aa76535f1adddeb6662a50439a9ee41e0dc22ddc679ea13e356b59645869425ac1bcd0af3ce987e4cf806894c8baefa2f6fec55e471ddfcb94a58aa7b0235
+MISC ChangeLog-2015 957 SHA256 75e1fc93f461d10b7f38fb1e50f83b8f0ad92b6ac15a48c8927b34b576b85856 SHA512 7d1fe7ef937803f13ddf2a8d136ae6824b02732fdeec5af328a95d23657848b42ca19cb5e1a95cab1e37ad7eaee328cfe188848560f12619bc6a7a895794bdd4 WHIRLPOOL 4aafb51ccee35630bda05f450009b3cf66c902642526ecb39bda834a00f3bf0678723e3bbf98ab64e7a8ffed857db0679b5829dc58c6b6917306df7586252203
+MISC metadata.xml 367 SHA256 bf52934f65c1ed50922e23fc257aa7400b17432b3e1cd3dd4cd2809d7da62a3a SHA512 ee0131a33df4a79331dfe2a7485d71b05f8f386d3b6ce0b26ab76a7c9f8d9b20efb931fda54d499feb9dd6c3feba34299cf8943fbac2ffea2076e634d49087de WHIRLPOOL de5dbd1af733f6c925ad91a42d6e6729141ea11d2b58e7a25d59fc286b6150d4a3346db9a08329cffcc2c4a131c30e1490d2a105d30847a3865d56609cde24a9
diff --git a/sys-apps/qcontrol/files/0.4.2-Makefile.patch b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
new file mode 100644
index 000000000000..ad3701c549eb
--- /dev/null
+++ b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
@@ -0,0 +1,22 @@
+--- Makefile.orig 2011-04-02 20:44:05.021252507 +0200
++++ Makefile 2011-04-02 20:45:21.751248966 +0200
+@@ -1,5 +1,4 @@
+-CFLAGS=-Os -Wall -I /usr/include/lua5.1
+-LDFLAGS=-llua5.1 -lpthread
++LDFLAGS=-llua -lpthread
+ LDFLAGS_UDEB=-lpthread -lm -ldl
+ SOURCES=qcontrol.c ts209.c ts219.c ts409.c ts41x.c evdev.c
+ OBJECTS=$(SOURCES:.c=.o)
+@@ -8,10 +7,10 @@
+ all: $(SOURCES) $(EXECUTABLE) qcontrol.udeb
+
+ $(EXECUTABLE): $(OBJECTS)
+- $(CC) $(LDFLAGS) $(OBJECTS) -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) -o $@
+
+ qcontrol.udeb: $(OBJECTS)
+- $(CC) $(LDFLAGS_UDEB) $(OBJECTS) /usr/lib/liblua5.1.a -o $@
++ $(CC) $(CFLAGS) $(LDFLAGS_UDEB) $(OBJECTS) /usr/lib/liblua.a -o $@
+
+ .cpp.o:
+ $(CC) $(CFLAGS) $< -o $@
diff --git a/sys-apps/qcontrol/files/conf.d b/sys-apps/qcontrol/files/conf.d
new file mode 100644
index 000000000000..6a732c48e2ff
--- /dev/null
+++ b/sys-apps/qcontrol/files/conf.d
@@ -0,0 +1,5 @@
+# /etc/conf.d/qcontrol: config file for /etc/init.d/qcontrol
+
+# Set to "no" to suppress the sounding of the buzzer
+#SOUND_BUZZER=no
+
diff --git a/sys-apps/qcontrol/files/init.d b/sys-apps/qcontrol/files/init.d
new file mode 100644
index 000000000000..1a2ea38eb4d4
--- /dev/null
+++ b/sys-apps/qcontrol/files/init.d
@@ -0,0 +1,74 @@
+#!/sbin/openrc-run
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# Header: $
+
+# Init script from Debian
+
+depend() {
+ after local
+}
+
+start() {
+ einfo "System boot completed"
+ if [ ! -c /dev/input/by-path/platform-gpio-keys-event- ]; then
+ eerror "qcontrol error: gpio_keys device not available"
+ return 1
+ fi
+ start-stop-daemon --start --quiet --background --pidfile /var/run/qcontrol.pid --make-pidfile --exec /usr/sbin/qcontrol -- -d
+ # Change status led to show green
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209" | "QNAP TS-119/TS-219")
+ qcontrol statusled greenon || true
+ qcontrol powerled on || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ "QNAP TS-409" | "QNAP TS-41x")
+ qcontrol statusled greenon || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ *)
+ eerror "qcontrol error: device is not supported"
+ ;;
+ esac
+ start-stop-daemon --stop --quiet --pidfile /var/run/qcontrol.pid --name qcontrol
+ rm /var/run/qcontrol.sock
+}
+
+stop() {
+ einfo "Shutting down system"
+ if [ ! -c /dev/input/by-path/platform-gpio-keys-event- ]; then
+ eerror "qcontrol error: gpio_keys device not available"
+ return 1
+ fi
+ start-stop-daemon --start --quiet --background --pidfile /var/run/qcontrol.pid --make-pidfile --exec /usr/sbin/qcontrol -- -d
+ # Change status led to show red
+ device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
+ head -n1 | sed "s/^[^:]*: //")
+ case $device in
+ "QNAP TS-109/TS-209" | "QNAP TS-119/TS-219")
+ qcontrol statusled rednon || true
+ qcontrol powerled 1hz || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ "QNAP TS-409" | "QNAP TS-41x")
+ qcontrol statusled redon || true
+ if [ "$SOUND_BUZZER" != no ]; then
+ qcontrol buzzer short || true
+ fi
+ ;;
+ *)
+ eerror "qcontrol error: device is not supported"
+ ;;
+ esac
+ start-stop-daemon --stop --quiet --pidfile /var/run/qcontrol.pid --name qcontrol
+ rm /var/run/qcontrol.sock
+}
diff --git a/sys-apps/qcontrol/metadata.xml b/sys-apps/qcontrol/metadata.xml
new file mode 100644
index 000000000000..fae618337e50
--- /dev/null
+++ b/sys-apps/qcontrol/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>arm@gentoo.org</email>
+ <name>Gentoo Linux ARM Development</name>
+</maintainer>
+<maintainer type="project">
+ <email>embedded@gentoo.org</email>
+ <name>Embedded Gentoo</name>
+</maintainer>
+</pkgmetadata>
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..bdda8dda130e
--- /dev/null
+++ b/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+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
+}