[PATCH] debianize: introduce DEBIAN_SECTION

8 views
Skip to first unread message

srinuv...@siemens.com

unread,
Oct 16, 2025, 5:40:26 AM (2 days ago) Oct 16
to isar-...@googlegroups.com, cedric.h...@siemens.com, felix.mo...@siemens.com, srinuvasan
From: srinuvasan <srinuv...@siemens.com>

Add support for setting the Section field in auto-generated control files.
This allows users to specify a custom section for their packages, making
it easier to categorize and identify them within the Debian archive.

By default, the section is set to "misc".

Also update the section for the isar-exclude-docs package as a demonstration.

Example:
DEBIAN_SECTION = "ui" # For UI-related packages
DEBIAN_SECTION = "utils" # For miscellaneous utilities

Signed-off-by: srinuvasan <srinuv...@siemens.com>
---
doc/user_manual.md | 1 +
meta/classes/debianize.bbclass | 4 +++-
.../isar-exclude-docs/isar-exclude-docs_0.2.2.bb | 2 ++
3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 6778d15c..4d81370e 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -1006,6 +1006,7 @@ Other (optional) customization variables include:
- `DEBIAN_PROVIDES` - declare a virtual package to satisfy dependencies
- `DEBIAN_REPLACES` - to replace a package with another
- `DEBIAN_BREAKS` - Packages which break other packages
+ - `DEBIAN_SECTION` - Specifies the category under which the package is classified

### Prebuilt .deb packages from somewhere

diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index 4989c601..dff7110b 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -8,6 +8,7 @@
CHANGELOG_V ??= "${PV}"
DPKG_ARCH ??= "any"
DEBIAN_BUILD_DEPENDS ??= ""
+DEBIAN_SECTION ??= "misc"
DEBIAN_DEPENDS ??= ""
DEBIAN_PROVIDES ??= ""
DEBIAN_REPLACES ??= ""
@@ -70,6 +71,7 @@ EOF


deb_create_control[vardeps] += "DEBIANIZE_BUILD_DEPENDS \
+ DEBIAN_SECTION \
DEBIAN_DEPENDS \
DEBIAN_PROVIDES \
DEBIAN_REPLACES \
@@ -78,7 +80,7 @@ deb_create_control[vardeps] += "DEBIANIZE_BUILD_DEPENDS \
deb_create_control() {
cat << EOF > ${S}/debian/control
Source: ${BPN}
-Section: misc
+Section: ${@ deb_list_beautify(d, 'DEBIAN_SECTION')}
Priority: optional
Standards-Version: 3.9.6
Maintainer: ${MAINTAINER}
diff --git a/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.2.2.bb b/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.2.2.bb
index 2b844bed..acca67c8 100644
--- a/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.2.2.bb
+++ b/meta/recipes-support/isar-exclude-docs/isar-exclude-docs_0.2.2.bb
@@ -4,6 +4,8 @@ inherit dpkg-raw
DESCRIPTION = "Configuration to exclude most documentation"
MAINTAINER = "isar-users <isar-...@googlegroups.com>"

+DEBIAN_SECTION = "utils"
+
SRC_URI = "file://${BPN} \
file://postinst"

--
2.39.5

Reply all
Reply to author
Forward
0 new messages