[irda-utils] Spec file cleanup, own init script and fix for #242468, #668122, #675677

Dmitry Butskoy buc at fedoraproject.org
Fri Jul 15 17:17:36 UTC 2011


commit 4f82efe912e6687c57551225306e8f3245b75775
Author: Dmitry Butskoy <Dmitry at Butskoy.name>
Date:   Fri Jul 15 21:17:04 2011 +0400

    Spec file cleanup, own init script and fix for #242468, #668122, #675677

 irda-utils-0.9.13-i18n.patch       |   33 -----------
 irda-utils-0.9.14-chkconfig.patch  |   87 ----------------------------
 irda-utils-0.9.14-typo.patch       |   11 ----
 irda-utils-0.9.16-rh2.patch        |   12 ----
 irda-utils-0.9.17-initscript.patch |   31 ----------
 irda-utils-0.9.17-smcdisable.patch |   11 ----
 irda-utils-0.9.18-man.patch        |   94 ++++++++++++++++++++++++++++++
 irda-utils-0.9.18-smcdisable.patch |   24 ++++++++
 irda-utils.spec                    |  111 ++++++++++++++++++++++--------------
 irda.init                          |   80 ++++++++++++++++++++++++++
 10 files changed, 266 insertions(+), 228 deletions(-)
---
diff --git a/irda-utils-0.9.18-man.patch b/irda-utils-0.9.18-man.patch
new file mode 100644
index 0000000..36eb0d1
--- /dev/null
+++ b/irda-utils-0.9.18-man.patch
@@ -0,0 +1,94 @@
+diff -Nrbu irda-utils-0.9.18/man/irda.7 irda-utils-0.9.18-OK/man/irda.7
+--- irda-utils-0.9.18/man/irda.7	2006-07-11 10:16:06.000000000 +0400
++++ irda-utils-0.9.18-OK/man/irda.7	2011-07-15 20:31:58.000000000 +0400
+@@ -61,7 +61,7 @@
+ connection between two sockets on top of
+ .IR IrTTP ,
+ similar to TCP sockets. IrTTP guarantees that the data arrives in
+-order and manages flow contol, IrLAP retransmits lost packets.
++order and manages flow control, IrLAP retransmits lost packets.
+ .br
+ Stream sockets does not preserve record boundaries.
+ .TP
+@@ -70,7 +70,7 @@
+ connection between two sockets on top of
+ .IR IrTTP .
+ IrTTP guarantees that the data arrives in order and manages flow
+-contol, IrLAP retransmits lost packets.
++control, IrLAP retransmits lost packets.
+ .br
+ SeqPacket sockets preserve record boundaries. Large datagrams will be
+ fragmented as needed.
+@@ -79,8 +79,8 @@
+ SeqPacket sockets provides a reliable, datagram oriented, full duplex
+ connection between two sockets on top of
+ .IR IrLMP .
+-There is no guarantees that the data arrives in order and there is no
+-flow contol, however IrLAP retransmits lost packets.
++There is no guarantee that the data arrives in order and there is no
++flow control, however IrLAP retransmits lost packets.
+ .br
+ Datagram sockets preserve record boundaries. No fragmentation is
+ provided, datagrams larger than the IrDA link MTU are truncated or
+@@ -90,9 +90,9 @@
+ Ultra sockets provides a connectionless, unreliable datagram packet
+ service on top of
+ .IR IrLAP-Ultra .
+-Ultra datagrams are sent and receive only when no IrLAP connection is
++Ultra datagrams are sent and received only when no IrLAP connection is
+ established and otherwise discarded. They are always transmitted at
+-9600 bauds. Datagrams may be lost, reordered, and there is no flow
++9600 bauds. Datagrams may be lost or reordered, and there is no flow
+ control.
+ .br
+ Ultra sockets preserve record boundaries. No fragmentation is
+@@ -124,8 +124,8 @@
+ .I sir_lsap_sel
+ is usually not used.
+ .I sir_addr
+-is the address of the peer and optional (and that case the first peer
+-discoverd will be used).
++is the optional address of the peer (if no given the first peer
++discovered will be used).
+ .I sir_name
+ is the service name of the socket.
+ .\"
+diff -Nrbu irda-utils-0.9.18/man/irnet.4 irda-utils-0.9.18-OK/man/irnet.4
+--- irda-utils-0.9.18/man/irnet.4	2006-07-11 10:16:06.000000000 +0400
++++ irda-utils-0.9.18-OK/man/irnet.4	2011-07-15 20:33:14.000000000 +0400
+@@ -31,7 +31,7 @@
+ .I PPP over IrCOMM
+ is that it avoids the framing and serial emulation which are a
+ performance bottleneck. It also allows multipoint communications in a
+-sensible fashion. And finally, it can automatically handle incomming
++sensible fashion. And finally, it can automatically handle incoming
+ connections through
+ .B irnetd.
+ .PP
+@@ -84,7 +84,7 @@
+ .IR "control channel" ,
+ other use are unsupported.
+ .B IrNET
+-support multiple concurent connections (limited by the IrDA stack),
++support multiple concurrent connections (limited by the IrDA stack),
+ all those connections are multiplexed on a single
+ .B /dev/irnet
+ device (as opposed to IrCOMM which as one device per connection).
+@@ -164,7 +164,7 @@
+ .\" EXAMPLE part
+ .\"
+ .SH EXAMPLE
+-Start a IrNET server accepting any incomming connection:
++Start a IrNET server accepting any incoming connection:
+ .br
+ .B "	pppd /dev/irnet 9600 local noauth nolock passive"
+ .PP
+@@ -177,7 +177,7 @@
+ .br
+ .B "	pppd /dev/irnet 9600 local noauth nolock connect ""echo name MyIrDANode""
+ .PP
+-Start a IrNET server accepting incomming connection from peer with IrDA address 0x12345678 only on IrDA port 0x87654321:
++Start a IrNET server accepting incoming connection from peer with IrDA address 0x12345678 only on IrDA port 0x87654321:
+ .br
+ .B "	pppd /dev/irnet 9600 local noauth nolock passive connect ""echo daddr 0x12345678 , saddr 0x87654321"""
+ .\"
diff --git a/irda-utils-0.9.18-smcdisable.patch b/irda-utils-0.9.18-smcdisable.patch
new file mode 100644
index 0000000..d07c771
--- /dev/null
+++ b/irda-utils-0.9.18-smcdisable.patch
@@ -0,0 +1,24 @@
+diff -Nrbu irda-utils-0.9.18/Makefile irda-utils-0.9.18-OK/Makefile
+--- irda-utils-0.9.18/Makefile	2011-07-15 20:16:14.000000000 +0400
++++ irda-utils-0.9.18-OK/Makefile	2011-07-15 20:15:38.000000000 +0400
+@@ -27,7 +27,7 @@
+ 
+ TARGET = test
+ 
+-DIRS = irattach irdaping etc man irnetd psion tekram findchip irdadump smcinit
++DIRS = irattach irdaping etc man irnetd psion tekram findchip irdadump
+ CFLAGS = -O2 -W -Wall
+ INCLUDES = -I/usr/include/glib-2.0 -I./include -I.
+ 
+diff -Nrbu irda-utils-0.9.18/man/Makefile irda-utils-0.9.18-OK/man/Makefile
+--- irda-utils-0.9.18/man/Makefile	2006-07-11 10:16:06.000000000 +0400
++++ irda-utils-0.9.18-OK/man/Makefile	2011-07-15 20:16:01.000000000 +0400
+@@ -18,7 +18,7 @@
+ MANPAGES4=irnet.4.gz
+ MANPAGES7=irda.7.gz
+ MANPAGES8=irattach.8.gz irdaping.8.gz irdadump.8.gz irpsion5.8.gz \
+-	findchip.8.gz irnetd.8.gz smcinit.8.gz tosh1800-smcinit.8.gz
++	findchip.8.gz irnetd.8.gz
+ 
+ # Man pages generated by DOCBOOK
+ SGMLMAN=irattach.8 irdaping.8 irdadump.8 irpsion5.8 findchip.8
diff --git a/irda-utils.spec b/irda-utils.spec
index a0f214a..089d59d 100644
--- a/irda-utils.spec
+++ b/irda-utils.spec
@@ -1,28 +1,27 @@
 Summary:         Utilities for infrared communication between devices
 Name:            irda-utils
 Version:         0.9.18
-Release:         11%{?dist}
-Url:             http://irda.sourceforge.net/
+Release:         12%{?dist}
+Url:             http://irda.sourceforge.net
 License:         GPLv2+
 Group:           Applications/System
 BuildRoot:       %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 ExcludeArch:     s390 s390x
-BuildRequires:   glib2-devel, libtool, automake, docbook-utils
-Requires:        grep, modutils >= 2.3.21-4
-Requires(post):  /sbin/chkconfig
-Requires(preun): /sbin/chkconfig
-Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
-Patch1: irda-utils-0.9.14-chkconfig.patch
-Patch2: irda-utils-0.9.14-typo.patch
-Patch3: irda-utils-0.9.13-i18n.patch
-Patch4: irda-utils-0.9.17-rootonly.patch
-Patch5: irda-utils-0.9.15-rh1.patch
-Patch6: irda-utils-0.9.16-rh2.patch
-Patch7: irda-utils-0.9.16-io.patch
-Patch8: irda-utils-0.9.17-makefile.patch
-Patch9: irda-utils-0.9.17-smcdisable.patch
-Patch10: irda-utils-0.9.17-initscript.patch
-Patch11: irda-utils-0.9.18-root.patch
+Source0: http://downloads.sourceforge.net/irda/%{name}/%{version}/%{name}-%{version}.tar.gz
+Source1: irda.init
+Patch1: irda-utils-0.9.17-rootonly.patch
+Patch2: irda-utils-0.9.15-rh1.patch
+Patch3: irda-utils-0.9.16-io.patch
+Patch4: irda-utils-0.9.17-makefile.patch
+Patch5: irda-utils-0.9.18-smcdisable.patch
+Patch6: irda-utils-0.9.18-root.patch
+Patch7: irda-utils-0.9.18-man.patch
+BuildRequires:   glib2-devel
+
+Requires(post): /sbin/chkconfig
+Requires(preun): /sbin/chkconfig, /sbin/service
+Requires(postun): /sbin/service
+
 
 %description
 IrDA(TM) (Infrared Data Association) is an industry standard for
@@ -41,6 +40,7 @@ tools or programs can be used. Some configuration outside the kernel
 is required, however, and some IrDA features, like IrOBEX, are
 actually implemented outside the kernel.
 
+
 %prep
 %setup -q
 %patch1 -p1
@@ -49,55 +49,80 @@ actually implemented outside the kernel.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+gunzip man/irnet.4.gz man/irda.7.gz
 %patch7 -p1
-%patch8 -p1
-%patch9 -p1
-%patch10 -p1
-%patch11 -p1
+gzip -9 man/irnet.4 man/irda.7
+
 
 %build
 make all RPM_OPT_FLAGS="$RPM_OPT_FLAGS" ROOT="$RPM_BUILD_ROOT" \
    CFLAGS="$RPM_OPT_FLAGS" %{?_smp_mflags}
 
+
 %install
 rm -rf $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{_sbindir} $RPM_BUILD_ROOT/%{_initddir}
-mkdir -p $RPM_BUILD_ROOT%{_bindir} $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
+
+for dir in %{_sbindir} %{_bindir} %{_initddir} %{_sysconfdir}/sysconfig
+do
+    install -d $RPM_BUILD_ROOT$dir
+done
 
 make install  ROOT="$RPM_BUILD_ROOT" MANDIR="$RPM_BUILD_ROOT/%{_mandir}"
+
+install -p -m755 %{SOURCE1} $RPM_BUILD_ROOT/%{_initrddir}/irda
 chmod -x $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/irda
+
 rm -f $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/network-scripts/ifcfg-irlan0
-mv irattach/README irattach/README.irattach
-mv irdadump/README irdadump/README.irdadump
-mv irdaping/README irdaping/README.irdaping
-mv tekram/README tekram/README.tekram
+
+for i in irattach irdadump irdaping tekram
+do
+    [ -f $i/README ] && ln $i/README README.$i
+done
+iconv -f ISO8859-1 -t UTF-8 <README.irdadump >README.irdadump.new && \
+	mv -f README.irdadump.new README.irdadump
 mv etc/modules.conf.irda etc/modprobe.conf.irda
+chmod -x etc/ifcfg-irlan0
+
 
 %clean
-#rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_ROOT
+
 
 %post
 /sbin/chkconfig --add irda
 
+
 %preun
-if [ $1 = 0 ] ; then
- /sbin/chkconfig --del irda
+if [ $1 = 0 ]; then
+   /sbin/service irda stop >/dev/null 2>&1
+   /sbin/chkconfig --del irda
 fi
 
+
+%postun
+if [ $1 != 0 ]; then
+   /sbin/service irda condrestart >/dev/null 2>&1
+fi
+
+
 %files
-%defattr(-,root,root)
-/usr/sbin/*
-/usr/bin/*
-%{_mandir}/man?/*
-%config %{_initddir}/irda
-%config %{_sysconfdir}/sysconfig/irda
-%doc README etc/ifcfg-irlan0 etc/modprobe.conf.irda
-%doc irattach/README.irattach
-%doc irdadump/README.irdadump
-%doc irdaping/README.irdaping
-%doc tekram/README.tekram
+%defattr(-,root,root,-)
+%{_sbindir}/*
+%{_bindir}/*
+%{_mandir}/*/*
+%{_initddir}/irda
+%config(noreplace) %{_sysconfdir}/sysconfig/irda
+%doc README* etc/ifcfg-irlan0 etc/modprobe.conf.irda
+
 
 %changelog
+* Fri Jul 15 2011 Dmitry Butskoy <Dmitry at Butskoy.name> - 0.9.18-12
+- spec file cleanup
+- add own init script instead of huge patched original one
+  (and fix #242468)
+- disable smcinit manuals in smcdisable patch as well
+- fix typos in man pages (#668122, #675677)
+
 * Wed Feb 09 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.9.18-11
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
 
@@ -209,7 +234,7 @@ fi
 - Fixed service script description
 
 * Mon Dec 09 2002 Phil Knirsch <pknirsch at redhat.com> 0.9.14-7
-- Fixed problem with %doc entries.
+- Fixed problem with %%doc entries.
 
 * Tue Jul 09 2002 Phil Knirsch <pknirsch at redhat.com> 0.9.14-6
 - Removed the ifcfg-irlan0 file. It shouldn't be installed by default. Moved it
diff --git a/irda.init b/irda.init
new file mode 100644
index 0000000..d6bef3c
--- /dev/null
+++ b/irda.init
@@ -0,0 +1,80 @@
+#!/bin/sh
+#
+# irda          This shell script takes care of starting and stopping
+#               IrDA support
+#
+# chkconfig: - 45 24
+# description: IrDA(TM) (Infrared Data Association) is an industry standard  \
+# for wireless, infrared communication between devices. IrDA speeds range \
+# from 9600 bps to 4 Mbps, and IrDA can be used by many modern devices \
+# including laptops, LAN adapters, PDAs, printers, and mobile phones.
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+# Source IrDA networking configuration.
+. /etc/sysconfig/irda
+
+
+# Check that irda is up.
+[ ${IRDA} = "no" ] && exit 6
+
+[ -f /usr/sbin/irattach ] || exit 5
+
+args=
+[ -n "$DONGLE" ] && args="$args -d $DONGLE"
+[ "$DISCOVERY" = "yes" ] && args="$args -s"
+
+
+RETVAL=0
+
+start() {
+        echo -n $"Starting IrDA: "
+	/sbin/modprobe ircomm-tty 2>/dev/null
+	/sbin/modprobe irtty-sir 2>/dev/null
+	/sbin/modprobe irnet 2>/dev/null
+	daemon /usr/sbin/irattach ${DEVICE} ${args}
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/irda
+        echo
+}
+
+stop() {
+        echo -n $"Shutting down IrDA: "
+	killproc irattach
+	RETVAL=$?
+	rm -f /var/lock/subsys/irda
+        echo
+}
+
+restart() {
+        stop
+        start
+}
+
+
+# See how we were called.
+case "$1" in
+  start)
+	start
+        ;;
+  stop)
+	stop
+        ;;
+  status)
+	status irattach
+	RETVAL=$?
+	;;
+  restart|reload|force-reload)
+	restart
+	;;
+  condrestart|try-restart)
+	[ -f /var/lock/subsys/irda ] && restart
+	;;
+  *)
+        echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+        exit 3
+esac
+
+exit $RETVAL


More information about the scm-commits mailing list