Hello community,

here is the log from the commit of package irda for openSUSE:Factory checked in 
at 2013-04-05 09:23:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/irda (Old)
 and      /work/SRC/openSUSE:Factory/.irda.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "irda", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/irda/irda.changes        2011-09-23 
02:03:43.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.irda.new/irda.changes   2013-04-05 
09:23:45.000000000 +0200
@@ -1,0 +2,12 @@
+Thu Apr  4 04:45:27 UTC 2013 - [email protected]
+
+- fix braino in udev rule, missing comma. and TAG attribute.
+
+-------------------------------------------------------------------
+Thu Apr  4 04:04:06 UTC 2013 - [email protected]
+
+- irda-parseoldasssysconfig.patch + udev rules + irattach.service:
+* Add systemd support 
+* remove sysvinit support(this change requires udev & systemd combo)
+
+-------------------------------------------------------------------

Old:
----
  irda-0.9.18.init

New:
----
  irattach.service
  irda-parseoldasssysconfig.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ irda.spec ++++++
--- /var/tmp/diff_new_pack.IDAGg4/_old  2013-04-05 09:23:48.000000000 +0200
+++ /var/tmp/diff_new_pack.IDAGg4/_new  2013-04-05 09:23:48.000000000 +0200
@@ -1,7 +1,7 @@
 #
-# spec file for package irda (Version 0.9.18)
+# spec file for package irda
 #
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,18 +16,21 @@
 #
 
 
-
 Name:           irda
-BuildRequires:  glib2-devel linux-kernel-headers pciutils-devel
+BuildRequires:  glib2-devel
+BuildRequires:  linux-kernel-headers
+BuildRequires:  pciutils-devel
+BuildRequires:  pkgconfig(libHX)
+BuildRequires:  pkgconfig(systemd)
+BuildRequires:  pkgconfig(udev)
 Url:            http://irda.sourceforge.net
 Summary:        Necessary Tools for Using the Infrared Port
-Version:        0.9.18
-Release:        208
-Group:          Hardware/Other
 License:        GPL-2.0+
+Group:          Hardware/Other
+Version:        0.9.18
+Release:        0
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
-AutoReqProv:    on
-PreReq:         %insserv_prereq %fillup_prereq
+PreReq:         %fillup_prereq
 Source:         irda-utils-%{version}.tar.bz2
 Patch1:         irda-0.9.18-psion-no-strict-aliasing.diff
 Patch2:         irda-0.9.18-irnetd-install.diff
@@ -43,10 +46,13 @@
 Patch12:        irda-exit_on_error.diff
 Patch13:        irda-irdaping_no_strict_aliasing.diff
 Patch14:        irda-no_std_paths.diff
+Patch15:        irda-parseoldasssysconfig.patch
 Source1:        52-irda.rules
-Source2:        irda-0.9.18.init
+Source2:        irattach.service
 Source3:        irda-0.9.18.sysconfig
 Source4:        irda-rpmlintrc
+%{?systemd_requires}
+%define _udevrulesdir %(pkg-config --variable=udevdir udev)/rules.d
 
 %description
 This package contains all necessary scripts and programs for setting up
@@ -94,15 +100,14 @@
 %patch12
 %patch13
 %patch14
+%patch15
 
 %build
-make V=1 RPM_OPT_FLAGS="$RPM_OPT_FLAGS" INITD=%{_sysconfdir}/init.d 
ROOT="$RPM_BUILD_ROOT" all
+make V=1 RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" 
INITD=%{_sysconfdir}/init.d ROOT="$RPM_BUILD_ROOT" all
 
 %install
 install -d -m 755 %{buildroot}/usr/sbin
 install -d -m 755 %{buildroot}/usr/bin
-install -d -m 755 %{buildroot}/etc/init.d
-install -d -m 755 %{buildroot}/etc/udev/rules.d
 install -d -m 755 %{buildroot}%{_docdir}/irda
 install -d -m 755 %{buildroot}/var/adm/fillup-templates
 make INITD=%{_sysconfdir}/init.d \
@@ -123,34 +128,34 @@
 install -m 644 irsockets/README %{buildroot}%{_docdir}/irda/README.irsockets
 install -m 644 tekram/README %{buildroot}%{_docdir}/irda/README.tekram
 # udev stuff
-install -m 644 %{S:1} %{buildroot}/etc/udev/rules.d
-# init script
-install -m 755 %{S:2} %{buildroot}/etc/init.d/irda
-ln -s /etc/init.d/irda %{buildroot}/usr/sbin/rcirda
+install -D -m 644 %{S:1} %{buildroot}%{_udevrulesdir}/52-irda.rules
 # sysconfig template
 install -m 644 %{S:3} %{buildroot}/var/adm/fillup-templates/sysconfig.irda
+install -D -m 0644 %{S:2} %{buildroot}%{_unitdir}/irattach.service
+
+%pre
+%service_add_pre irattach.service
 
 %post
-%{fillup_and_insserv irda}
+%{fillup_only -n irda}
+%service_add_post irattach.service
 
 %preun
-%{stop_on_removal}
+%service_del_preun irattach.service
 
 %postun
-%{insserv_cleanup}
+%service_del_postun irattach.service
 
 %files
 %defattr(-,root,root)
 %doc %{_docdir}/irda
-%{_sysconfdir}/init.d/irda
 /usr/sbin/*
 /usr/bin/*
 %doc %{_mandir}/man4/*
 %doc %{_mandir}/man7/*
 %doc %{_mandir}/man8/*
 /var/adm/fillup-templates/sysconfig.irda
-%dir /etc/udev
-%dir /etc/udev/rules.d
-%config /etc/udev/rules.d/52-irda.rules
+%{_udevrulesdir}/52-irda.rules
+%{_unitdir}/irattach.service
 
 %changelog

++++++ 52-irda.rules ++++++
--- /var/tmp/diff_new_pack.IDAGg4/_old  2013-04-05 09:23:49.000000000 +0200
+++ /var/tmp/diff_new_pack.IDAGg4/_new  2013-04-05 09:23:49.000000000 +0200
@@ -2,4 +2,4 @@
 #
 # check if SYSFS product description contains IrDA and restart irda
 # atm we don't have a useable rule for stopping rcirda on device removal
-SUBSYSTEM=="usb", ATTR{product}=="*IrDA*", ACTION=="add", 
RUN+="/etc/init.d/irda restart"
+SUBSYSTEM=="usb", ATTR{product}=="*IrDA*", ACTION=="add", 
IMPORT{builtin}="kmod load ircomm-tty", TAG+="systemd", 
ENV{SYSTEMD_WANTS}+="irattach.service"

++++++ irattach.service ++++++
[Unit]
Description=Initialize hardware Infrared devices

[Service]
ExecStart=/usr/sbin/irattach -b

[Install]
WantedBy=multi-user.target
++++++ irda-parseoldasssysconfig.patch ++++++
--- irattach/irattach.c.orig
+++ irattach/irattach.c
@@ -40,6 +40,13 @@
 #include <sys/utsname.h>
 
 #include <irda.h>
+#include <error.h>
+#include <stdlib.h>
+#include <libHX/defs.h>
+#include <libHX/map.h>
+#include <libHX/option.h>
+
+#define streq(a, b) (strcmp((a), (b)) == 0)
 
 #ifndef N_IRDA
 #define N_IRDA 11 /* This one should go in .../asm/termio.h */
@@ -660,17 +667,20 @@ int main(int argc, char *argv[])
        int     c;
        int     ret;
        int     daemonize = 1;  /* Go to background by default */
+    struct HXmap *sc_map;
 
        //printf("%s\n", VERSION);
-       if ((argc < 2) || (argc > 5)) {
+       if ((argc > 5)) {
                print_usage();
                exit(-1);
        }
 
        /* First arg is device name. Save it now, because in some cases
         * getopt() will remove it... */
+    if(argv[1] != NULL && strlen(argv[1]) > 0) {
        strncpy(device, argv[1], 20);
        device[20] = '\0';
+    }
 
        /* Look for options */
        /* Do this before processing device, to handle "-h" and -v"
@@ -706,6 +716,50 @@ int main(int argc, char *argv[])
                }
        }
 
+    sc_map = HX_shconfig_map("/etc/sysconfig/irda");
+    if (sc_map != NULL) {
+        char *v;
+        v = HXmap_get(sc_map, "IRDA_DONGLE");
+        if (dongle == -1 && v != NULL && strlen(v) > 0) {
+            dongle = get_dongle(v);
+            if(dongle == -1) 
+                error(EXIT_FAILURE, ENOTSUP, "attaching dongle %s failed", v);
+            
+            syslog(LOG_INFO, "sysconfig requested use of irda dongle: %s\n", 
v);
+        }
+        v = HXmap_get(sc_map, "IRDA_DISCOVERY");
+        if (discovery == -1 && v != NULL && strlen(v) > 0 && streq(v, "no")) {
+            discovery = 0;
+            syslog(LOG_INFO, "sysconfig disabled irda discovery\n");
+        }
+        v = HXmap_get(sc_map, "IRDA_PORT");
+        if (device == NULL && v != NULL && strlen(v) > 0) {
+             if(snprintf(device, sizeof(device), "%s", v) < 0)
+                 error(EXIT_FAILURE, EINVAL, "attaching irda device %s 
failed", v);
+             syslog(LOG_INFO, "sysconfig set irda port to %s\n", v);
+        }
+        v = HXmap_get(sc_map, "IRDA_MAX_BAUD_RATE");
+        if (v != NULL && strlen(v) > 0) {
+            long int baud_rate = strtol(v, NULL, 0);
+            if(baud_rate != 0) {
+                FILE *procfs = fopen("/proc/sys/net/irda/max_baud_rate", "we");
+                if(procfs != NULL) {
+                   if(fprintf(procfs, "%d", baud_rate) > 0) {
+                        syslog(LOG_INFO, "sysconfig requested max_baud_rate to 
be set to %d\n", baud_rate);
+                    }
+                    fclose(procfs);
+                } else {
+                    syslog(LOG_WARNING, "failed to set max_baud_rate to %d: 
%m\n", baud_rate);
+                }
+            }
+        }
+    }
+    /* still no device ? duh.. */
+    if(device == NULL || strlen(device) == 0) {
+        print_usage();
+        exit(-1);
+    }
+
        /* Check if the device is a tty */
        if(strncmp("/dev", device, 4) == 0) {
                /* We are managing a tty ! */
--- irattach/Makefile.orig
+++ irattach/Makefile
@@ -33,7 +33,7 @@ CFLAGS       = $(RPM_OPT_FLAGS) -O2 -W -
 SYS_INCLUDES = -I/usr/include
 SYS_LIBPATH  = 
 
-INCLUDES     = $(SYS_INCLUDES) -I../include/
+INCLUDES     = $(SYS_INCLUDES) -I../include/ $(shell pkg-config --cflags libHX)
 LIBRARIES    = $(SYS_LIBRARIES)
 LIBPATH      = $(SYS_LIBPATH)
 
@@ -49,7 +49,7 @@ all: $(TARGETS)
 
 irattach: irattach.o util.o
        $(prn_cc_o)
-       $(ECMD)$(CC) $(CFLAGS) irattach.o util.o -o $@
+       $(ECMD)$(CC) $(CFLAGS) irattach.o util.o -o $@ $(shell pkg-config 
--libs libHX)
 
 
 
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to