--- rules_unpatched 2006-12-24 09:55:39.000000000 -0500 +++ rules_patched 2006-12-24 09:55:22.000000000 -0500 @@ -24,11 +24,31 @@ endif # kernel +# allow abi_version to be set on the command-line +ifdef CUSTOM_ABI +abi_version = $(CUSTOM_ABI) +else abi_version = 2 +endif + kernel_version = $(shell dpkg-parsechangelog | grep ^Source | sed 's/.*-//') kernel_abi_version = $(kernel_version)-$(abi_version) lrm_version = $(shell dpkg-parsechangelog | grep ^Version | awk '{print $$2}') +# should udebs be built? +# not yet supported in targets +# code will be something like +ifndef SKIP_UDEBS +UDEB_BINARIES = "build-udebs" +endif + +# build debian/control from which template? +ifdef CUSTOM_FLAVOUR +control_template = "control.stub.custom" +else +control_template = "control.stub.in" +endif + # nvidia nv_base_version=1.0 nv_release := 9631 @@ -70,8 +90,8 @@ FGLRX := 1 NVIDIA := 1 MADWIFI := 1 -FRITZ := 1 -LTMODEM := 1 +FRITZ := 0 +LTMODEM := 0 IPW3945 := 1 VMWARE := 1 VMDESCHED := 1 @@ -103,9 +123,15 @@ fcpci/src/fcpci \ fcusb/src/fcusb \ fxusb/src/fxusb +# check if a custom flavour is defined +ifdef CUSTOM_FLAVOUR +flavours := $(addprefix $(kernel_abi_version)-,$(CUSTOM_FLAVOUR)) +else flavours := $(addprefix $(kernel_abi_version)-,generic 386 lowlatency) endif +endif + ifeq "$(DEB_HOST_ARCH)" "amd64" export karch=x86_64 mw_target := TARGET=x86_64-elf @@ -129,7 +155,12 @@ fcdslusb/1/fritz/src/fcdslusb \ fcdslusb/2/fritz/src/fcdslusb2 \ fcpci/src/fcpci +# check if a custom flavour is defined +ifdef CUSTOM_FLAVOUR +flavours := $(addprefix $(kernel_abi_version)-,$(CUSTOM_FLAVOUR)) +else flavours := $(addprefix $(kernel_abi_version)-,generic lowlatency) +endif LTMODEM := 0 # no Winmodem support VMDESCHED := 0 endif @@ -137,7 +168,12 @@ ifeq "$(DEB_HOST_ARCH)" "ia64" export karch=ia64 mw_target := TARGET=ia64-elf +# check if a custom flavour is defined +ifdef CUSTOM_FLAVOUR +flavours := $(addprefix $(kernel_abi_version)-,$(CUSTOM_FLAVOUR)) +else flavours := $(addprefix $(kernel_abi_version)-,itanium mckinley) +endif NVIDIA := 0 # no real upstream nvidia support FGLRX := 0 # no fireGL support yet @@ -151,8 +187,12 @@ ifeq "$(DEB_HOST_ARCH)" "powerpc" export karch=powerpc mw_target := TARGET=powerpc-be-eabi +# check if a custom flavour is defined +ifdef CUSTOM_FLAVOUR +flavours := $(addprefix $(kernel_abi_version)-,$(CUSTOM_FLAVOUR)) +else flavours := $(addprefix $(kernel_abi_version)-,powerpc powerpc-smp powerpc64-smp) - +endif NVIDIA := 0 # no nVidia support yet FGLRX := 0 # no FireGL support yet FRITZ := 0 # no AVM Fritz support @@ -164,7 +204,12 @@ ifeq "$(DEB_HOST_ARCH)" "hppa" export karch=hppa mw_target := TARGET=hppa-be-eabi +# check if a custom flavour is defined +ifdef CUSTOM_FLAVOUR +flavours := $(addprefix $(kernel_abi_version)-,$(CUSTOM_FLAVOUR)) +else flavours := $(addprefix $(kernel_abi_version)-,hppa32 hppa64) +endif NVIDIA := 0 # no nVidia support yet FGLRX := 0 # no FireGL support yet @@ -178,7 +223,12 @@ ifeq "$(DEB_HOST_ARCH)" "sparc" export karch=sparc mw_target := TARGET=sparc-be-eabi +# check if a custom flavour is defined +ifdef CUSTOM_FLAVOUR +flavours := $(addprefix $(kernel_abi_version)-,$(CUSTOM_FLAVOUR)) +else flavours := $(addprefix $(kernel_abi_version)-,sparc64 sparc64-smp) +endif NVIDIA := 0 # no nVidia support yet FGLRX := 0 # no FireGL support yet @@ -568,12 +618,15 @@ touch build-avm-stamp debian/control: - echo '# THIS FILE IS AUTO-GENERATED FROM control.stub.in' > debian/control.stub + + echo '# THIS FILE IS AUTO-GENERATED FROM $(control_template)' > debian/control.stub sed -e 's/@@NV_VERSION@@/$(nv_version)/g' \ -e 's/@@NV_LEGACY_VERSION@@/$(nv_legacy_version)/g' \ -e 's/@@KVERSION@@/$(kernel_version)/g' \ -e 's/@@ABIVER@@/$(kernel_abi_version)/g' \ - debian/control.stub.in >> debian/control.stub + -e 's/@@CUSTOMFLAV@@/$(CUSTOM_FLAVOUR)/g' \ + debian/$(control_template) >> debian/control.stub +ifndef SKIP_UDEBS echo '# THIS FILE IS AUTO-GENERATED FROM kernel-versions.in' > debian/d-i/kernel-versions sed -e 's/@@ABIVER@@/$(kernel_abi_version)/g' \ debian/d-i/kernel-versions.in >> debian/d-i/kernel-versions @@ -581,8 +634,9 @@ mkdir -p $(udeb_prefix) cp -a debian/d-i/* $(udeb_prefix)/ ln -s .. $(udeb_prefix)/debian - (cd $(udeb_prefix) && kernel-wedge gen-control) > debian/control + (cd $(udeb_prefix) && kernel-wedge gen-control) > debian/control ; rm -rf $(udeb_prefix) +endif clean: debian/control dh_testdir @@ -1023,7 +1077,7 @@ dh_builddeb -i # Build architecture-dependent files here. -binary-arch: install build-udebs +binary-arch: install $(UDEB_BINARIES) dh_testdir dh_installchangelogs -s @@ -1071,7 +1125,11 @@ printenv: @echo "DEB_HOST_ARCH: $(DEB_HOST_ARCH)" @echo "flavours: $(flavours)" - + @echo "CUSTOM_FLAVOUR: $(CUSTOM_FLAVOUR)" + @echo "ABI: $(abi_version)" + @echo "UDEB_BINARIES $(UDEB_BINARIES)" + @echo "control template:$(control_template)" + binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install unpack build-kernel .PHONY: debian/control build-udebs