Sophie

Sophie

distrib > Mageia > 6 > armv5tl > media > core-release-src > by-pkgid > b0448f42e16079f7ab9b21d2f22507f4 > files > 6

ndiswrapper-1.60-1.mga6.src.rpm

%define build_dkms 1
%{?_with_dkms:%define build_dkms 1}
%{?_without_dkms:%define build_dkms 0}


Name: 		ndiswrapper
Version: 	1.60
Release: 	%mkrel 1
Summary: 	NdisWrapper binary loader utility
License: 	GPL
Group: 		System/Kernel and hardware
URL:		http://ndiswrapper.sourceforge.net/
Source0:	http://prdownloads.sourceforge.net/ndiswrapper/%{name}-%{version}.tar.gz
Source1:	%{name}.bash-completion
Source2:	%{name}.pm-utils
Patch0:  	ndiswrapper-1.59-cflags.patch
Patch1:  	fix-build.patch
Requires: 	kernel

%description
Ndiswrapper implements the Windows kernel APIs within the Linux kernel.  This
allows you to use a Windows driver for a wireless network card. The driver
runs natively, as though it is in Windows, without binary emulation.  This is
not ideal, but is useful when a vendor does not provide Linux drivers and no
free and open driver exists.

With ndiswrapper, most miniPCI (builtin), PCI, PCMCIA (Cardbus only) or USB
wireless network adapteers work in Linux. Although ndiswrapper is intended for
wireless network cards, other devices are known to work, such as ethernet
cards, USB to serial port device, and home phone network devices.

Note that ndiswrapper is known to cause occational computer lockups.

%if %build_dkms
%package -n dkms-%{name}
Summary:	DKMS ndiswrapper module: USUALLY NOT NEEDED
License:	GPL
BuildArch:	noarch
Group:		System/Kernel and hardware
Requires(post,preun): dkms
Requires:	%{name} = %{version}

%description -n dkms-%{name}
** YOU ALMOST CERTAINLY SHOULD NOT INSTALL THIS PACKAGE **. It is only
useful if you are using a kernel with no ndiswrapper module of its own.
All official %{_vendor} kernel packages, and all kernel-tmb packages,
have their own ndiswrapper modules. If you are using one of these
kernels, DO NOT install this package.

DKMS package for %{name} kernel module.
%endif

%prep
%setup -q
%autopatch -p1

%build
pushd utils
CFLAGS="$RPM_OPT_FLAGS" \
%make
popd

%install
install -d $RPM_BUILD_ROOT%{_sysconfdir}/%{name}
install -m755 utils/loadndisdriver -D $RPM_BUILD_ROOT/sbin/loadndisdriver
install -m755 utils/ndiswrapper -D $RPM_BUILD_ROOT%{_sbindir}/ndiswrapper
install -m755 utils/ndiswrapper-buginfo -D $RPM_BUILD_ROOT%{_sbindir}/ndiswrapper-buginfo

install -d $RPM_BUILD_ROOT%{_mandir}/man8
install -m0644 ndiswrapper.8 $RPM_BUILD_ROOT%{_mandir}/man8/

%if %build_dkms
mkdir -p %{buildroot}/usr/src/%{name}-%{version}-%{release}
cp -a driver/* %{buildroot}/usr/src/%{name}-%{version}-%{release}
cat > %{buildroot}/usr/src/%{name}-%{version}-%{release}/dkms.conf <<EOF

PACKAGE_VERSION="%{version}-%{release}"

# Items below here should not have to change with each driver version
PACKAGE_NAME="%{name}"
MAKE[0]="make KVERS=\${kernelver} -C \${dkms_tree}/\${PACKAGE_NAME}/\${PACKAGE_VERSION}/build"
CLEAN="make -C \${kernel_source_dir} SUBDIRS=\${dkms_tree}/\${PACKAGE_NAME}/\${PACKAGE_VERSION}/build clean"

BUILT_MODULE_NAME[0]="\$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/kernel/3rdparty/%{name}"
MODULES_CONF_ALIAS_TYPE[0]="eth"

REMAKE_INITRD="no"
AUTOINSTALL=yes
EOF
%endif

install -d -m 755 $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/ndiswrapper
install -D -m 755 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/pm/config.d/%{name}

%post 
echo -e "please download binary driver (look at http://ndiswrapper.sourceforge.net/)\nuse ndiswrapper -i <inffile.inf> as root to install driver"

%if %build_dkms
%post -n dkms-%{name}
dkms add -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
dkms build -m %{name} -v %{version}-%{release} --rpm_safe_upgrade &&
dkms install -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --force
exit 0

%preun -n dkms-%{name}
dkms remove -m %{name} -v %{version}-%{release} --rpm_safe_upgrade --all
exit 0
%endif

%files
%doc AUTHORS README ChangeLog INSTALL
/sbin/loadndisdriver
%{_sbindir}/ndiswrapper
%{_sbindir}/ndiswrapper-buginfo
%{_sysconfdir}/%{name}
%config(noreplace)%{_sysconfdir}/bash_completion.d/%{name}
%{_sysconfdir}/pm/config.d/%{name}
%{_mandir}/man8/*

%if %build_dkms
%files -n dkms-%{name}
/usr/src/%{name}-%{version}-%{release}
%endif


%changelog
* Tue May 03 2016 tv <tv> 1.60-1.mga6
+ Revision: 1008992
- new release
- patch 1: fix build

* Mon Feb 01 2016 umeabot <umeabot> 1.59-4.mga6
+ Revision: 930762
- Mageia 6 Mass Rebuild

* Wed Oct 15 2014 umeabot <umeabot> 1.59-3.mga5
+ Revision: 741072
- Second Mageia 5 Mass Rebuild

* Tue Sep 16 2014 umeabot <umeabot> 1.59-2.mga5
+ Revision: 682822
- Mageia 5 Mass Rebuild

* Sat Nov 30 2013 tmb <tmb> 1.59-1.mga4
+ Revision: 554291
- update to 1.59 (kernel 3.12 support)

* Fri Oct 18 2013 umeabot <umeabot> 1.58-2.mga4
+ Revision: 522365
- Mageia 4 Mass Rebuild

* Fri Feb 22 2013 tmb <tmb> 1.58-1.mga3
+ Revision: 399971
- 1.58 (kernel-3.8 support)

* Wed Jan 23 2013 fwang <fwang> 1.57-4.mga3
+ Revision: 391284
- update rpm group

  + umeabot <umeabot>
    - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild

* Sun Nov 11 2012 fwang <fwang> 1.57-2.mga3
+ Revision: 317021
- set dkms package as noarch

* Sun Mar 04 2012 tmb <tmb> 1.57-1.mga2
+ Revision: 218157
- drop obsolete patches
- update to 1.57

* Sat May 21 2011 ahmad <ahmad> 1.56-4.mga1
+ Revision: 99999
- Replace a reference to Mandriva with Mageia

* Thu Mar 03 2011 ennael <ennael> 1.56-3.mga1
+ Revision: 63362
- imported package ndiswrapper