[packages/yard2tools] - new
qboosh
qboosh at pld-linux.org
Wed Feb 14 22:09:05 CET 2018
commit d2ab6481c29537a5bc387e2183f2f8e0e4cd2a76
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Wed Feb 14 22:11:17 2018 +0100
- new
yard2tools-lirc.patch | 29 +++++
yard2tools-lircd_094.patch | 278 +++++++++++++++++++++++++++++++++++++++++++++
yard2tools.spec | 116 +++++++++++++++++++
3 files changed, 423 insertions(+)
---
diff --git a/yard2tools.spec b/yard2tools.spec
new file mode 100644
index 0000000..b77bef0
--- /dev/null
+++ b/yard2tools.spec
@@ -0,0 +1,116 @@
+#
+# Conditional build:
+%bcond_without lirc # LIRC driver
+#
+Summary: Infra-red remote control support for Y.A.R.D.2 hardware
+Summary(pl.UTF-8): Obsługa pilotów na podczerwień Y.A.R.D.2
+Name: yard2tools
+Version: 1.2.5
+Release: 1
+License: GPL v2+
+Group: Applications/System
+Source0: https://launchpad.net/~yard2team/+archive/ubuntu/test/+files/%{name}_%{version}.orig.tar.gz
+# Source0-md5: 91427839a1aad9bab65a163b1cbec951
+# from git://git.assembla.com/yard2srvd.git (master on 20171026)
+Patch0: %{name}-lircd_094.patch
+Patch1: %{name}-lirc.patch
+URL: https://app.assembla.com/spaces/yard2srvd/git/source
+BuildRequires: libbsd-devel
+BuildRequires: libusb-compat-devel
+%{?with_lirc:BuildRequires: lirc-devel >= 0.9.4}
+BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+This package provides the daemon and some utilities to support
+infra-red remote controls with the Y.A.R.D.2 type of hardware under
+Linux.
+
+%description -l pl.UTF-8
+Ten pakiet zawiera demona i narzędzia do obsługi pilotów na
+podczerwień typu Y.A.R.D.2 pod Linuksem.
+
+%package vdr
+Summary: Infra-red remote control support for Y.A.R.D.2 hardware in VDR
+Summary(pl.UTF-8): Obsługa pilotów na podczerwień Y.A.R.D.2 w programie VDR
+Group: Applications
+Requires: %{name} = %{version}-%{release}
+Requires: vdr
+
+%description vdr
+Infra-red remote control support for Y.A.R.D.2 hardware in VDR.
+
+%description vdr -l pl.UTF-8
+Obsługa pilotów na podczerwień Y.A.R.D.2 w programie VDR.
+
+%package -n lirc-plugin-yard2
+Summary: Y.A.R.D.2 driver for LIRC
+Summary(pl.UTF-8): Sterownik do sprzętu Y.A.R.D.2 dla LIRC-a
+Group: Libraries
+Requires: lirc >= 0.9.4
+
+%description -n lirc-plugin-yard2
+Y.A.R.D.2 driver for LIRC.
+
+%description -n lirc-plugin-yard2 -l pl.UTF-8
+Sterownik do sprzętu Y.A.R.D.2 dla LIRC-a.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+
+%{__rm} inih/extra/*.a
+
+%build
+%configure
+%{__make}
+
+%if %{with lirc}
+%{__make} -C lirc/lircd_094 \
+ CC="%{__cc}" \
+ CFLAGS="%{rpmcflags} -fPIC" \
+ LDFLAGS="%{rpmldflags}"
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+ DESTDIR=$RPM_BUILD_ROOT
+
+%if %{with lirc}
+%{__make} -C lirc/lircd_094 install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(644,root,root,755)
+%doc Readme.txt ChangeLog
+%attr(755,root,root) %{_bindir}/lirctest
+%attr(755,root,root) %{_bindir}/yard2config
+%attr(755,root,root) %{_bindir}/yard2flash
+%attr(755,root,root) %{_bindir}/yard2lcdtest
+%attr(755,root,root) %{_bindir}/yard2record
+%attr(755,root,root) %{_bindir}/yard2srvd
+%attr(755,root,root) %{_bindir}/yard2wakeup
+%dir %{_sysconfdir}/yard2
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/yard2/yard2tools.cfg
+%{systemdunitdir}/yard2.service
+/lib/udev/rules.d/60-usb-yard2.rules
+
+%files vdr
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/vdr/vdr-addon-yard2wakeup.conf
+%dir %{_datadir}/vdr
+%dir %{_datadir}/vdr/shutdown-hooks
+%{_datadir}/vdr/shutdown-hooks/S90.yard2-wakeup
+
+%if %{with lirc}
+%files -n lirc-plugin-yard2
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/lirc/plugins/yard2.so
+%{_datadir}/lirc/configs/yard2.conf
+%endif
diff --git a/yard2tools-lirc.patch b/yard2tools-lirc.patch
new file mode 100644
index 0000000..38d904d
--- /dev/null
+++ b/yard2tools-lirc.patch
@@ -0,0 +1,29 @@
+--- yard2tools-1.2.5/lirc/lircd_094/Makefile.orig 2018-02-13 18:45:03.058497511 +0100
++++ yard2tools-1.2.5/lirc/lircd_094/Makefile 2018-02-13 21:50:11.445037342 +0100
+@@ -18,18 +18,19 @@
+ CONFIGDIR ?= $(shell pkg-config --variable=configdir lirc-driver)
+ PLUGINDOCS ?= $(shell pkg-config --variable=plugindocs lirc-driver)
+
+-include $(PLUGINDOCS)/plugindocs.mk
+-
+ $(driver).o: $(driver).c
+
+ $(driver).so: $(driver).o
+- gcc --shared -fpic $(LDFLAGS) -o $@ $<
++ $(CC) --shared -fPIC $(LDFLAGS) -o $@ $<
+
+ install: $(driver).so
+- install $< $(PLUGINDIR)
+- install $(driver).conf $(CONFIGDIR)
+- install $(driver).html $(PLUGINDOCS)
+- $(MAKE) update
++ install -d $(DESTDIR)$(PLUGINDIR) $(DESTDIR)$(CONFIGDIR) $(DESTDIR)$(PLUGINDOCS)
++ install $< $(DESTDIR)$(PLUGINDIR)
++ install $(driver).conf $(DESTDIR)$(CONFIGDIR)
++ -install $(driver).html $(DESTDIR)$(PLUGINDOCS)
++
++post-install-doc:
++ $(MAKE) -C $(PLUGINDOCS) update
+
+ clean:
+ rm -f *.o *.so
diff --git a/yard2tools-lircd_094.patch b/yard2tools-lircd_094.patch
new file mode 100644
index 0000000..4bed835
--- /dev/null
+++ b/yard2tools-lircd_094.patch
@@ -0,0 +1,278 @@
+--- yard2srvd/lirc/lircd_094.orig/Makefile 1970-01-01 01:00:00.000000000 +0100
++++ yard2srvd/lirc/lircd_094/Makefile 2018-02-12 18:11:05.472840644 +0100
+@@ -0,0 +1,35 @@
++#
++# Template for building a lirc userspace driver out of tree.
++# Requires that lirc is installed in system locations, in
++# particular that the /usr/lib[64]/pkgconfig/lirc-driver.pc
++# is in place (/usr/local/lib/pkgconfig/... is also OK).
++# The required file plugindocs.mk might live in a -doc
++# package which then is needed.
++#
++
++
++driver = yard2
++
++all: $(driver).so
++
++CFLAGS += $(shell pkg-config --cflags lirc-driver)
++LDFLAGS += $(shell pkg-config --libs lirc-driver)
++PLUGINDIR ?= $(shell pkg-config --variable=plugindir lirc-driver)
++CONFIGDIR ?= $(shell pkg-config --variable=configdir lirc-driver)
++PLUGINDOCS ?= $(shell pkg-config --variable=plugindocs lirc-driver)
++
++include $(PLUGINDOCS)/plugindocs.mk
++
++$(driver).o: $(driver).c
++
++$(driver).so: $(driver).o
++ gcc --shared -fpic $(LDFLAGS) -o $@ $<
++
++install: $(driver).so
++ install $< $(PLUGINDIR)
++ install $(driver).conf $(CONFIGDIR)
++ install $(driver).html $(PLUGINDOCS)
++ $(MAKE) update
++
++clean:
++ rm -f *.o *.so
+--- yard2srvd/lirc/lircd_094.orig/yard2.c 1970-01-01 01:00:00.000000000 +0100
++++ yard2srvd/lirc/lircd_094/yard2.c 2018-02-12 18:11:05.472840644 +0100
+@@ -0,0 +1,216 @@
++/***************************************************************************
++* Copyright (C) 2009 by M. Feser *
++* Modified to work with Y.A.R.D.2 USB *
++* (c) Copyright 2012 R. Geigenberger / Frank Kohlmann *
++* *
++* This driver is for YARD2 USB IR Receiver *
++* *
++* This program is free software; you can redistribute it and/or modify *
++* it under the terms of the GNU General Public License as published by *
++* the Free Software Foundation; either version 2 of the License, or *
++* (at your option) any later version. *
++* *
++* This program is distributed in the hope that it will be useful, *
++* but WITHOUT ANY WARRANTY; without even the implied warranty of *
++* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
++* GNU General Public License for more details. *
++* *
++* You should have received a copy of the GNU General Public License *
++* along with this program; if not, write to the *
++* Free Software Foundation, Inc., *
++* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
++***************************************************************************/
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <errno.h>
++#include <fcntl.h>
++#include <unistd.h>
++#include <limits.h>
++#include <signal.h>
++#include <sys/socket.h>
++#include <sys/un.h>
++#include <sys/stat.h>
++#include <sys/types.h>
++#include <sys/ioctl.h>
++
++#include "lirc_driver.h"
++
++#ifndef MSG_NOSIGNAL
++// MSG_NOSIGNAL is not defined in MacOSX. (Is this even needed
++// since lircd.c sets SIGPIPE to SIG_IGN?)
++#define MSG_NOSIGNAL 0
++#endif
++
++/* Defines */
++#define YARDSRV_SOCK_PATH "/tmp/yardsrv_sock"
++#define SRVCMD_IRREG 0xEE
++#define SRVCMD_IRUNREG 0xDD
++#define SRVRES_SUCCESS 0x00
++#define SRVRES_ERROR 0xFF
++#define IRCODE_NUM_BYTES 6
++#define IRCODE_NUM_BITS (IRCODE_NUM_BYTES * 8)
++
++#define SYS_IR_REC 0x80
++#define SYS_IR_SEND 0x81
++
++#define YARD2_URL "https://www.assembla.com/code/yard2srvd/git/nodes"
++
++static const logchannel_t logchannel = LOG_DRIVER;
++
++typedef unsigned char YARD_IRCODE[6];
++
++/* Variables */
++static struct timeval start, end, last;
++static ir_code code; //64bit int
++
++/* Export function */
++static int yard2_decode(struct ir_remote* remote, struct decode_ctx_t* ctx);
++static int yard2_init(void);
++static int yard2_deinit(void);
++static char* yard2_rec(struct ir_remote* remotes);
++static int yard2_send(struct ir_remote* remote, struct ir_ncode* icode);
++
++const struct driver hw_yard2 = {
++ .name = "yard2",
++ .device = "",
++ .features = LIRC_CAN_REC_LIRCCODE | LIRC_CAN_SEND_LIRCCODE,
++ .send_mode = LIRC_MODE_PULSE,
++ .rec_mode = LIRC_MODE_LIRCCODE,
++ .code_length = IRCODE_NUM_BYTES,
++ .init_func = yard2_init,
++ .deinit_func = yard2_deinit,
++ .send_func = yard2_send,
++ .rec_func = yard2_rec,
++ .decode_func = yard2_decode,
++ .drvctl_func = default_drvctl,
++ .readdata = NULL,
++ .api_version = 3,
++ .driver_version = "0.9.3",
++ .open_func = default_open,
++ .close_func = default_close,
++ .driver_version = "0.9.3",
++ .info = "Driver for the yard2 DIY assembly kit." \
++ "See: " YARD2_URL,
++ .device_hint = "/tmp/yardsrv_sock",
++};
++const struct driver* hardwares[] = { &hw_yard2, (const struct driver*)NULL };
++
++/* Implementation */
++
++static int yard2_decode(struct ir_remote* remote, struct decode_ctx_t* ctx)
++{
++ if (!map_code(remote, ctx, 0, 0, IRCODE_NUM_BITS, code, 0, 0))
++ return 0;
++ map_gap(remote, ctx, &start, &last, 0); // FIXME: Check 0 vs signal_length
++ return 1;
++}
++
++static int yard2_init(void)
++{
++ struct sockaddr_un srvAddr;
++ int srvAddrLen;
++
++ // Establish connection to YARD server
++ bzero((char*)&srvAddr, sizeof(srvAddr));
++ srvAddr.sun_family = AF_UNIX;
++ strcpy(srvAddr.sun_path, YARDSRV_SOCK_PATH);
++ srvAddrLen = strlen(srvAddr.sun_path) + sizeof(srvAddr.sun_family);
++
++ drv.fd = socket(AF_UNIX, SOCK_STREAM, 0);
++ if (drv.fd < 0) {
++ log_error("yard2: Can't create socket !");
++ return 0;
++ }
++
++ if (connect(drv.fd, (struct sockaddr*)&srvAddr, srvAddrLen) < 0) {
++ log_error("yard2: Can't connect to yardsrv !");
++ return 0;
++ }
++
++/* not used in yard2
++ * // Register IR code notification
++ * if ( !yard_sendSrvCmd(SRVCMD_IRREG) )
++ * {
++ * log_error("yard2: Can't register IR code notification !");
++ * return 0;
++ * }
++ */
++ return 1;
++}
++
++static int yard2_deinit(void)
++{
++ // Unregister IR code notification
++ // not used in yard2 yard_sendSrvCmd(SRVCMD_IRUNREG);
++
++ close(drv.fd);
++ drv.fd = -1;
++ return 1;
++}
++
++static int yard2_send(struct ir_remote* remote, struct ir_ncode* icode)
++{
++ unsigned long long sendir;
++ unsigned char buffer[8];
++
++ //Error check
++ if (drv.fd < 0)
++ return 0;
++
++ sendir = icode->code;
++ log_trace("SEND IR-Code: %llx", sendir);
++
++ buffer[0] = 0x81; //Send IR command ID
++ buffer[1] = 255 - buffer[0];
++ // example 0715000c0000
++ buffer[2] = (sendir & 0x0000FF0000000000) >> 40;
++ buffer[3] = (sendir & 0x000000FF00000000) >> 32;
++ buffer[4] = (sendir & 0x00000000FF000000) >> 24;
++ buffer[5] = (sendir & 0x0000000000FF0000) >> 16;
++ buffer[6] = (sendir & 0x000000000000FF00) >> 8;
++ buffer[7] = (sendir & 0x00000000000000FF);
++
++ send(drv.fd, buffer, 8, MSG_NOSIGNAL);
++ return 1;
++}
++
++static char* yard2_rec(struct ir_remote* remotes)
++{
++ YARD_IRCODE yardIrCode;
++ char* m;
++ int byteCnt;
++ int i;
++
++ // Error check
++ if (drv.fd < 0)
++ return 0;
++
++ last = end;
++ gettimeofday(&start, NULL);
++
++ // Receive IR code from YARD server
++ byteCnt = read(drv.fd,
++ (unsigned char*)&yardIrCode, sizeof(YARD_IRCODE));
++ log_trace("yard2: received %d bytes !", byteCnt);
++ if (byteCnt < sizeof(YARD_IRCODE)) {
++ log_error("yard2: Expected %d bytes - received %d bytes !",
++ sizeof(YARD_IRCODE), byteCnt);
++ return NULL;
++ }
++
++ gettimeofday(&end, NULL);
++
++ // Extract IR code bytes
++ code = 0;
++ for (i = 0; i < IRCODE_NUM_BYTES; i++) {
++ code <<= 8;
++ code |= yardIrCode[i]; //.abIrData[i]; //
++ }
++ log_trace("Receive IR-Code: %llx", (unsigned long long)code);
++ m = decode_all(remotes);
++ return m;
++}
+--- yard2srvd/lirc/lircd_094.orig/yard2.conf 1970-01-01 01:00:00.000000000 +0100
++++ yard2srvd/lirc/lircd_094/yard2.conf 2018-02-12 18:11:05.472840644 +0100
+@@ -0,0 +1,18 @@
++# This is a lirc configuration for a capture device.
++# See README for more.
++
++config:
++ driver: yard2
++ id: yard2
++ label: YARD2 USB IR Receiver
++ menu: usb
++ lircd_conf: yard2/lircd.conf.yard2
++ supports: lirccode
++ product_driver: 04d8:f57f
++ note: This device supports multiple IR protocols RC5, RC6, ...
++ and can be used with almost all remote controls.
++ It's a DIY assembly kit.
++
++ You need to install the yard2srvd daemon
++ https://www.assembla.com/code/yard2srvd/git/nodes
++ For more information read Readme.txt of yard2srvd
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/yard2tools.git/commitdiff/d2ab6481c29537a5bc387e2183f2f8e0e4cd2a76
More information about the pld-cvs-commit
mailing list