1
0
usb_modeswitch/usb_modeswitch.spec

111 lines
3.6 KiB
RPMSpec
Raw Normal View History

#
# spec file for package usb_modeswitch
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
Accepting request 759041 from home:enzokiel:branches:hardware - Update to version 2.6.0 * Removed included libjim source alltogether * Rewrote parts of the dispatcher script to make location of global config file into a parameter: --config-file, so it can be customised now * Replaced tcl helper file for jim embedding with a sh script, dropping the install dependency on a tcl interpreter (Attention maintainers!) * Changed Makefile to prevent parallel build issues as reported here: http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=2&t=2829, make targets have changed names (Attention maintainers!) - Update usb-modeswitch-data package to version 20191128 * Slight change of the 'skipping' rules to avoid unnecessary checks (thanks to Florian Zumbiehl) * Added devices: [03f0:0857] HP lt4220, [05c6:1000:uMa=Qualcomm] Venus Fast2, [0bda:1a2b] D-Link DWA-171 Wifi Dongle, [0e8d:2870] COMFAST CF-WU782AC WiFi Dongle, [12d1:15ee] Vodafone/Huawei K5160, [12d1:1f0a] Vodafone/Huawei R218h (lkly compat. to E5573cs), [1410:9030] Novatel USB730L, [1410:b00c] Novatel MiFi 6620L, [15eb:a403] Abit AK-020, [161c:f010] KuWfi 4g LTE, [19d2:1421] ZTE MF833V / Telewell TW-LTE v2, [1c9e:3003] 4G System XS W21s, [1c9e:f030] JioFi JMR1040, [2001:ac01] D-Link DWM-222 A2, [2020:2030] Telewell TW-LTE / Olicard 600 / Digisol BG-BA4305, [2357:0601] TP-Link UE300, [2fd4:9aff] 4G Systems W1208, [413c:81a2] Dell DW5806, [413c:81a3] Dell DW5570, [413c:81a4] Dell DW5570e, [413c:81a8] Dell DW5808, [413c:81b1] Dell DW5809e, [413c:81b3] Dell DW5809e, [413c:81d7] Dell DW5821e, [413c:81e0] Dell DW5821e-eSIM * Corrected/amended configs: [057c:62ff] AVM Fritz!Wlan USB Sticks (added target 8602), [1199:0fff] Sierra devices (3 erroneous target IDs removed) - Fixed usb_modeswitch-fix_fsf_address.patch OBS-URL: https://build.opensuse.org/request/show/759041 OBS-URL: https://build.opensuse.org/package/show/hardware/usb_modeswitch?expand=0&rev=79
2020-01-02 10:08:53 +01:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define source_name usb-modeswitch
%define date 20191128
%define _udevdir %(pkg-config --variable=udevdir udev)
Name: usb_modeswitch
Version: 2.6.1
Release: 0
Summary: A mode switching tool for controlling multiple-device USB gear
License: GPL-2.0-or-later
Group: Hardware/Mobile
URL: https://www.draisberghof.de/usb_modeswitch/
Source0: https://www.draisberghof.de/usb_modeswitch/%{source_name}-%{version}.tar.bz2
Source1: https://www.draisberghof.de/usb_modeswitch/%{source_name}-data-%{date}.tar.bz2
Source2: https://www.draisberghof.de/usb_modeswitch/device_reference.txt
Source3: https://www.draisberghof.de/usb_modeswitch/parameter_reference.txt
Patch1: usb_modeswitch-fix_fsf_address.patch
Patch2: harden_usb_modeswitch@.service.patch
BuildRequires: fdupes
BuildRequires: pkgconfig
BuildRequires: pkgconfig(libusb-1.0)
BuildRequires: pkgconfig(systemd)
BuildRequires: pkgconfig(udev)
Requires: tcl >= 8.4
Requires: usb_modeswitch-data = %{version}
%{?systemd_requires}
%description
USB_ModeSwitch is a mode switching tool for controlling "flip flop"
(multiple device) USB gear. It allows so-called "Zero-CD" devices that
show up as USB storage initially to be switched into their more useful
"application mode". This is most common for UMTS/3G wireless WAN
devices.
%package data
Summary: Data Files for USB Modeswitch
Group: Hardware/Mobile
Requires: %{name} = %{version}
BuildArch: noarch
%description data
Data files for usb_modeswitch package.
%prep
%setup -q -a1 -n %{source_name}-%{version}
%patch -P 1
%patch -P 2 -p1
cp %{SOURCE2} .
cp %{SOURCE3} .
%build
CFLAGS="%{optflags}" make
%install
# The install target recreates usb_modeswitch_dispatcher, which is racy in respect to its
# installation. install-common just uses the file from the build phase. boo#998641
make DESTDIR=%{buildroot} install-common %{?_smp_mflags} UDEVDIR=%{buildroot}%{_udevdir}
install -Dm 444 usb_modeswitch@.service %{buildroot}%{_unitdir}/usb_modeswitch@.service
cd %{source_name}-data-%{date}
make DESTDIR=%{buildroot} install %{?_smp_mflags} RULESDIR=%{buildroot}%{_udevdir}/rules.d
%fdupes -s %{buildroot}
%pre
%service_add_pre usb_modeswitch@.service
%post
%service_add_post usb_modeswitch@.service
%preun
%service_del_preun usb_modeswitch@.service
%postun
%service_del_postun usb_modeswitch@.service
%files
%license COPYING
%doc README device_reference.txt parameter_reference.txt
%{_sbindir}/usb_modeswitch
%{_sbindir}/usb_modeswitch_dispatcher
%{_udevdir}/usb_modeswitch
%{_unitdir}/usb_modeswitch@.service
%{_localstatedir}/lib/usb_modeswitch
%config %{_sysconfdir}/usb_modeswitch.conf
%{_mandir}/man1/usb_modeswitch.1%{?ext_man}
%{_mandir}/man1/usb_modeswitch_dispatcher.1%{?ext_man}
%files data
%{_datadir}/usb_modeswitch/
%{_udevdir}/rules.d/40-usb_modeswitch.rules
%changelog