File huawei_umtsmodem.spec of Package huawei_umtsmodem

#
# spec file for package huawei_umtsmodem (Version 1.0.0)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild


Name:           huawei_umtsmodem
BuildRequires:  libusb-devel
License:        GPL
Group:          Development/Tools/Version Control
Requires:       udev, usbutils
AutoReqProv:    on
Summary:        Initialize Huawei UMTS (HSDPA) modems
Version:        1.0.0
Release:        1
Url:            http://www.sourceforge.net/projects/esniper
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source0:        http://www.kanoistika.sk/bobovsky/archiv/umts/huaweiAktBbo.c
Source1:        50-huawei-modem.rules
Source2:        huawei_modem_add.sh
Source3:        README
Patch0:         huaweiAktBbo-english.patch
Patch1:         huaweiAktBbo-with_argv.patch

%description
Huawei UMTS (HSDPA) modems, such as E220 or E169G (E620), require special
initialization after the device is plugged in. This can automatically be
done via rules in udev system.
 
The package needs a more recent kernel, so building for old
openSUSE/SLES/SLED distribution doesn't make sense and is disabled.
openSUSE 11.0 (and later) is recommended, but there are chances that it
works in openSUSE 10.3 too, but it was never tested.

Authors:
--------
	Miroslav Bobovsky <bobovsky@kanoistika.sk>
	Klaus Singvogel <kssingvo@suse.de>

%prep
%setup -c -T
install -m 644 %{SOURCE0} .
install -m 644 %{SOURCE3} .
%patch0 -p1
%patch1 -p1
%if 0%{?suse_version} >= 1130
sed -i 's/SYSFS/ATTR/g' %{SOURCE1}
%endif

%build
gcc -o huaweiAktBbo $RPM_OPT_FLAGS huaweiAktBbo.c -lusb

%install
install -d -m 755 $RPM_BUILD_ROOT/etc/udev/rules.d/
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/etc/udev/rules.d/
install -d -m 755 $RPM_BUILD_ROOT/lib/udev/
install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/lib/udev
install -d -m 755 $RPM_BUILD_ROOT/usr/sbin
install -m 755 huaweiAktBbo $RPM_BUILD_ROOT/usr/sbin

%clean
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root)
%dir /etc/udev
%dir /etc/udev/rules.d
%config(noreplace) /etc/udev/rules.d/50-huawei-modem.rules
%dir /lib/udev
/lib/udev/huawei_modem_add.sh
/usr/sbin/huaweiAktBbo
%doc README

%changelog
openSUSE Build Service is sponsored by