Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Dmitry Butskoy
99273c716f Spec file cleanup, own init script and fix for #242468, #668122, #675677 2011-07-15 20:44:12 +04:00
10 changed files with 266 additions and 228 deletions

View file

@ -1,33 +0,0 @@
--- irda-utils-0.9.13/etc/irda.rc.i18n Thu Feb 8 14:04:06 2001
+++ irda-utils-0.9.13/etc/irda.rc Thu Feb 8 14:05:26 2001
@@ -13,10 +13,11 @@
# Source IrDA networking configuration.
. /etc/sysconfig/irda
+prog="IrDA"
start() {
# Attach irda device
- echo -n "Starting IrDA: "
+ echo -n $"Starting $prog: "
daemon /usr/sbin/irattach ${DEVICE} ${ARGS}
touch /var/lock/subsys/irda
echo
@@ -24,7 +25,7 @@
stop() {
# Stop service.
- echo -n "Shutting down IrDA: "
+ echo -n $"Shutting down $prog: "
killproc irattach
rm -f /var/lock/subsys/irda
echo
@@ -62,7 +63,7 @@
[ -e /var/lock/subsys/irda ] && (stop; start)
;;
*)
- echo "Usage: irda {start|stop|restart|reload|condrestart|status}"
+ echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
exit 1
esac

View file

@ -1,87 +0,0 @@
--- irda-utils-0.9.14/etc/irda.rc.chkconfig Sun Jan 14 23:12:56 2001
+++ irda-utils-0.9.14/etc/irda.rc Tue Apr 24 15:43:33 2001
@@ -3,8 +3,7 @@
# irda This shell script takes care of starting and stopping
# IrDA support
#
-# chkconfig: 2345 45 96
-#
+# chkconfig: - 45 24
# description: IrDA stack for Linux
#
@@ -14,6 +13,23 @@
# Source IrDA networking configuration.
. /etc/sysconfig/irda
+
+start() {
+ # Attach irda device
+ echo -n "Starting IrDA: "
+ daemon /usr/sbin/irattach ${DEVICE} ${ARGS}
+ touch /var/lock/subsys/irda
+ echo
+}
+
+stop() {
+ # Stop service.
+ echo -n "Shutting down IrDA: "
+ killproc irattach
+ rm -f /var/lock/subsys/irda
+ echo
+}
+
# Check that irda is up.
[ ${IRDA} = "no" ] && exit 0
@@ -30,28 +46,23 @@
# See how we were called.
case "$1" in
start)
- # Attach irda device
- echo -n "Starting IrDA: "
- daemon /usr/sbin/irattach ${DEVICE} ${ARGS}
- touch /var/lock/subsys/irda
- echo
+ start
;;
stop)
- # Stop service.
- echo -n "Shutting down IrDA: "
- killproc irattach
- rm -f /var/lock/subsys/irda
- echo
+ stop
;;
status)
status irattach
;;
restart|reload)
- $0 stop
- $0 start
+ stop
+ start
+ ;;
+ condrestart)
+ [ -e /var/lock/subsys/irda ] && (stop; start)
;;
*)
- echo "Usage: irda {start|stop|restart|reload|status}"
+ echo "Usage: irda {start|stop|restart|reload|condrestart|status}"
exit 1
esac
--- irda-utils-0.9.14/etc/irda.rc.chkconfig 2002-12-16 14:01:23.000000000 -0500
+++ irda-utils-0.9.14/etc/irda.rc 2002-12-16 13:56:11.000000000 -0500
@@ -4,7 +4,10 @@
# IrDA support
#
# chkconfig: - 45 24
-# description: IrDA stack for Linux
+# 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.

View file

@ -1,11 +0,0 @@
--- irda-utils-0.9.14/etc/irda.rc.typo Tue Apr 24 15:44:12 2001
+++ irda-utils-0.9.14/etc/irda.rc Tue Apr 24 15:45:17 2001
@@ -36,7 +36,7 @@
[ -f /usr/sbin/irattach ] || exit 0
ARGS=
-if [ $DONGLE ]; then
+if [ -n "$DONGLE" ]; then
ARGS="$ARGS -d $DONGLE"
fi
if [ "$DISCOVERY" = "yes" ];then

View file

@ -1,12 +0,0 @@
--- irda-utils-0.9.16/etc/irda.rc.rh2 2004-10-04 12:49:46.016198784 +0200
+++ irda-utils-0.9.16/etc/irda.rc 2004-10-04 12:50:24.128404848 +0200
@@ -21,6 +21,9 @@
start() {
# Attach irda device
echo -n $"Starting $prog: "
+ /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}
touch /var/lock/subsys/irda
echo

View file

@ -1,31 +0,0 @@
--- irda-utils-0.9.17/etc/irda.rc.rh1 2006-08-01 14:39:44.000000000 +0200
+++ irda-utils-0.9.17/etc/irda.rc 2006-08-01 14:40:02.000000000 +0200
@@ -24,16 +24,15 @@
/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}
- touch /var/lock/subsys/irda
+ daemon /usr/sbin/irattach ${DEVICE} ${ARGS}
+ [ -f /var/run/irattach.pid ] && success $"irattach startup" || failure $"irattach startup"
echo
}
stop() {
# Stop service.
echo -n $"Shutting down $prog: "
- killproc irattach
- rm -f /var/lock/subsys/irda
+ [ -f /var/run/irattach.pid ] && killproc irattach || success $"irattach shutdown"
echo
}
@@ -66,7 +65,7 @@
start
;;
condrestart)
- [ -e /var/lock/subsys/irda ] && (stop; start)
+ [ -e /var/run/irdattach.pid ] && (stop; start)
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"

View file

@ -1,11 +0,0 @@
--- irda-utils-0.9.17/Makefile.smcdisable 2006-06-01 14:49:01.000000000 +0200
+++ irda-utils-0.9.17/Makefile 2006-06-01 14:48:52.000000000 +0200
@@ -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.

View file

@ -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"""
.\"

View file

@ -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

View file

@ -1,28 +1,27 @@
Summary: Utilities for infrared communication between devices
Name: irda-utils
Version: 0.9.18
Release: 10%{?dist}
Url: http://irda.sourceforge.net/
Release: 11%{?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@Butskoy.name> - 0.9.18-11
- 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)
* Tue Oct 20 2009 Orion Poplawski <orion@cora.nwra.com> - 0.9.18-10
- Add patch to fix installing of initscript into buildroot
@ -206,7 +231,7 @@ fi
- Fixed service script description
* Mon Dec 09 2002 Phil Knirsch <pknirsch@redhat.com> 0.9.14-7
- Fixed problem with %doc entries.
- Fixed problem with %%doc entries.
* Tue Jul 09 2002 Phil Knirsch <pknirsch@redhat.com> 0.9.14-6
- Removed the ifcfg-irlan0 file. It shouldn't be installed by default. Moved it

80
irda.init Normal file
View file

@ -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