new file mode 100644
@@ -0,0 +1,16 @@
+
+# @package@ @version@ @suffix_minus@ @suffix_under@
+dkms_@module@_@suffix_under@_version=$(shell gawk '/^@package@ / { print $$2; }' debian/dkms-versions)
+@module@_@suffix_under@_upstream_version=$(shell echo "$(dkms_@module@_@suffix_under@_version)" | cut -d '-' -f 1)
+gencontrol_flags += -Vdkms:@module@-@suffix_minus@-modules="@module@-dkms-@suffix_minus@ (= $(dkms_@module@_@suffix_under@_version))"
+gencontrol_flags += -Vadditional-deps:@module@-@suffix_minus@="nvidia-kernel-common-@suffix_minus@ (<= $(@module@_@suffix_under@_upstream_version)-1), nvidia-kernel-common-@suffix_minus@ (>= $(@module@_@suffix_under@_upstream_version))"
+test::
+ @echo @package@ @version@ @suffix_minus@ @suffix_under@ @suffix_short@ @targets@
+@targets@::
+ rm -rf $(dkms_dir)/build $(dkms_dir)/source
+ mkdir -p $(dkms_dir)/build $(dkms_dir)/source
+ install -d debian/linux-modules-@module@-@suffix_minus@-$(src_abi)-@flavour@
+ install -d debian/linux-modules-@module@-@suffix_minus@-$(src_abi)-@flavour@/usr/lib/linux/triggers
+ $(call install_control,linux-modules-@module@-@suffix_minus@-$(src_abi)-@flavour@,@flavour@,@module@,@suffix_short@,postinst postrm prerm config templates)
+ install -d debian/linux-objects-@module@-@suffix_minus@-$(src_abi)-@flavour@
+ $(call build_dkms, $(src_abi)-@flavour@, linux-objects-@module@-@suffix_minus@-$(src_abi)-@flavour@, $(CURDIR)/debian/linux-objects-@module@-@suffix_minus@-$(src_abi)-@flavour@/lib/modules/$(src_abi)-@flavour@/kernel, "", @module@-@suffix_short@, pool/restricted/n/nvidia-graphics-drivers-@suffix_minus@/nvidia-kernel-source-@suffix_minus@_$(dkms_@module@_@suffix_under@_version)_$(arch).deb pool/restricted/n/nvidia-graphics-drivers-@suffix_minus@/nvidia-dkms-@suffix_minus@_$(dkms_@module@_@suffix_under@_version)_$(arch).deb)
@@ -145,24 +145,15 @@ EOL
echo "II: build $package for $flavour $pkg_archs"
# debian/rules.gen
- cat - >>"debian/rules.gen" <<EOL
-
-# $package $version $suffix_minus $suffix_under
-dkms_${module}_${suffix_under}_version=\$(shell gawk '/^${package} / { print \$\$2; }' debian/dkms-versions)
-${module}_${suffix_under}_upstream_version=\$(shell echo "\$(dkms_${module}_${suffix_under}_version)" | cut -d '-' -f 1)
-gencontrol_flags += -Vdkms:${module}-${suffix_minus}-modules="${module}-dkms-${suffix_minus} (= \$(dkms_${module}_${suffix_under}_version))"
-gencontrol_flags += -Vadditional-deps:${module}-${suffix_minus}="nvidia-kernel-common-${suffix_minus} (<= \$(${module}_${suffix_under}_upstream_version)-1), nvidia-kernel-common-${suffix_minus} (>= \$(${module}_${suffix_under}_upstream_version))"
-test::
- @echo $package $version $suffix_minus $suffix_under $suffix_short $targets
-$targets::
- rm -rf \$(dkms_dir)/build \$(dkms_dir)/source
- mkdir -p \$(dkms_dir)/build \$(dkms_dir)/source
- install -d debian/linux-modules-${module}-${suffix_minus}-\$(src_abi)-${flavour}
- install -d debian/linux-modules-${module}-${suffix_minus}-\$(src_abi)-${flavour}/usr/lib/linux/triggers
- \$(call install_control,linux-modules-${module}-${suffix_minus}-\$(src_abi)-${flavour},${flavour},${module},${suffix_short},postinst postrm prerm config templates)
- install -d debian/linux-objects-${module}-${suffix_minus}-\$(src_abi)-${flavour}
- \$(call build_dkms, \$(src_abi)-${flavour}, linux-objects-${module}-${suffix_minus}-\$(src_abi)-${flavour}, \$(CURDIR)/debian/linux-objects-${module}-${suffix_minus}-\$(src_abi)-${flavour}/lib/modules/\$(src_abi)-${flavour}/kernel, "", ${module}-${suffix_short}, pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-kernel-source-${suffix_minus}_\$(dkms_${module}_${suffix_under}_version)_\$(arch).deb pool/restricted/n/nvidia-graphics-drivers-${suffix_minus}/nvidia-dkms-${suffix_minus}_\$(dkms_${module}_${suffix_under}_version)_\$(arch).deb)
-EOL
+ sed -e "s/@flavour@/${flavour}/g" \
+ -e "s/@package@/${package}/g" \
+ -e "s/@version@/${version}/g" \
+ -e "s/@targets@/${targets}/g" \
+ -e "s/@module@/${module}/g" \
+ -e "s/@suffix_minus@/${suffix_minus}/g" \
+ -e "s/@suffix_under@/${suffix_under}/g" \
+ -e "s/@suffix_short@/${suffix_short}/g" \
+ "debian/rules.in.${module}" >>"debian/rules.gen"
# debian/control.d/meta-${module}
cat - >>"debian/control.d/meta-${module}" <<EOL