diff -Naur ndiswrapper-0.11/driver/Makefile ndiswrapper-0.11-bj/driver/Makefile --- ndiswrapper-0.11/driver/Makefile 2004-10-07 21:46:15.000000000 -0600 +++ ndiswrapper-0.11-bj/driver/Makefile 2004-10-15 16:04:40.000000000 -0600 @@ -10,7 +10,7 @@ KPSUB := $(shell echo $(KVERS) | sed -e 's/\([^\.]*\)\.\([^\.]*\)\..*/\1\2/') -INST_DIR := /lib/modules/$(KVERS)/misc +INST_DIR := $(DESTDIR)/lib/modules/$(KVERS)/misc SRC_DIR=$(shell pwd) @@ -114,7 +114,9 @@ install: default mkdir -p $(INST_DIR) install -m 0644 $(MODULE) $(INST_DIR) - /sbin/depmod -a + if [ -z $(DESTDIR) ]; then \ + /sbin/depmod -a; \ + fi; dist: @for file in $(DISTFILES); do \ diff -Naur ndiswrapper-0.11/Makefile ndiswrapper-0.11-bj/Makefile --- ndiswrapper-0.11/Makefile 2004-10-07 21:46:15.000000000 -0600 +++ ndiswrapper-0.11-bj/Makefile 2004-10-15 16:04:28.000000000 -0600 @@ -1,4 +1,6 @@ -include version +KERNELTARGET:=$(shell uname -r) +RPMSRCDIR=$(shell rpm --eval '%{_sourcedir}') distdir=ndiswrapper-${NDISWRAPPER_VERSION} distarchive=${distdir}.tar.gz @@ -9,17 +11,17 @@ .PHONY: all all: - make -C driver + make -C driver KVER=$(KERNELTARGET) make -C utils .PHONY: install install: - make -C driver install - make -C utils install - @if test -d /usr/man/man8; then \ - install -m 644 ndiswrapper.8 /usr/man/man8; \ + make -C driver install DESTDIR=$(DESTDIR) KVER=$(KERNELTARGET) + make -C utils install DESTDIR=$(DESTDIR) + @if test -d $(DESTDIR)/usr/man/man8; then \ + install -m 644 ndiswrapper.8 $(DESTDIR)/usr/man/man8; \ else \ - install -m 644 ndiswrapper.8 /usr/share/man/man8; \ + install -m 644 ndiswrapper.8 $(DESTDIR)/usr/share/man/man8; \ fi .PHONY: clean @@ -52,12 +54,10 @@ rpm: dist ndiswrapper.spec.in cat ndiswrapper.spec.in | sed s/NDISWRAPPER_VERSION/${NDISWRAPPER_VERSION}/ >ndiswrapper.spec - if test -d /usr/src/redhat/SOURCES ; then \ - cp $(distarchive) /usr/src/redhat/SOURCES ;\ - else \ - cp $(distarchive) /usr/src/RPM/SOURCES ; \ + -if test -d $(RPMSRCDIR); then \ + cp $(distarchive) $(RPMSRCDIR) ;\ fi - rpmbuild -ba ndiswrapper.spec + KERNELTARGET=$(KERNELTARGET) rpmbuild -ba ndiswrapper.spec deb: @if [ -d debian ]; then \ diff -Naur ndiswrapper-0.11/ndiswrapper.spec.in ndiswrapper-0.11-bj/ndiswrapper.spec.in --- ndiswrapper-0.11/ndiswrapper.spec.in 2004-10-07 21:46:15.000000000 -0600 +++ ndiswrapper-0.11-bj/ndiswrapper.spec.in 2004-10-15 16:03:05.000000000 -0600 @@ -6,6 +6,10 @@ Group: System Environment/Base URL: http://ndiswrapper.sourceforge.net Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%define kernelversion %(echo $KERNELTARGET) +%define kernelbuild /lib/modules/%{kernelversion}/build %description Some wireless LAN vendors refuse to release hardware specifications or @@ -15,12 +19,12 @@ around" NDIS (Windows network driver API) drivers. This rpm contains just the userspace tools. You will also need the kernel module rpm. -%package kernel-%(uname -r) +%package kernel-%{kernelversion} Summary: Ndiswrapper kernel module Group: System Environment/Base -Requires: kernel = %(uname -r), ndiswrapper = NDISWRAPPER_VERSION +Requires: kernel = %{kernelversion}, ndiswrapper = NDISWRAPPER_VERSION -%description kernel-%(uname -r) +%description kernel-%{kernelversion} Kernel module for ndiswrapper. @@ -29,11 +33,18 @@ %build -make all +# this should work, but permissions in build dir won't allow it, so kludge a +# little instead by making our own writable build directory +make all KSRC=%{kernelbuild} +#cp -ar %{kernelbuild} %{_tmppath} +#make all KSRC=%{_tmppath}/build %install -make install +mkdir -p %{buildroot}/lib/modules/%{kernelversion}/misc +mkdir -p %{buildroot}/sbin %{buildroot}/usr/sbin +mkdir -p %{buildroot}/usr/share/man/man8 +make install KSRC=%{_tmppath}/build DESTDIR=%{buildroot} %clean @@ -47,18 +58,21 @@ /usr/sbin/ndiswrapper %doc README AUTHORS ChangeLog INSTALL -%files kernel-%(uname -r) -/lib/modules/%(uname -r)/misc/ndiswrapper.* +%files kernel-%{kernelversion} +/lib/modules/%{kernelversion}/misc/ndiswrapper.* -%post kernel-%(uname -r) -/sbin/depmod -a +%post kernel-%{kernelversion} +/sbin/depmod -a -v %{kernelversion} > /dev/null -%postun kernel-%(uname -r) -/sbin/depmod -a +%postun kernel-%{kernelversion} +/sbin/depmod -a -v %{kernelversion} > /dev/null %changelog +* Fri Oct 15 2004 0.11-1 +- added ability to build against specific kernels as a normal user + * Tue Feb 3 2004 - - Initial build. diff -Naur ndiswrapper-0.11/utils/Makefile ndiswrapper-0.11-bj/utils/Makefile --- ndiswrapper-0.11/utils/Makefile 2004-10-07 21:46:16.000000000 -0600 +++ ndiswrapper-0.11-bj/utils/Makefile 2004-10-15 15:50:07.000000000 -0600 @@ -15,9 +15,9 @@ rm -f *~ *.o loadndisdriver install: all - install -m 755 loadndisdriver /sbin - install -m 755 ndiswrapper /usr/sbin - install -m 755 ndiswrapper-buginfo /usr/sbin + install -m 755 loadndisdriver $(DESTDIR)/sbin + install -m 755 ndiswrapper $(DESTDIR)/usr/sbin + install -m 755 ndiswrapper-buginfo $(DESTDIR)/usr/sbin dist: @for file in $(DISTFILES); do \