summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-apps/qcontrol
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-apps/qcontrol')
-rw-r--r--sys-apps/qcontrol/Manifest2
-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.xml9
-rw-r--r--sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild62
6 files changed, 174 insertions, 0 deletions
diff --git a/sys-apps/qcontrol/Manifest b/sys-apps/qcontrol/Manifest
new file mode 100644
index 000000000000..f4e853a15345
--- /dev/null
+++ b/sys-apps/qcontrol/Manifest
@@ -0,0 +1,2 @@
+DIST qcontrol_0.4.2-6.diff.gz 11426 RMD160 a5fbfffb13b123a5bceff57ad5065910ab287b5a SHA1 c8a4828fd987b66ba09758b2b72a5db2c7571b6d SHA256 11d45cebfe217a8bc0a0dbfc641fc098510c4b521cc83b993bd1fd493b834625
+DIST qcontrol_0.4.2.orig.tar.gz 18344 RMD160 511de9ca71df47c8004c345483f2114911b73637 SHA1 942027d7f26da368fa1f34b0bd4fecffa808b211 SHA256 efe7311cdd460a51475d22f737540e7bb3c4303e5eba97b782d765c8f1e67055
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..ce2a6493d03f
--- /dev/null
+++ b/sys-apps/qcontrol/files/init.d
@@ -0,0 +1,74 @@
+#!/sbin/runscript
+# 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..56901798a2dd
--- /dev/null
+++ b/sys-apps/qcontrol/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>arm</herd>
+<herd>embedded</herd>
+<maintainer>
+ <email>armin76@gentoo.org</email>
+</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..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
+}