sispmctl: Add utility to control the power outlet strip

Fixes: SYS#1134
This commit is contained in:
Holger Hans Peter Freyther 2015-02-15 00:41:02 +01:00
parent 846cc6b9ab
commit ba75c10df7
2 changed files with 62 additions and 0 deletions

View File

@ -0,0 +1,47 @@
Index: sispmctl-3.1/configure.in
===================================================================
--- sispmctl-3.1.orig/configure.in
+++ sispmctl-3.1/configure.in
@@ -25,29 +25,7 @@ AC_SUBST(BINDADDR)
# Checks for libraries.
-dnl check for libusb-config
-AC_PATH_PROG(HAVELIBUSB, libusb-config, $PATH)
-
-if test -e "$HAVELIBUSB"; then
- dnl LIBUSB_CFLAGS=`$HAVELIBUSB --cflags`
- LIBUSB_LIBS=`$HAVELIBUSB --libs`
- CFLAGS="$CFLAGS $LIBUSB_CFLAGS"
- LIBS="$LIBS $LIBUSB_LIBS"
-else
- AC_MSG_ERROR([*** libusb-config not found. You need a working libusb installation. Version >=0.1.7])
-fi
-
-dnl check for version of libusb
-AC_MSG_CHECKING([if libusb version is >= 0.1.9])
-libusb_version_needed="1009"
-libusb_version=`$HAVELIBUSB --version | sed -e "s/libusb //" | awk 'BEGIN { FS = "."; } { printf "%d", ($''1 * 1000 + $''2) * 1000 + $''3;}'`
-
-if test $libusb_version -lt $libusb_version_needed; then
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([*** libusb is too old ($libusb_version). You need a libusb installation newer or equal to 0.1.9.])
-else
- AC_MSG_RESULT(yes)
-fi
+PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.9)
# Checks for header files.
AC_HEADER_STDC
Index: sispmctl-3.1/src/Makefile.am
===================================================================
--- sispmctl-3.1.orig/src/Makefile.am
+++ sispmctl-3.1/src/Makefile.am
@@ -4,6 +4,7 @@ EXTRA_DIST = web1/index.html web1/off1.
web2/index.html web2/off1.html web2/off3.html web2/on1.html web2/on3.html web2/style.css web2/logo.png web2/off2.html web2/off4.html web2/on2.html web2/on4.html web2/off.gif web2/on.gif web2/onoff.gif\
sispmctl.1
+sispmctl_LDADD = $(LIBUSB_LIBS)
if WEBLESSCOND
AM_CFLAGS=-Wall -DWEBLESS=@WEBLESS@

View File

@ -0,0 +1,15 @@
SUMMARY = "Control power outlet strip using USB"
LICENSE = "GPLv2+"
LIC_FILES_CHKSUM = "file://LICENCE;md5=393a5ca445f6965873eca0259a17f833"
SRC_URI = "${SOURCEFORGE_MIRROR}/${PN}/${PN}-${PV}.tar.gz \
file://modernize.patch"
SRC_URI[md5sum] = "24693cae30d77c957f34cfb2c8159661"
SRC_URI[sha256sum] = "e9a99cc81ef0a93f3484e5093efd14d93cc967221fcd22c151f0bea32eb91da7"
EXTRA_OECONF = "--enable-webless"
DEPENDS = "libusb pkgconfig"
inherit autotools