summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaúl Porcel <armin76@gentoo.org>2011-04-02 19:28:54 +0000
committerRaúl Porcel <armin76@gentoo.org>2011-04-02 19:28:54 +0000
commita5d5753672ef3095c65a892cd687a911745466bc (patch)
tree65b2ba8cf137b10d6e67ceb13183284d52c245b2 /sys-apps
parentDelete older ebuilds. (diff)
downloadgentoo-2-a5d5753672ef3095c65a892cd687a911745466bc.tar.gz
gentoo-2-a5d5753672ef3095c65a892cd687a911745466bc.tar.bz2
gentoo-2-a5d5753672ef3095c65a892cd687a911745466bc.zip
Use debian patchset, rework ebuild a bit, bug #336245
(Portage version: 2.1.9.42/cvs/Linux i686, RepoMan options: --force)
Diffstat (limited to 'sys-apps')
-rw-r--r--sys-apps/qcontrol/ChangeLog11
-rw-r--r--sys-apps/qcontrol/files/0.4.2-Makefile.patch23
-rw-r--r--sys-apps/qcontrol/files/init.d10
-rw-r--r--sys-apps/qcontrol/files/qcontrol.1121
-rw-r--r--sys-apps/qcontrol/files/ts209.lua41
-rw-r--r--sys-apps/qcontrol/files/ts409.lua39
-rw-r--r--sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild (renamed from sys-apps/qcontrol/qcontrol-0.4.2.ebuild)32
7 files changed, 54 insertions, 223 deletions
diff --git a/sys-apps/qcontrol/ChangeLog b/sys-apps/qcontrol/ChangeLog
index cb81a90c7a83..348c279256a7 100644
--- a/sys-apps/qcontrol/ChangeLog
+++ b/sys-apps/qcontrol/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sys-apps/qcontrol
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/qcontrol/ChangeLog,v 1.3 2009/06/11 17:46:33 armin76 Exp $
+# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/qcontrol/ChangeLog,v 1.4 2011/04/02 19:28:53 armin76 Exp $
+
+*qcontrol-0.4.2-r1 (02 Apr 2011)
+
+ 02 Apr 2011; Raúl Porcel <armin76@gentoo.org> files/0.4.2-Makefile.patch,
+ files/init.d, -files/qcontrol.1, -files/ts209.lua, -files/ts409.lua,
+ -qcontrol-0.4.2.ebuild, +qcontrol-0.4.2-r1.ebuild:
+ Use debian patchset, rework ebuild a bit, bug #336245
11 Jun 2009; Raúl Porcel <armin76@gentoo.org> files/0.4.2-Makefile.patch:
Add -ldl to LDFLAGS
diff --git a/sys-apps/qcontrol/files/0.4.2-Makefile.patch b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
index 1b6846c80679..ad3701c549eb 100644
--- a/sys-apps/qcontrol/files/0.4.2-Makefile.patch
+++ b/sys-apps/qcontrol/files/0.4.2-Makefile.patch
@@ -1,9 +1,22 @@
---- Makefile.orig 2008-11-23 12:44:33.000000000 +0000
-+++ Makefile 2008-11-23 12:45:35.000000000 +0000
+--- 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 -ldl
- SOURCES=qcontrol.c ts209.c ts409.c evdev.c
++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)
- EXECUTABLE=qcontrol
+@@ -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/init.d b/sys-apps/qcontrol/files/init.d
index ba8153873a80..ce2a6493d03f 100644
--- a/sys-apps/qcontrol/files/init.d
+++ b/sys-apps/qcontrol/files/init.d
@@ -1,5 +1,5 @@
#!/sbin/runscript
-# Copyright 1999-2008 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# Header: $
@@ -20,14 +20,14 @@ start() {
device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
head -n1 | sed "s/^[^:]*: //")
case $device in
- "QNAP TS-109/TS-209")
+ "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-409" | "QNAP TS-41x")
qcontrol statusled greenon || true
if [ "$SOUND_BUZZER" != no ]; then
qcontrol buzzer short || true
@@ -52,14 +52,14 @@ stop() {
device=$(grep "Hardware[[:space:]]*:" /proc/cpuinfo 2>/dev/null | \
head -n1 | sed "s/^[^:]*: //")
case $device in
- "QNAP TS-109/TS-209")
+ "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-409" | "QNAP TS-41x")
qcontrol statusled redon || true
if [ "$SOUND_BUZZER" != no ]; then
qcontrol buzzer short || true
diff --git a/sys-apps/qcontrol/files/qcontrol.1 b/sys-apps/qcontrol/files/qcontrol.1
deleted file mode 100644
index 81538348efcd..000000000000
--- a/sys-apps/qcontrol/files/qcontrol.1
+++ /dev/null
@@ -1,121 +0,0 @@
-.TH QCONTROL 1 "2008-08-10" "Debian Project" ""
-
-.SH NAME
-qcontrol \- Hardware control for QNAP TS-109, TS-209 and TS-409
-
-.SH SYNOPSIS
-\fBqcontrol\fB -d
-.PP
-\fBqcontrol\fB \fIcommand\fP \fIvalue\fP
-
-.SH DESCRIPTION
-The utility can be used to control leds or fan speed, or sound the buzzer.
-As a daemon it can monitor the device for example for button presses or
-temperature values and trigger actions defined in the LUA configuration
-file, for example to power off the system or to modify the fan speed.
-.PP
-Note: the current version does not have a real daemon mode. Caution is
-therefore advised when using qcontrol as a real daemon to monitor and
-control a device.
-.PP
-Currently supported devices are the QNAP TS-109, QNAP TS-209 and QNAP
-TS-409, but support for additional devices may be added in future releases.
-
-.SH BASIC USAGE
-First a control process needs to be started that opens a socket through
-which the actual commands can be passed. The control proces is be started
-using the \fB\-d\fP option:
- # qcontrol \-d
-.PP
-Or, to start the control process in a pseudo daemon mode:
- # qcontrol \-d >/dev/null & disown
-.PP
-After that, the actual commands to control devices can be entered (if the
-first syntax to start the control process was used, this should be done
-from a separate console):
- # qcontrol <command> <value>
-.PP
-Because the socket file is created in /var/run, all commands must be run
-as root.
-
-.SH OPTIONS
-This program follows the usual GNU command line syntax, with long options
-starting with two dashes (`-').
-An overview of supported options is included below.
-
-.IP "\fB\-d\fP, \fB\-\-daemon\fP"
-Daemon mode; starts the control process.
-
-.IP "\fB\-?\fP, \fB\-\-help\fP"
-Print command help and info.
-
-.IP "\fB\-V\fP, \fB\-\-version\fP"
-Print program version.
-
-.SH SUPPORTED CLIENT COMMANDS
-Below an overview of the supported commands that can be sent using the
-program in client mode, and the allowed values for each.
-
-Commands (these and others) can also be programmed in response to events
-using the LUA configuration file.
-
-For the leds, values including `1hz' and `2hz' will result in the led
-flashing on/off in the default or specified color, with the `hz' value
-determining the speed of the flashes. In the case of `greenred', the led
-will alternate between green and red instead of on and off.
-
-.IP "\fBpowerled\fP"
-Controls the power led (not available on TS-409).
-
-Values: off | on | 1hz | 2hz
-
-.IP "\fBstatusled\fP"
-Controls the status led.
-
-Values:
- off | greenon | redon |
- green1hz | red1hz | greenred1hz |
- green2hz | red2hz | greenred2hz
-
-.IP "\fBusbled\fP"
-Controls the usb led.
-
-Values: off | on | 8hz
-
-.IP "\fBbuzzer\fP"
-Sounds the buzzer.
-
-Values: short | long
-
-.IP "\fBfanspeed\fP"
-Controls the speed of the fan (if present).
-
-Values: stop | silence | low | medium | high | full
-
-.SH KNOWN ISSUES
-After running the control process and killing it, the socket file will still
-exist. This will cause the following error when the control process is started
-again: `Error binding to socket: Address already in use'.
-.PP
-The solution is to remove the socket file and then try again:
- # rm /var/run/qcontrol.sock
-.PP
-The program is not yet very robust against errors in the configuration file.
-
-.SH FILES
-.IP \fB/etc/qcontrol.conf\fP
-LUA configuration file for qcontrol
-.IP \fB/etc/default/qcontrol\fP
-Configuration file for qcontrol init script
-.IP \fB/var/run/qcontrol.sock\fP
-Socket file for communication between daemon precess and client
-
-.SH SEE ALSO
-.IP \fB/usr/share/doc/qcontrol/examples\fP
-Example LUA configuration file containing more advanced commands
-
-.SH AUTHOR
-qcontrol was written by Byron Bradley <byron.bbradley@gmail.com>.
-.PP
-This manual page was written by Frans Pop <fjp@debian.org>
-for the Debian project (but may be used by others).
diff --git a/sys-apps/qcontrol/files/ts209.lua b/sys-apps/qcontrol/files/ts209.lua
deleted file mode 100644
index 87df1f325b21..000000000000
--- a/sys-apps/qcontrol/files/ts209.lua
+++ /dev/null
@@ -1,41 +0,0 @@
---[[
- Debian configuration file for qcontrol (LUA syntax)
- Supports both QNAP TS-109 and TS-209.
---]]
-
-register("ts209")
-
--- Requires CONFIG_KEYBOARD_GPIO enabled in the kernel and
--- the kernel module gpio_keys to be loaded.
-register("evdev", "/dev/input/by-path/platform-gpio-keys-event-",
- 408, "restart_button",
- 133, "media_button")
-
-function power_button( time )
- os.execute("poweroff")
-end
-
-function restart_button( time )
- os.execute("reboot")
-end
-
-function media_button( time )
- piccmd("usbled", "8hz")
-end
-
---[[
- Fan and temperature control are left disabled until qcontrol
- gets a proper daemon mode.
- Empty functions are needed to avoid errors.
---]]
-function fan_error( )
-end
-
-function fan_normal( )
-end
-
-function temp_low( )
-end
-
-function temp_high( )
-end
diff --git a/sys-apps/qcontrol/files/ts409.lua b/sys-apps/qcontrol/files/ts409.lua
deleted file mode 100644
index 7720f32673a6..000000000000
--- a/sys-apps/qcontrol/files/ts409.lua
+++ /dev/null
@@ -1,39 +0,0 @@
---[[
- Debian configuration file for qcontrol (LUA syntax)
- Supports QNAP TS-409.
---]]
-
-register("ts409")
-
--- Requires CONFIG_KEYBOARD_GPIO enabled in the kernel and
--- the kernel module gpio_keys to be loaded.
-register("evdev", "/dev/input/by-path/platform-gpio-keys-event-",
- 408, "restart_button",
- 133, "media_button")
-
-function power_button( time )
- os.execute("poweroff")
-end
-
-function restart_button( time )
- os.execute("reboot")
-end
-
-function media_button( time )
- piccmd("usbled", "8hz")
-end
-
---[[
- Fan and temperature control are left disabled until qcontrol
- gets a proper daemon mode.
- Empty functions are needed to avoid errors.
---]]
-function fan_error( )
-end
-
-function fan_normal( )
-end
-
-function temp( temp )
- print("ts409 temperature:", temp)
-end
diff --git a/sys-apps/qcontrol/qcontrol-0.4.2.ebuild b/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild
index 138de65fc67b..663ec6c59200 100644
--- a/sys-apps/qcontrol/qcontrol-0.4.2.ebuild
+++ b/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild
@@ -1,12 +1,13 @@
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/qcontrol/qcontrol-0.4.2.ebuild,v 1.2 2009/02/03 11:24:36 armin76 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/qcontrol/qcontrol-0.4.2-r1.ebuild,v 1.1 2011/04/02 19:28:53 armin76 Exp $
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="http://byronbradley.co.uk/piccontrol/${P}.tar.gz"
+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"
@@ -18,33 +19,44 @@ 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)" || die "emake failed"
+ emake CC="$(tc-getCC)" qcontrol || die "emake failed"
}
src_install() {
dosbin qcontrol
- doman "${FILESDIR}"/qcontrol.1
+ doman "${S}"/debian/qcontrol.1
insinto /etc/qcontrol
- doins "${FILESDIR}"/*.lua
+ 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 ;;
*)
- die "Your device is unsupported" ;;
+ ewarn "Your device is unsupported" ;;
esac
-
- newconfd "${FILESDIR}"/conf.d qcontrol
- newinitd "${FILESDIR}"/init.d qcontrol
}