automatic update by autodist [release 2.1.0-1mamba;Wed Feb 26 2014]

This commit is contained in:
Automatic Build System 2024-01-05 18:51:09 +01:00
parent bc8e7e4a6a
commit 31097ad359
4 changed files with 193 additions and 0 deletions

View File

@ -1,2 +1,4 @@
# usb-modeswitch
USB-ModeSwitch is a mode switching tool for controlling "flip flop" (multiple device) USB gear, like some usb 3G Modems.

View File

@ -0,0 +1,51 @@
diff -Nru usb-modeswitch-1.1.9.orig/usb_modeswitch.tcl usb-modeswitch-1.1.9/usb_modeswitch.tcl
--- usb-modeswitch-1.1.9.orig/usb_modeswitch.tcl 2011-08-05 23:40:30.000000000 +0200
+++ usb-modeswitch-1.1.9/usb_modeswitch.tcl 2011-09-28 20:56:40.235554246 +0200
@@ -85,30 +85,35 @@
# providing these attributes - or not. So more probing
# is needed
-if {[string length [lindex $argList 0]] == 0} {
+set devdir ""
+
+if {![string length [lindex $argList 0]] == 0} {
+ set dev_top [lindex $argList 0]
+ if {[regexp {(.*?):} $dev_top d dev_top]} {
+ set devdir /sys/bus/usb/devices/$dev_top
+ }
+}
+
+if {$devdir eq "" || ![file isdirectory $devdir]} {
+ Log "Top sysfs directory not found using bus id or bus id not given ($devdir); trying with kernel name!"
if {[string length [lindex $argList 1]] == 0} {
Log "No device number values given from udev! Exiting"
SafeExit
} else {
- Log "Bus ID for device not given by udev."
Log " Trying to determine it from kernel name ([lindex $argList 1]) ..."
if {![regexp {(.*?):} [lindex $argList 1] d dev_top]} {
Log "Could not determine top device dir from udev values! Exiting"
SafeExit
}
+ set devdir /sys/bus/usb/devices/$dev_top
+ if {![file isdirectory $devdir]} {
+ Log "Top sysfs directory not found ($devdir)! Exiting"
+ SafeExit
+ }
}
-} else {
- set dev_top [lindex $argList 0]
- regexp {(.*?):} $dev_top d dev_top
-}
-
-
-set devdir /sys/bus/usb/devices/$dev_top
-if {![file isdirectory $devdir]} {
- Log "Top sysfs directory not found ($devdir)! Exiting"
- SafeExit
}
+Log "Top sysfs directory found ($devdir)"
# Mapping of the short string identifiers (in the config
# file names) to the long name used here

View File

@ -0,0 +1,24 @@
diff -Nru usb-modeswitch-2.0.1.orig/Makefile usb-modeswitch-2.0.1/Makefile
--- usb-modeswitch-2.0.1.orig/Makefile 2013-09-03 19:22:05.000000000 +0200
+++ usb-modeswitch-2.0.1/Makefile 2013-09-13 15:12:16.343639973 +0200
@@ -85,7 +85,7 @@
install -D --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher
install -d $(DESTDIR)/var/lib/usb_modeswitch
test -d $(UPSDIR) -a -e /sbin/initctl && install --mode=644 usb-modeswitch-upstart.conf $(UPSDIR) || test 1
- test -d $(SYSDIR) -a -e /usr/bin/systemctl && install --mode=644 usb_modeswitch@.service $(SYSDIR) || test 1
+ test -d $(SYSDIR) -a -e /bin/systemctl && install --mode=644 usb_modeswitch@.service $(SYSDIR) || test 1
install: install-script
diff -Nru usb-modeswitch-2.0.1.orig/usb_modeswitch.sh usb-modeswitch-2.0.1/usb_modeswitch.sh
--- usb-modeswitch-2.0.1.orig/usb_modeswitch.sh 2013-09-03 19:21:08.000000000 +0200
+++ usb-modeswitch-2.0.1/usb_modeswitch.sh 2013-09-13 15:12:30.847532159 +0200
@@ -84,7 +84,7 @@
if [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then
exec /sbin/initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$1
elif [ -e "/etc/systemd/system/usb_modeswitch@.service" ]; then
- exec /usr/bin/systemctl --no-block start usb_modeswitch@$1.service
+ exec /bin/systemctl --no-block start usb_modeswitch@$1.service
else
exec /usr/sbin/usb_modeswitch_dispatcher --switch-mode $1 &
fi

116
usb-modeswitch.spec Normal file
View File

@ -0,0 +1,116 @@
Name: usb-modeswitch
Version: 2.1.0
Release: 1mamba
Summary: USB-ModeSwitch is a mode switching tool for controlling "flip flop" (multiple device) USB gear
Group: Applications/Networking
Vendor: openmamba
Distribution: openmamba
Packager: Ercole 'ercolinux' Carpanetto <ercole69@gmail.com>
URL: http://www.draisberghof.de/usb_modeswitch/
Source: http://www.draisberghof.de/usb_modeswitch/usb-modeswitch-%{version}.tar.bz2
Patch0: %{name}-1.1.9-dispatcher_fix_usb_coldplug.patch
Patch1: usb-modeswitch-2.0.1-systemctl_path.patch
License: GPL
BuildRoot: %{_tmppath}/%{name}-%{version}-root
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
BuildRequires: libusbx-devel
## AUTOBUILDREQ-END
BuildRequires: systemd-core
Provides: usb_modeswitch
Obsoletes: usb_modeswitch
Requires: usb-modeswitch-data
%description
USB-ModeSwitch is a mode switching tool for controlling "flip flop" (multiple device) USB gear, like some usb 3G Modems.
%prep
%setup -q
#%patch0 -p1
%patch1 -p1
%build
%make CC=%{_host}-gcc
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%install
install -d %{buildroot}{%{_mandir}/man1,/lib/udev,%{_sysconfdir}}
%makeinstall
# don't install in /lib/systemd
install -D -m0644 usb_modeswitch@.service %{buildroot}%{_sysconfdir}/systemd/system/usb_modeswitch@.service
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%files
%defattr(-,root,root)
%{_sysconfdir}/usb_modeswitch.conf
%{_sysconfdir}/systemd/system/usb_modeswitch@.service
%{_sbindir}/usb_modeswitch
%{_sbindir}/usb_modeswitch_dispatcher
/lib/udev/usb_modeswitch
%{_mandir}/man1/usb_modeswitch.1*
%{_mandir}/man1/usb_modeswitch_dispatcher.1*
%dir %{_localstatedir}/lib/usb_modeswitch
%changelog
* Wed Feb 26 2014 Automatic Build System <autodist@mambasoft.it> 2.1.0-1mamba
- automatic update by autodist
* Thu Sep 12 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 2.0.1-2mamba
- rebuilt with systemd support
- provide /var/lib/usb_modeswitch directory
* Sun Sep 08 2013 Automatic Build System <autodist@mambasoft.it> 2.0.1-1mamba
- automatic update by autodist
* Fri Aug 09 2013 Automatic Build System <autodist@mambasoft.it> 1.2.7-1mamba
- automatic update by autodist
* Mon Jun 03 2013 Automatic Build System <autodist@mambasoft.it> 1.2.6-1mamba
- automatic version update by autodist
* Tue Nov 13 2012 Automatic Build System <autodist@mambasoft.it> 1.2.5-1mamba
- automatic version update by autodist
* Thu Aug 23 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.4-1mamba
- update to 1.2.4
* Fri May 18 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 1.2.3-1mamba
- update to 1.2.3
* Wed Sep 28 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.9-2mamba
- made a patch to usb_modeswitch_dispatcher that tries to find sysfs directory using kernel name if bus id fails (what happens at boot)
* Mon Aug 08 2011 Automatic Build System <autodist@mambasoft.it> 1.1.9-1mamba
- automatic version update by autodist
* Sat Mar 05 2011 Automatic Build System <autodist@mambasoft.it> 1.1.7-1mamba
- automatic update by autodist
* Thu Dec 23 2010 Automatic Build System <autodist@mambasoft.it> 1.1.6-1mamba
- automatic update by autodist
* Mon Dec 06 2010 Automatic Build System <autodist@mambasoft.it> 1.1.5-1mamba
- automatic update by autodist
* Thu Oct 21 2010 Automatic Build System <autodist@mambasoft.it> 1.1.4-1mamba
- automatic update by autodist
* Sat Jun 26 2010 Automatic Build System <autodist@mambasoft.it> 1.1.3-1mamba
- automatic update by autodist
* Mon Apr 19 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 1.1.2-1mamba
- update to 1.1.2
* Sat Oct 31 2009 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 1.0.5-2mamba
- rebuild adding the udev rules
* Thu Oct 15 2009 Automatic Build System <autodist@mambasoft.it> 1.0.5-1mamba
- automatic update by autodist
* Mon Aug 24 2009 Automatic Build System <autodist@mambasoft.it> 1.0.4-1mamba
- automatic update by autodist
* Sat Aug 01 2009 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 1.0.2-1mamba
- package created by autospec