diff options
| author | root <root@alpha.trunkmasters.com> | 2026-06-04 16:47:34 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-06-04 16:47:34 -0500 |
| commit | dda948891d3731927b821ce31f9d9a2d03ba20c5 (patch) | |
| tree | 99cd40be4cbb0606260da212cd81b8ab2db9da9b /sys-apps/qcontrol | |
| parent | a3ceca1b4c0d9bdb550dc23f06ffbb5a8e033bc7 (diff) | |
| download | baldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.tar.gz baldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.tar.xz baldeagleos-repo-dda948891d3731927b821ce31f9d9a2d03ba20c5.zip | |
Adding metadata
Diffstat (limited to 'sys-apps/qcontrol')
| -rw-r--r-- | sys-apps/qcontrol/Manifest | 2 | ||||
| -rw-r--r-- | sys-apps/qcontrol/files/0.4.2-Makefile.patch | 22 | ||||
| -rw-r--r-- | sys-apps/qcontrol/files/conf.d | 5 | ||||
| -rw-r--r-- | sys-apps/qcontrol/files/init.d | 74 | ||||
| -rw-r--r-- | sys-apps/qcontrol/metadata.xml | 13 | ||||
| -rw-r--r-- | sys-apps/qcontrol/qcontrol-0.4.2-r101.ebuild | 68 |
6 files changed, 184 insertions, 0 deletions
diff --git a/sys-apps/qcontrol/Manifest b/sys-apps/qcontrol/Manifest new file mode 100644 index 000000000000..857c0d47b3d7 --- /dev/null +++ b/sys-apps/qcontrol/Manifest @@ -0,0 +1,2 @@ +DIST qcontrol_0.4.2-6.diff.gz 11426 BLAKE2B 5f4374d2a6a2f79ca357827437d7ec42c6122b8f3ba008bb8c39adaf80a2edff24ed4f0abb29780ad70cac09eb1d39124d3d9762d603c896c8857ad7b8e7910e SHA512 ce450d04c72052c8e7ce0bf26d21d9942d3ea02b958b510efdf26d368ee69778eaf61bec2084c4d21cc1a5d281d1331e40b7bcaf388b4b59174a37ed037dd984 +DIST qcontrol_0.4.2.orig.tar.gz 18344 BLAKE2B c90d3d31ffd624bad11e70a2c700e0e058c9fa6cc2cfa6bb803471df67d07d03a88ae134d5543dbbefe30b5870089a29151614a545dc171de5eb4732d6592461 SHA512 f132faff54833f11ae79622dc8e33b4e0f2516f7377633ff47a4ebe71335503c5e4892723c049b00888622ce059026cd97c6856b425b94163ec09887bd21e81e 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..501e8321fc52 --- /dev/null +++ b/sys-apps/qcontrol/files/0.4.2-Makefile.patch @@ -0,0 +1,22 @@ +--- a/Makefile 2011-04-02 20:44:05.021252507 +0200 ++++ b/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..df86e4f5d14a --- /dev/null +++ b/sys-apps/qcontrol/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://docs.baldeagleos.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>arm@gentoo.org</email> + <name>ARM architecture team</name> + </maintainer> + <maintainer type="project"> + <email>embedded@gentoo.org</email> + <name>Embedded Gentoo</name> + </maintainer> + <origin>baldeagleos-repo</origin> +</pkgmetadata> diff --git a/sys-apps/qcontrol/qcontrol-0.4.2-r101.ebuild b/sys-apps/qcontrol/qcontrol-0.4.2-r101.ebuild new file mode 100644 index 000000000000..d9118f4147d5 --- /dev/null +++ b/sys-apps/qcontrol/qcontrol-0.4.2-r101.ebuild @@ -0,0 +1,68 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LUA_COMPAT=( lua5-{1,3,4} luajit ) + +inherit lua-single toolchain-funcs + +DESCRIPTION="Send commands to some microcontrollers, e.g., 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" + +REQUIRED_USE="${LUA_REQUIRED_USE}" + +DEPEND="${LUA_DEPS}" +RDEPEND="${DEPEND}" + +src_prepare() { + default + + eapply "${WORKDIR}"/*.diff + eapply debian/patches/*.patch + eapply "${FILESDIR}"/${PV}-Makefile.patch + + sed -i -e "s/LDFLAGS=/LDFLAGS ?=/" Makefile || die +} + +src_compile() { + emake \ + CC="$(tc-getCC)" \ + CFLAGS="$(lua_get_CFLAGS) ${CFLAGS}" \ + LDFLAGS="$(lua_get_LIBS) -lpthread ${LDFLAGS}" \ + qcontrol +} + +src_install() { + dosbin qcontrol + doman debian/qcontrol.1 + + insinto /etc/qcontrol + doins debian/configs/*.lua + + newconfd "${FILESDIR}"/conf.d qcontrol + newinitd "${FILESDIR}"/init.d qcontrol +} + +pkg_preinst() { + device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \ + head -n1 | sed "s/^[^:]*: //") + case ${device} in + "QNAP TS-109/TS-209") + dosym qcontrol/ts209.lua /etc/qcontrol.conf ;; + "QNAP TS-119/TS-219") + dosym qcontrol/ts219.lua /etc/qcontrol.conf ;; + "QNAP TS-409") + dosym qcontrol/ts409.lua /etc/qcontrol.conf ;; + "QNAP TS-41x") + dosym qcontrol/ts41x.lua /etc/qcontrol.conf ;; + *) + ewarn "Your device is unsupported" ;; + esac +} |
