Control: tag -1 patch

Patches to build a udeb from bcache-tools.

There still needs to be a partman-bcache package, but that will be
separate from the bcache-tools source package.

Ben.

-- 
Ben Hutchings, Software Developer                         Codethink Ltd
https://www.codethink.co.uk/                 Dale House, 35 Dale Street
                                     Manchester, M1 2HF, United Kingdom
From 36ad5a36cfccb9a8afeba2e20c7b31f453147c1f Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben.hutchi...@codethink.co.uk>
Date: Tue, 23 Jun 2020 22:13:57 +0100
Subject: [PATCH 1/2] Create required directories from Makefile, not through
 dh_installdirs

This is needed as preparation for building multiple binary packages.
---
 debian/bcache-tools.dirs                      |  4 ---
 debian/changelog                              |  7 ++++++
 ...tall-create-all-required-directories.patch | 25 +++++++++++++++++++
 debian/patches/series                         |  1 +
 4 files changed, 33 insertions(+), 4 deletions(-)
 delete mode 100644 debian/bcache-tools.dirs
 create mode 100644 debian/patches/makefile-install-create-all-required-directories.patch

diff --git a/debian/bcache-tools.dirs b/debian/bcache-tools.dirs
deleted file mode 100644
index 9edc4df53f01..000000000000
--- a/debian/bcache-tools.dirs
+++ /dev/null
@@ -1,4 +0,0 @@
-lib/udev/rules.d/
-usr/sbin/
-usr/share/initramfs-tools/hooks/
-usr/share/man/man8/
diff --git a/debian/changelog b/debian/changelog
index c00c950bdf55..7af0fb2844f0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+bcache-tools (1.0.8-4.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Create required directories from Makefile, not through dh_installdirs
+
+ -- Ben Hutchings <ben.hutchi...@codethink.co.uk>  Tue, 23 Jun 2020 21:51:29 +0100
+
 bcache-tools (1.0.8-4) unstable; urgency=medium
 
   [ Debian Janitor ]
diff --git a/debian/patches/makefile-install-create-all-required-directories.patch b/debian/patches/makefile-install-create-all-required-directories.patch
new file mode 100644
index 000000000000..6ceb91e3a572
--- /dev/null
+++ b/debian/patches/makefile-install-create-all-required-directories.patch
@@ -0,0 +1,25 @@
+From: Ben Hutchings <ben.hutchi...@codethink.co.uk>
+Date: Tue, 23 Jun 2020 22:10:49 +0100
+Subject: Makefile: install: Create all required directories
+
+Create all the required directories under $(DESTDIR) rather than
+assuming they already exist.  During a package build they normally
+won't.
+---
+--- a/Makefile
++++ b/Makefile
+@@ -8,10 +8,10 @@ CFLAGS+=-O2 -Wall -g
+ all: make-bcache probe-bcache bcache-super-show bcache-register
+ 
+ install: make-bcache probe-bcache bcache-super-show
+-	$(INSTALL) -m0755 make-bcache bcache-super-show	$(DESTDIR)${PREFIX}/sbin/
+-	$(INSTALL) -m0755 probe-bcache bcache-register bcache-keep-symlinks	$(DESTDIR)$(UDEVLIBDIR)/
+-	$(INSTALL) -m0644 69-bcache.rules	$(DESTDIR)$(UDEVLIBDIR)/rules.d/
+-	$(INSTALL) -m0644 -- *.8 $(DESTDIR)${PREFIX}/share/man/man8/
++	$(INSTALL) -D -m0755 -t $(DESTDIR)${PREFIX}/sbin/	make-bcache bcache-super-show
++	$(INSTALL) -D -m0755 -t $(DESTDIR)$(UDEVLIBDIR)/	probe-bcache bcache-register bcache-keep-symlinks
++	$(INSTALL) -D -m0644 -t $(DESTDIR)$(UDEVLIBDIR)/rules.d/ 69-bcache.rules
++	$(INSTALL) -D -m0644 -t $(DESTDIR)${PREFIX}/share/man/man8/ -- *.8
+ 	$(INSTALL) -D -m0755 initramfs/hook	$(DESTDIR)/usr/share/initramfs-tools/hooks/bcache
+ 	$(INSTALL) -D -m0755 initcpio/install	$(DESTDIR)/usr/lib/initcpio/install/bcache
+ 	$(INSTALL) -D -m0755 dracut/module-setup.sh $(DESTDIR)$(DRACUTLIBDIR)/modules.d/90bcache/module-setup.sh
diff --git a/debian/patches/series b/debian/patches/series
index b3b2e4a5fe1a..50466176ad47 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 0001-Clean-should-remove-bcache-register.patch
 0002-Don-t-inline-crc64-for-gcc-5-compatibility.patch
 udev-keep-symlinks.patch
+makefile-install-create-all-required-directories.patch
From fea1a5175009682b84996e4f338c87eba6bbb9f5 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben.hutchi...@codethink.co.uk>
Date: Tue, 23 Jun 2020 22:29:23 +0100
Subject: [PATCH 2/2] Add a udeb (Closes: #774797)

Now that we have two binary packages, debhelper will install to debian/tmp
and we need to define what gets copied from there to each binary package.

* For bcache-tools, copy everything (debian/tmp/*)
* For bcache-tools-udeb, copy only the udev rules and the binaries
---
 debian/bcache-tools-udeb.install | 2 ++
 debian/bcache-tools.install      | 1 +
 debian/changelog                 | 1 +
 debian/control                   | 7 +++++++
 4 files changed, 11 insertions(+)
 create mode 100644 debian/bcache-tools-udeb.install
 create mode 100644 debian/bcache-tools.install

diff --git a/debian/bcache-tools-udeb.install b/debian/bcache-tools-udeb.install
new file mode 100644
index 000000000000..fcde3b1ce05c
--- /dev/null
+++ b/debian/bcache-tools-udeb.install
@@ -0,0 +1,2 @@
+lib/udev/*
+usr/sbin/*
diff --git a/debian/bcache-tools.install b/debian/bcache-tools.install
new file mode 100644
index 000000000000..d2d93a94827a
--- /dev/null
+++ b/debian/bcache-tools.install
@@ -0,0 +1 @@
+debian/tmp/* /
diff --git a/debian/changelog b/debian/changelog
index 7af0fb2844f0..4a0ce6435441 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ bcache-tools (1.0.8-4.1) UNRELEASED; urgency=medium
 
   * Non-maintainer upload.
   * Create required directories from Makefile, not through dh_installdirs
+  * Add a udeb (Closes: #774797)
 
  -- Ben Hutchings <ben.hutchi...@codethink.co.uk>  Tue, 23 Jun 2020 21:51:29 +0100
 
diff --git a/debian/control b/debian/control
index 634657cc87f2..0236b77ac508 100644
--- a/debian/control
+++ b/debian/control
@@ -22,3 +22,10 @@ Description: bcache userspace tools
  .
  This package includes udev rules, initramfs support, and the utilities to
  create a new bcache as well as inspect existing bcache partitions.
+
+Package: bcache-tools-udeb
+Section: debian-installer
+Architecture: linux-any
+Package-Type: udeb
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: bcache userspace tools, for debian-installer

Reply via email to