Control: -1 +patch

On Fri, Jan 27, 2017 at 11:18:26PM +0100, Geert Stappers wrote:
> 
>  What are the opinions about a 'jtag-adapter-udev' package?
> 
  ... snip ...
> 
> The above all together did bring me to make patches on OpenOCD
> that build a jtag-adapter-udev package. I'll send them
> to this bugreport.
> 

Find attached two patches.

The first creates the jtag-adapter-udev package.

The second reduces the size of that package.


Groeten
Geert Stappers
-- 
Leven en laten leven
>From ab876a7f87ac059a1eb57ac104c4bc7b6f69b301 Mon Sep 17 00:00:00 2001
From: Geert Stappers <stapp...@june.lan>
Date: Fri, 27 Jan 2017 20:05:06 +0100
Subject: [PATCH 1/2] Create a seperate Debian package for the udev rules

debian/control has jtag-adapter-udev defined.

debian/rules builds that package and got some modifications
on the previous udev rules file handling.
---
 debian/control |  9 +++++++++
 debian/rules   | 11 +++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index 96f7afe..179f5a1 100644
--- a/debian/control
+++ b/debian/control
@@ -19,6 +19,7 @@ Vcs-Git: git://anonscm.debian.org/crosstoolchain/openocd.git
 Package: openocd
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
+ , jtag-adapter-udev
 Description: Open on-chip JTAG debug solution for ARM and MIPS systems
  OpenOCD is an on-chip debugging, in-system programming and boundary-scan
  testing tool for ARM and MIPS systems.
@@ -33,3 +34,11 @@ Description: Open on-chip JTAG debug solution for ARM and MIPS systems
  .
  OpenOCD supports many different types of JTAG interfaces/programmers.
 
+Package: jtag-adapter-udev
+Architecture: all
+Depends: ${misc:Depends}
+Description: udev rules for JTAG adapters
+ This package prodives rules for the /dev/ and hotplug management daemon
+ called 'udev'.  It contains udev data about JTAG adapters.
+ These udev rules set permission on those devices.
+
diff --git a/debian/rules b/debian/rules
index 7b411fe..266b115 100755
--- a/debian/rules
+++ b/debian/rules
@@ -59,12 +59,16 @@ endif
 
 post-patches::
 	@# Copy udev rules file into debian/ so that dh_installudev finds it.
-	cp contrib/99-openocd.rules debian/openocd.udev
+	cp contrib/99-openocd.rules debian/jtag-adapter-udev.udev
 
 binary-install/openocd::
 	# Install the loaders/ subdir in /usr/share/doc.
 	cp -r contrib/loaders debian/openocd/usr/share/doc/openocd
 
+binary-install/jtag-adapter-udev::
+	@# to have some content in that yet empty package
+	mkdir -p debian/jtag-adapter-udev/lib/udev/rules.d
+
 binary-post-install/openocd::
 	@# Don't ship openocd.udev in /usr/share, dh_installudev handles it.
 	rm -f debian/openocd/usr/share/openocd/contrib/99-openocd.rules
@@ -73,9 +77,12 @@ binary-post-install/openocd::
 	@# Drop .la files
 	rm -f `find debian/openocd -name '*.la'`
 
+binary-post-install/jtag-adapter-udev::
+	@# This "makefile target" is to keep CDBS silent and happy
+
 clean::
 	@# Clean copied udev file.
-	rm -f debian/openocd.udev
+	rm -f debian/jtag-adapter-udev.udev
 
 # For /usr/share/cdbs/1/rules/utils.mk sanity check.
 common-binary-post-install-arch:: list-missing
-- 
2.8.1

>From b234a24cfc8a00c53f61864ce955155286cc01a6 Mon Sep 17 00:00:00 2001
From: Geert Stappers <stapp...@june.lan>
Date: Thu, 26 Jan 2017 08:07:28 +0100
Subject: [PATCH 2/2] Other, smaller, ChangeLog file to reduce the size of the
 -udev package

The ChangeLog is created as a Debian patch.
debian/rules install it with help of dh_installchangelogs

modified:   debian/patches/series
new file:   debian/patches/small_changelog_for_udev_package
modified:   debian/rules
---
 debian/patches/series                           |  1 +
 debian/patches/small_changelog_for_udev_package | 26 +++++++++++++++++++++++++
 debian/rules                                    |  2 ++
 3 files changed, 29 insertions(+)
 create mode 100644 debian/patches/small_changelog_for_udev_package

diff --git a/debian/patches/series b/debian/patches/series
index cfb54ad..f23bebe 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 #Patch-file list
+small_changelog_for_udev_package
diff --git a/debian/patches/small_changelog_for_udev_package b/debian/patches/small_changelog_for_udev_package
new file mode 100644
index 0000000..bf93e6e
--- /dev/null
+++ b/debian/patches/small_changelog_for_udev_package
@@ -0,0 +1,26 @@
+Description: create a small changelog file for the udev package
+ The package openocd has large upstream ChangeLog file.
+ Shipping that big file makes the jtag-adapter-udev package big.
+ A small changelog file will reduce the size of the udev package.
+ This patch creates that file.
+Author: Geert Stappers <stapp...@debian.org>
+Origin: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=852856
+Forwarded: not-needed
+Reviewed-by: <name and email of a reviewer, optional>
+Last-Update: 2017-01-27
+
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+
+Index: b/ChangeLog-udev
+===================================================================
+--- /dev/null
++++ b/ChangeLog-udev
+@@ -0,0 +1,8 @@
++
++The jtag-adapter udev package has no real ChangeLog file.
++
++Only this "placeholder file".
++Purpose of this file is to reduce
++the size of the jtag-adapter-udev package.
++
++# l l
diff --git a/debian/rules b/debian/rules
index 266b115..93ba0b0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -68,6 +68,8 @@ binary-install/openocd::
 binary-install/jtag-adapter-udev::
 	@# to have some content in that yet empty package
 	mkdir -p debian/jtag-adapter-udev/lib/udev/rules.d
+	@# install a small upstream ChangeLog file
+	dh_installchangelogs -pjtag-adapter-udev ./ChangeLog-udev
 
 binary-post-install/openocd::
 	@# Don't ship openocd.udev in /usr/share, dh_installudev handles it.
-- 
2.8.1

Reply via email to