public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users@googlegroups.com
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCHv3 3/8] meta: move debianization code into a class and into dpkg-base
Date: Thu, 31 Jan 2019 15:18:11 +0100	[thread overview]
Message-ID: <20190131141816.32437-4-henning.schild@siemens.com> (raw)
In-Reply-To: <20190131141816.32437-1-henning.schild@siemens.com>

From: Henning Schild <henning.schild@siemens.com>

This is pure restructuring. Move the code into its own class and include
that in dpkg-base, it was available only in dpkg-raw before.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/debianize.bbclass | 85 ++++++++++++++++++++++++++++++++++
 meta/classes/dpkg-base.bbclass |  1 +
 meta/classes/dpkg-raw.bbclass  | 83 ---------------------------------
 3 files changed, 86 insertions(+), 83 deletions(-)
 create mode 100644 meta/classes/debianize.bbclass

diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
new file mode 100644
index 0000000..76b2ed3
--- /dev/null
+++ b/meta/classes/debianize.bbclass
@@ -0,0 +1,85 @@
+# This software is a part of ISAR.
+# Copyright (C) 2017-2019 Siemens AG
+
+deb_add_changelog() {
+	date=$( LANG=C date -R )
+	cat <<EOF > ${S}/debian/changelog
+${PN} (${PV}) UNRELEASED; urgency=low
+
+  * generated by Isar
+
+ -- ${MAINTAINER}  ${date}
+EOF
+	if [ -f ${WORKDIR}/changelog ]; then
+		echo >> ${S}/debian/changelog
+		cat ${WORKDIR}/changelog >> ${S}/debian/changelog
+	fi
+}
+
+deb_create_compat() {
+	echo 9 > ${S}/debian/compat
+}
+
+deb_create_control() {
+	compat=$( cat ${S}/debian/compat )
+	cat << EOF > ${S}/debian/control
+Source: ${PN}
+Section: misc
+Priority: optional
+Standards-Version: 3.9.6
+Maintainer: ${MAINTAINER}
+Build-Depends: debhelper (>= ${compat})
+
+Package: ${PN}
+Architecture: any
+Depends: ${DEBIAN_DEPENDS}
+Description: ${DESCRIPTION}
+EOF
+}
+
+DH_FIXPERM_EXCLUSIONS = \
+    "${@' '.join(['-X ' + x for x in \
+                  (d.getVar('PRESERVE_PERMS', False) or '').split()])}"
+
+deb_create_rules() {
+	cat << EOF > ${S}/debian/rules
+#!/usr/bin/make -f
+
+override_dh_fixperms:
+	dh_fixperms ${DH_FIXPERM_EXCLUSIONS}
+
+%:
+	dh \$@
+EOF
+	chmod +x ${S}/debian/rules
+}
+
+deb_debianize() {
+	if [ -f ${WORKDIR}/compat ]; then
+		install -v -m 644 ${WORKDIR}/compat ${S}/debian/compat
+	else
+		deb_create_compat
+	fi
+	if [ -f ${WORKDIR}/control ]; then
+		install -v -m 644 ${WORKDIR}/control ${S}/debian/control
+	else
+		deb_create_control
+	fi
+	if [ -f ${WORKDIR}/rules ]; then
+		install -v -m 755 ${WORKDIR}/rules ${S}/debian/rules
+	else
+		deb_create_rules
+	fi
+	deb_add_changelog
+
+	for t in pre post
+	do
+		for a in inst rm
+		do
+			if [ -f ${WORKDIR}/${t}${a} ]; then
+				install -v -m 755 ${WORKDIR}/${t}${a} \
+					${S}/debian/${t}${a}
+			fi
+		done
+	done
+}
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 2f324f9..175dc80 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -4,6 +4,7 @@
 # SPDX-License-Identifier: MIT
 
 inherit buildchroot
+inherit debianize
 
 DEPENDS ?= ""
 
diff --git a/meta/classes/dpkg-raw.bbclass b/meta/classes/dpkg-raw.bbclass
index a9143e9..0434313 100644
--- a/meta/classes/dpkg-raw.bbclass
+++ b/meta/classes/dpkg-raw.bbclass
@@ -17,89 +17,6 @@ do_install[cleandirs] = "${D}"
 do_install[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
 addtask install after do_unpack before do_prepare_build
 
-deb_add_changelog() {
-	date=$( LANG=C date -R )
-	cat <<EOF > ${D}/debian/changelog
-${PN} (${PV}) UNRELEASED; urgency=low
-
-  * generated by Isar
-
- -- ${MAINTAINER}  ${date}
-EOF
-	if [ -f ${WORKDIR}/changelog ]; then
-		echo >> ${D}/debian/changelog
-		cat ${WORKDIR}/changelog >> ${D}/debian/changelog
-	fi
-}
-
-deb_create_compat() {
-	echo 9 > ${D}/debian/compat
-}
-
-deb_create_control() {
-	compat=$( cat ${D}/debian/compat )
-	cat << EOF > ${D}/debian/control
-Source: ${PN}
-Section: misc
-Priority: optional
-Standards-Version: 3.9.6
-Maintainer: ${MAINTAINER}
-Build-Depends: debhelper (>= ${compat})
-
-Package: ${PN}
-Architecture: any
-Depends: ${DEBIAN_DEPENDS}
-Description: ${DESCRIPTION}
-EOF
-}
-
-DH_FIXPERM_EXCLUSIONS = \
-    "${@' '.join(['-X ' + x for x in \
-                  (d.getVar('PRESERVE_PERMS', False) or '').split()])}"
-
-deb_create_rules() {
-	cat << EOF > ${S}/debian/rules
-#!/usr/bin/make -f
-
-override_dh_fixperms:
-	dh_fixperms ${DH_FIXPERM_EXCLUSIONS}
-
-%:
-	dh \$@
-EOF
-	chmod +x ${S}/debian/rules
-}
-
-deb_debianize() {
-	if [ -f ${WORKDIR}/compat ]; then
-		install -v -m 644 ${WORKDIR}/compat ${D}/debian/compat
-	else
-		deb_create_compat
-	fi
-	if [ -f ${WORKDIR}/control ]; then
-		install -v -m 644 ${WORKDIR}/control ${D}/debian/control
-	else
-		deb_create_control
-	fi
-	if [ -f ${WORKDIR}/rules ]; then
-		install -v -m 755 ${WORKDIR}/rules ${D}/debian/rules
-	else
-		deb_create_rules
-	fi
-	deb_add_changelog
-
-	for t in pre post
-	do
-		for a in inst rm
-		do
-			if [ -f ${WORKDIR}/${t}${a} ]; then
-				install -v -m 755 ${WORKDIR}/${t}${a} \
-					${D}/debian/${t}${a}
-			fi
-		done
-	done
-}
-
 do_prepare_build[cleandirs] += "${D}/debian"
 do_prepare_build() {
 	cd ${D}
-- 
2.19.2


  parent reply	other threads:[~2019-01-31 14:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 14:18 [PATCHv3 0/8] apt-get source support Henning Schild
2019-01-31 14:18 ` [PATCHv3 1/8] conf: add deb-src entries to all our distro configs Henning Schild
2019-01-31 14:18 ` [PATCHv3 2/8] dpkg-base: introduce an "apt-get source" fetch/unpack step Henning Schild
2019-01-31 14:18 ` Henning Schild [this message]
2019-01-31 15:55   ` [PATCHv3 3/8] meta: move debianization code into a class and into dpkg-base Jan Kiszka
2019-01-31 14:18 ` [PATCHv3 4/8] debianize: allow changlog version change Henning Schild
2019-01-31 14:18 ` [PATCHv3 5/8] meta-isar/recipes-app: add upstream hello rebuild example Henning Schild
2019-01-31 15:56   ` Jan Kiszka
2019-01-31 14:18 ` [PATCHv3 6/8] local.conf: enable rebuilding "hello" for all distros Henning Schild
2019-01-31 14:18 ` [PATCHv3 7/8] meta: change apt source fetcher to hook into SRC_URI Henning Schild
2019-01-31 14:18 ` [PATCHv3 8/8] doc: document "apt://" fetch/unpack feature Henning Schild
2019-01-31 14:20 ` [PATCHv3 0/8] apt-get source support Henning Schild
2019-01-31 16:46   ` Henning Schild

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190131141816.32437-4-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox