%define build_dkms 0 %{?_with_dkms:%define build_dkms 1} %{?_without_dkms:%define build_dkms 0} Name: ndiswrapper Version: 1.63 Release: %mkrel 3 Summary: NdisWrapper binary loader utility License: GPLv2 Group: System/Kernel and hardware URL: https://ndiswrapper.sourceforge.net/ Source0: https://prdownloads.sourceforge.net/ndiswrapper/%{name}-%{version}.tar.gz Source1: %{name}.bash-completion Source2: %{name}.pm-utils Patch0: ndiswrapper-1.59-cflags.patch Requires: kernel %if !%build_dkms Obsoletes: dkms-%{name} < %{version}-%{release} %endif %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 adapters 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 occasional computer lockups. %if %build_dkms %package -n dkms-%{name} Summary: DKMS ndiswrapper module: USUALLY NOT NEEDED License: GPLv2 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="%{optflags}" \ %make_build 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 < 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