Package: zfs-dkms
Version: 0.7.6-1
Severity: wishlist
Tags: patch

--- Please enter the report below this line. ---

dkms mkbmdeb produces modules containing kernel modules,
but cannot be used without the associated spl-modules
package.

The attached patch uses a modified copy of
template-dkms-mkbmdeb from the dkms package, with an
added dependency on spl-modules|spl-dkms.
commit 8745d81500173e88daedd4c712721cfd963fb949
Author: Antonio Russo <[email protected]>
Date:   Sat Mar 31 15:24:41 2018 -0400

    Add spl-modules dependency to zfs-modules

diff --git a/debian/rules b/debian/rules
index f74e18de..a96b83ad 100755
--- a/debian/rules
+++ b/debian/rules
@@ -80,29 +80,31 @@ override_dh_auto_install:
 
 	@# Install the DKMS source.
 	@# We only want the files needed to build the modules
-	mkdir -p '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts'
-	cp '$(CURDIR)/scripts/enum-extract.pl' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/scripts'
-	$(foreach file,$(DKMSFILES),mv '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)' || exit 1;)
+	$(eval DKMS_DIR := '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)')
+	mkdir -p '$(DKMS_DIR)/scripts'
+	cp '$(CURDIR)/scripts/enum-extract.pl' '$(DKMS_DIR)/scripts'
+	cp -r '$(CURDIR)/debian/zfs-dkms-mkbmdeb' '$(DKMS_DIR)/'
+	$(foreach file,$(DKMSFILES),mv '$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/$(file)' '$(DKMS_DIR)' || exit 1;)
 	@# Hellish awk line:
 	@#  * Deletes from configure.ac the parts not needed for building the kernel module
 	@#     * It deletes from inside AC_CONFIG_FILES([]) everything except:
 	@#        (Makefile$|include/|module/|*.release$)
 	@#  * Takes care of spaces and tabs
 	awk '/^AC_CONFIG_FILES\(\[/,/^\]\)/ { if ($$0 !~ /^(AC_CONFIG_FILES\(\[([ \t]+)?$$|\]\)([ \t]+)?$$|([ \t]+)?(include\/|module\/|Makefile([ \t]+)?$$|zfs\.release([ \t]+)?$$))/){next} } {print}' \
-		'$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac'
+		'$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/configure.ac' > '$(DKMS_DIR)/configure.ac'
 	@# Set "SUBDIRS = module include" for CONFIG_KERNEL and remove SUBDIRS for all other configs.
 	sed '1,/CONFIG_KERNEL/s/SUBDIRS.*=.*//g;s/SUBDIRS.*=.*/SUBDIRS = module include/g;' \
-		'$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/Makefile.am' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/Makefile.am'
+		'$(CURDIR)/$(NAME)-$(DEB_VERSION_UPSTREAM)/Makefile.am' > '$(DKMS_DIR)/Makefile.am'
 	@# Sanity test
-	grep -q 'SUBDIRS = module include' '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/Makefile.am'
+	grep -q 'SUBDIRS = module include' '$(DKMS_DIR)/Makefile.am'
 	@# Run autogen on the stripped source tree
-	cd '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)'; ./autogen.sh
-	rm -fr '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/autom4te.cache'
+	cd '$(DKMS_DIR)'; ./autogen.sh
+	rm -fr '$(DKMS_DIR)/autom4te.cache'
 
 	@# This shunt allows DKMS to install the Module.symvers and zfs_config.h
 	@# files to the ${dkms_tree} area through the POST_INSTALL directive.
-	printf '#!/bin/sh\ncp "$$@"\n' > '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/cp'
-	chmod 755 '$(CURDIR)/debian/tmp/usr/src/$(NAME)-$(DEB_VERSION_UPSTREAM)/cp'
+	printf '#!/bin/sh\ncp "$$@"\n' > '$(DKMS_DIR)/cp'
+	chmod 755 '$(DKMS_DIR)/cp'
 
 	mkdir -p $(CURDIR)/debian/tmp/usr/lib
 	for i in `ls $(CURDIR)/debian/tmp/lib/*.so`; do \
diff --git a/debian/zfs-dkms-mkbmdeb/Makefile b/debian/zfs-dkms-mkbmdeb/Makefile
new file mode 100644
index 00000000..210b9984
--- /dev/null
+++ b/debian/zfs-dkms-mkbmdeb/Makefile
@@ -0,0 +1,18 @@
+#/usr/bin/make
+SRC = $(DESTDIR)/usr/src
+SHARE = $(DESTDIR)/usr/share/$(NAME)-dkms
+
+all:
+
+clean:
+
+install:
+
+#tarball, possibly with binaries
+ifeq ("$(wildcard $(NAME)-$(VERSION).dkms.tar.gz)", "$(NAME)-$(VERSION).dkms.tar.gz")
+	tar zxvf "$(NAME)-$(VERSION).dkms.tar.gz"
+	install -d "$(DESTDIR)/lib/modules/$(KVER)/updates/dkms/"
+	install -m 644 dkms_main_tree/$(KVER)/$(KARCH)/module/*.ko "$(DESTDIR)/lib/modules/$(KVER)/updates/dkms/"
+	rm -rf dkms_main_tree/ dkms_binaries_only/
+endif
+
diff --git a/debian/zfs-dkms-mkbmdeb/debian/.control.swp b/debian/zfs-dkms-mkbmdeb/debian/.control.swp
new file mode 100644
index 00000000..429477c2
Binary files /dev/null and b/debian/zfs-dkms-mkbmdeb/debian/.control.swp differ
diff --git a/debian/zfs-dkms-mkbmdeb/debian/README.Debian b/debian/zfs-dkms-mkbmdeb/debian/README.Debian
new file mode 100644
index 00000000..f8495d91
--- /dev/null
+++ b/debian/zfs-dkms-mkbmdeb/debian/README.Debian
@@ -0,0 +1,5 @@
+MODULE_NAME DKMS module for Debian
+
+This package was automatically generated by the DKMS system,
+for distribution on Debian based operating systems.
+
diff --git a/debian/zfs-dkms-mkbmdeb/debian/changelog b/debian/zfs-dkms-mkbmdeb/debian/changelog
new file mode 100644
index 00000000..b6cc91d8
--- /dev/null
+++ b/debian/zfs-dkms-mkbmdeb/debian/changelog
@@ -0,0 +1,6 @@
+DEBIAN_PACKAGE-dkms-bin (MODULE_VERSION) stable; urgency=low
+
+  * Automatically packaged by DKMS.
+
+ -- Dynamic Kernel Modules Support Team <[email protected]>  DATE_STAMP
+
diff --git a/debian/zfs-dkms-mkbmdeb/debian/compat b/debian/zfs-dkms-mkbmdeb/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/debian/zfs-dkms-mkbmdeb/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/zfs-dkms-mkbmdeb/debian/control b/debian/zfs-dkms-mkbmdeb/debian/control
new file mode 100644
index 00000000..8f7cf045
--- /dev/null
+++ b/debian/zfs-dkms-mkbmdeb/debian/control
@@ -0,0 +1,14 @@
+Source: DEBIAN_PACKAGE-dkms-bin
+Section: misc
+Priority: optional
+Maintainer: Dynamic Kernel Modules Support Team <[email protected]>
+Build-Depends: debhelper (>= 7), dkms
+Standards-Version: 3.8.1
+
+Package: DEBIAN_PACKAGE-modules-KERNEL_VERSION
+Architecture: DEBIAN_BUILD_ARCH
+Depends: ${misc:Depends}, linux-image-KERNEL_VERSION, spl-modules | spl-dkms
+Provides: DEBIAN_PACKAGE-modules
+Description: DEBIAN_PACKAGE binary drivers for linux-image-KERNEL_VERSION
+ This package contains DEBIAN_PACKAGE drivers for the KERNEL_VERSION Linux kernel,
+ built from DEBIAN_PACKAGE-dkms for the DEBIAN_BUILD_ARCH architecture.
diff --git a/debian/zfs-dkms-mkbmdeb/debian/copyright b/debian/zfs-dkms-mkbmdeb/debian/copyright
new file mode 100644
index 00000000..ad983f3d
--- /dev/null
+++ b/debian/zfs-dkms-mkbmdeb/debian/copyright
@@ -0,0 +1,2 @@
+
+This copyright has not been completed by the author of this package.
diff --git a/debian/zfs-dkms-mkbmdeb/debian/rules b/debian/zfs-dkms-mkbmdeb/debian/rules
new file mode 100755
index 00000000..5cd07317
--- /dev/null
+++ b/debian/zfs-dkms-mkbmdeb/debian/rules
@@ -0,0 +1,58 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+DEB_NAME=DEBIAN_PACKAGE
+NAME=MODULE_NAME
+VERSION=MODULE_VERSION
+KVER=KERNEL_VERSION
+
+configure: configure-stamp
+configure-stamp:
+	dh_testdir
+	touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp 
+	dh_testdir
+	$(MAKE)
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp configure-stamp
+	-$(MAKE) clean
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep
+	dh_installdirs
+	$(MAKE) DESTDIR=$(CURDIR)/debian/$(DEB_NAME)-modules-$(KVER) NAME=$(NAME) VERSION=$(VERSION) install
+
+binary-arch: build install
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_link
+	dh_strip
+	dh_compress
+	dh_installmodules
+	dh_installdocs
+	dh_installchangelogs
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure

Reply via email to