]> git.pld-linux.org Git - packages/yard2tools.git/commitdiff
- new master auto/th/yard2tools-1.2.5-1
authorJakub Bogusz <qboosh@pld-linux.org>
Wed, 14 Feb 2018 21:11:17 +0000 (22:11 +0100)
committerJakub Bogusz <qboosh@pld-linux.org>
Wed, 14 Feb 2018 21:11:17 +0000 (22:11 +0100)
yard2tools-lirc.patch [new file with mode: 0644]
yard2tools-lircd_094.patch [new file with mode: 0644]
yard2tools.spec [new file with mode: 0644]

diff --git a/yard2tools-lirc.patch b/yard2tools-lirc.patch
new file mode 100644 (file)
index 0000000..38d904d
--- /dev/null
@@ -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 (file)
index 0000000..4bed835
--- /dev/null
@@ -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 @@
++/***************************************************************************\r
++*   Copyright (C) 2009 by M. Feser                                        *\r
++*   Modified to work with Y.A.R.D.2 USB                                   *\r
++*   (c) Copyright 2012 R. Geigenberger / Frank Kohlmann                   *\r
++*                                                                         *\r
++*   This driver is for YARD2 USB IR Receiver                              *\r
++*                                                                         *\r
++*   This program is free software; you can redistribute it and/or modify  *\r
++*   it under the terms of the GNU General Public License as published by  *\r
++*   the Free Software Foundation; either version 2 of the License, or     *\r
++*   (at your option) any later version.                                   *\r
++*                                                                         *\r
++*   This program is distributed in the hope that it will be useful,       *\r
++*   but WITHOUT ANY WARRANTY; without even the implied warranty of        *\r
++*   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
++*   GNU General Public License for more details.                          *\r
++*                                                                         *\r
++*   You should have received a copy of the GNU General Public License     *\r
++*   along with this program; if not, write to the                         *\r
++*   Free Software Foundation, Inc.,                                       *\r
++*   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
++***************************************************************************/\r
++#ifdef HAVE_CONFIG_H\r
++#include <config.h>\r
++#endif\r
++\r
++#include <stdio.h>\r
++#include <stdlib.h>\r
++#include <errno.h>\r
++#include <fcntl.h>\r
++#include <unistd.h>\r
++#include <limits.h>\r
++#include <signal.h>\r
++#include <sys/socket.h>\r
++#include <sys/un.h>\r
++#include <sys/stat.h>\r
++#include <sys/types.h>\r
++#include <sys/ioctl.h>\r
++\r
++#include "lirc_driver.h"\r
++\r
++#ifndef MSG_NOSIGNAL\r
++// MSG_NOSIGNAL is not defined in MacOSX. (Is this even needed\r
++// since    lircd.c sets SIGPIPE to SIG_IGN?)\r
++#define MSG_NOSIGNAL 0\r
++#endif\r
++\r
++/* Defines */\r
++#define YARDSRV_SOCK_PATH       "/tmp/yardsrv_sock"\r
++#define SRVCMD_IRREG            0xEE\r
++#define SRVCMD_IRUNREG          0xDD\r
++#define SRVRES_SUCCESS          0x00\r
++#define SRVRES_ERROR            0xFF\r
++#define IRCODE_NUM_BYTES        6\r
++#define IRCODE_NUM_BITS         (IRCODE_NUM_BYTES * 8)\r
++\r
++#define SYS_IR_REC       0x80\r
++#define SYS_IR_SEND  0x81\r
++\r
++#define YARD2_URL   "https://www.assembla.com/code/yard2srvd/git/nodes"\r
++\r
++static const logchannel_t logchannel = LOG_DRIVER;\r
++\r
++typedef unsigned char YARD_IRCODE[6];\r
++\r
++/* Variables */\r
++static struct timeval start, end, last;\r
++static ir_code code;            //64bit int\r
++\r
++/* Export function */\r
++static int yard2_decode(struct ir_remote* remote, struct decode_ctx_t* ctx);\r
++static int yard2_init(void);\r
++static int yard2_deinit(void);\r
++static char* yard2_rec(struct ir_remote* remotes);\r
++static int yard2_send(struct ir_remote* remote, struct ir_ncode* icode);\r
++\r
++const struct driver hw_yard2 = {\r
++      .name           = "yard2",\r
++      .device         = "",\r
++      .features       = LIRC_CAN_REC_LIRCCODE | LIRC_CAN_SEND_LIRCCODE,\r
++      .send_mode      = LIRC_MODE_PULSE,\r
++      .rec_mode       = LIRC_MODE_LIRCCODE,\r
++      .code_length    = IRCODE_NUM_BYTES,\r
++      .init_func      = yard2_init,\r
++      .deinit_func    = yard2_deinit,\r
++      .send_func      = yard2_send,\r
++      .rec_func       = yard2_rec,\r
++      .decode_func    = yard2_decode,\r
++      .drvctl_func    = default_drvctl,\r
++      .readdata       = NULL,\r
++      .api_version    = 3,\r
++      .driver_version = "0.9.3",\r
++      .open_func      = default_open,\r
++      .close_func     = default_close,\r
++      .driver_version = "0.9.3",\r
++      .info           = "Driver for the yard2 DIY assembly kit." \\r
++                        "See: " YARD2_URL,\r
++      .device_hint    = "/tmp/yardsrv_sock",\r
++};\r
++const struct driver* hardwares[] = { &hw_yard2, (const struct driver*)NULL };\r
++\r
++/* Implementation */\r
++\r
++static int yard2_decode(struct ir_remote* remote, struct decode_ctx_t* ctx)\r
++{\r
++      if (!map_code(remote, ctx, 0, 0, IRCODE_NUM_BITS, code, 0, 0))\r
++              return 0;\r
++      map_gap(remote, ctx, &start, &last, 0); // FIXME: Check 0 vs signal_length\r
++      return 1;\r
++}\r
++\r
++static int yard2_init(void)\r
++{\r
++      struct sockaddr_un srvAddr;\r
++      int srvAddrLen;\r
++\r
++      // Establish connection to YARD server\r
++      bzero((char*)&srvAddr, sizeof(srvAddr));\r
++      srvAddr.sun_family = AF_UNIX;\r
++      strcpy(srvAddr.sun_path, YARDSRV_SOCK_PATH);\r
++      srvAddrLen = strlen(srvAddr.sun_path) + sizeof(srvAddr.sun_family);\r
++\r
++      drv.fd = socket(AF_UNIX, SOCK_STREAM, 0);\r
++      if (drv.fd < 0) {\r
++              log_error("yard2: Can't create socket !");\r
++              return 0;\r
++      }\r
++\r
++      if (connect(drv.fd, (struct sockaddr*)&srvAddr, srvAddrLen) < 0) {\r
++              log_error("yard2: Can't connect to yardsrv !");\r
++              return 0;\r
++      }\r
++\r
++/* not used in yard2\r
++ *      // Register IR code notification\r
++ *      if ( !yard_sendSrvCmd(SRVCMD_IRREG) )\r
++ *      {\r
++ *              log_error("yard2: Can't register IR code notification !");\r
++ *              return 0;\r
++ *      }\r
++ */\r
++      return 1;\r
++}\r
++\r
++static int yard2_deinit(void)\r
++{\r
++      // Unregister IR code notification\r
++      // not used in yard2 yard_sendSrvCmd(SRVCMD_IRUNREG);\r
++\r
++      close(drv.fd);\r
++      drv.fd = -1;\r
++      return 1;\r
++}\r
++\r
++static int yard2_send(struct ir_remote* remote, struct ir_ncode* icode)\r
++{\r
++      unsigned long long sendir;\r
++      unsigned char buffer[8];\r
++\r
++      //Error check\r
++      if (drv.fd < 0)\r
++              return 0;\r
++\r
++      sendir = icode->code;\r
++      log_trace("SEND IR-Code: %llx", sendir);\r
++\r
++      buffer[0] = 0x81;       //Send IR command ID\r
++      buffer[1] = 255 - buffer[0];\r
++      //  example  0715000c0000\r
++      buffer[2] = (sendir & 0x0000FF0000000000) >> 40;\r
++      buffer[3] = (sendir & 0x000000FF00000000) >> 32;\r
++      buffer[4] = (sendir & 0x00000000FF000000) >> 24;\r
++      buffer[5] = (sendir & 0x0000000000FF0000) >> 16;\r
++      buffer[6] = (sendir & 0x000000000000FF00) >> 8;\r
++      buffer[7] = (sendir & 0x00000000000000FF);\r
++\r
++      send(drv.fd, buffer, 8, MSG_NOSIGNAL);\r
++      return 1;\r
++}\r
++\r
++static char* yard2_rec(struct ir_remote* remotes)\r
++{\r
++      YARD_IRCODE yardIrCode;\r
++      char* m;\r
++      int byteCnt;\r
++      int i;\r
++\r
++      // Error check\r
++      if (drv.fd < 0)\r
++              return 0;\r
++\r
++      last = end;\r
++      gettimeofday(&start, NULL);\r
++\r
++      // Receive IR code from YARD server\r
++      byteCnt = read(drv.fd,\r
++                     (unsigned char*)&yardIrCode, sizeof(YARD_IRCODE));\r
++      log_trace("yard2: received %d bytes !", byteCnt);\r
++      if (byteCnt < sizeof(YARD_IRCODE)) {\r
++              log_error("yard2: Expected %d bytes - received %d bytes !",\r
++                        sizeof(YARD_IRCODE), byteCnt);\r
++              return NULL;\r
++      }\r
++\r
++      gettimeofday(&end, NULL);\r
++\r
++      // Extract IR code bytes\r
++      code = 0;\r
++      for (i = 0; i < IRCODE_NUM_BYTES; i++) {\r
++              code <<= 8;\r
++              code |= yardIrCode[i];  //.abIrData[i]; //\r
++      }\r
++      log_trace("Receive IR-Code: %llx", (unsigned long long)code);\r
++      m = decode_all(remotes);\r
++      return m;\r
++}\r
+--- 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
diff --git a/yard2tools.spec b/yard2tools.spec
new file mode 100644 (file)
index 0000000..b77bef0
--- /dev/null
@@ -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
This page took 0.142938 seconds and 4 git commands to generate.