From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6753266854416875520 X-Received: by 2002:a17:906:e2c2:: with SMTP id gr2mr35251686ejb.31.1573057601884; Wed, 06 Nov 2019 08:26:41 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:6a4f:: with SMTP id n15ls723776ejs.0.gmail; Wed, 06 Nov 2019 08:26:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzo6Zl6lcFGjzIdKg3uUQrFIAhlelNEqgaFjDY5/j2LgBdyyiSqoJhmS1RnDxufcyq7Nc9P X-Received: by 2002:a17:906:1d02:: with SMTP id n2mr4613984ejh.219.1573057601233; Wed, 06 Nov 2019 08:26:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573057601; cv=none; d=google.com; s=arc-20160816; b=btkuNDF+kCxqsudB0x9ZNfkrJVtx8ykLuFjUNrrOSvy9ykOUxB7l1vvkLkWJ0aAK1D O7PKcfTEJvMPIwGbCAlBerfkBYJYOvr1LcxTZC+xK7lGqO7z0QuzduNM3QCoHVOY8vwV l8NyZQ94KS3MtVGMMRtYuUwuv700kQmB9z++KZitVj6uFBPCLYv58rXLFz8mhF8dXPfW ekvNOyQ48DmkigC/jM1lvanckYwnvYvgwSVpRV+MMubBSf8UQhyzUJ3zhPvBOOMxE0fC 9v6YCts2XwYWpec068LMwvFb9U+sZcn2+wonfY9TQYOoeKkpfL5nlhh4JgbTaElHp9S1 DDng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=eQxOnxCyD/nVnfQvumSB7xPBmZuKVrWer/9Zbcl5t6g=; b=e9kquUN8bMAhuhkALMzMLTJK9vAZLoqSrapg5nwSzKJq9yxV1/OuUQ6dkBuOOPzE/R +Cx22aDpRUsrls01QTmbG0ivuvxrD5y1Idbk08Xla354v48gSLzYjF8GvuKITHRzD7A8 NxoNsXUZvqz//rqEcwyCyTujyKkAkdN6lbLqGYzkrpmU/ia1wvcbyACGvVJE5F8mBG3s AbhrefxxH5ZaQy6zKj2TLupyz8disa78IF+Xlyv6lAd36Q90D9FqHi3g1eE1Ea/48iNf A4yYIg7cMq+Q/u/kwRHs89/HzpIaBhXSikImo+WRh5yEmFoYpHvqJAZ/coHK6cRkHqLL FEpg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id l37si1744259edc.2.2019.11.06.08.26.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Nov 2019 08:26:41 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id xA6GQebl004396 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Nov 2019 17:26:40 +0100 Received: from [139.22.41.172] ([139.22.41.172]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id xA6GQdCc009852; Wed, 6 Nov 2019 17:26:39 +0100 Subject: Re: [PATCH 4/5] doc: write something about "debianize" To: Henning Schild , isar-users@googlegroups.com Cc: "Dalamagkidis, Konstantinos" References: <20191029164424.14681-1-henning.schild@siemens.com> <20191029164424.14681-5-henning.schild@siemens.com> From: Jan Kiszka Message-ID: <8d8c07bf-5bc3-6118-416e-1b4caad7b119@siemens.com> Date: Wed, 6 Nov 2019 17:26:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20191029164424.14681-5-henning.schild@siemens.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: ltOd9LhV1V9s On 29.10.19 17:44, Henning Schild wrote: > From: Henning Schild > > Also add some comments to the implementation and extend the example > recipe with some pre- and post-processing. > > Signed-off-by: Henning Schild > --- > doc/user_manual.md | 19 ++++++++++++++++++- > .../recipes-app/samefile/samefile_2.14.bb | 14 ++++++++++++++ > meta/classes/debianize.bbclass | 6 ++++++ > 3 files changed, 38 insertions(+), 1 deletion(-) > > diff --git a/doc/user_manual.md b/doc/user_manual.md > index 34f50df..7c23fcc 100644 > --- a/doc/user_manual.md > +++ b/doc/user_manual.md > @@ -583,7 +583,7 @@ Isar currently supports two ways of creating custom packages. > > The `deb` packages are built using `dpkg-buildpackage`, so the sources should contain the `debian` directory with necessary meta information. This way is the default way of adding software that needs to be compiled from source. The bbclass for this approach is called `dpkg`. > > -**NOTE:** If the sources do not contain a `debian` directory your recipe can fetch, create, or ship that. > +**NOTE:** If the sources do not contain a `debian` directory your recipe can fetch, create, or ship that. You might want to read the the next section before returning here. > > This is also what you do if you want to rebuild/modify an upstream package. > Isar does understand `SRC_URI` entries starting with "apt://". For an example > @@ -624,6 +624,23 @@ This approach prevents duplication of the license files in different packages. > > The last line in the example above adds recipe to the Isar work chain. > > +### Compilation of sources missing the debian/-directory > + > +The `debian` directory contains meta information on how to build a package from source. This is roughly speaking "configure", "compile", "install" all described in a Debian-specific way. > +Isar expects your sources to contain the `debian` folder and the above steps need to be described in it, not in a task in a recipe. > + > +So once you have sources you always need to combine them with a `debian` folder before Isar can build a package for you. > +You might be able to find a debianization for a component on the internet, i.e. Ubuntu does package an open source component while Debian does not. Your recipe could download the `debian` folder from Ubuntu and the sources from the open source project. > + > +You can write it yourself, which can be pretty easy but requires a bit of studying. > + > +Isar does actually contain a helper that aims to "debianize" sources for your. If your package uses a build-system that Debian knows and follows the well known "configure", "compile", "install" scheme that debianization might just fit your needs without reading Debian manuals. > +If it does not fully fit your needs, it probably gives you a good starting point for your manual tuning. > + > +The shell function `deb_debianize` creates a `debian` folder. But it will not overwrite files that already are in WORKDIR. So you can either just call it to fully generate the `debian` folder. Or you combine it with pre-existing parts. > + > +Have a look at meta-isar/recipes-app/samefile/samefile_2.14.bb and meta/classes/debianize.bbclass for an example and the implementation. > + > ### Packages without source > > If your customization is not about compiling from source there is a second way of creating `deb` packages. That way can be used for cases like: > diff --git a/meta-isar/recipes-app/samefile/samefile_2.14.bb b/meta-isar/recipes-app/samefile/samefile_2.14.bb > index a24d574..0ace85a 100644 > --- a/meta-isar/recipes-app/samefile/samefile_2.14.bb > +++ b/meta-isar/recipes-app/samefile/samefile_2.14.bb > @@ -12,5 +12,19 @@ SRC_URI[md5sum] = "0b438249f3549f18b49cbb49b0473f70" > > do_prepare_build[cleandirs] += "${S}/debian" > do_prepare_build() { > + # you could also create parts of your debianization before > + # pre-exisiting files will not be recreated Let's write sentences and separate them. > + # 42 is not actually valid ... this is just a stupid example > + echo 42 > "${WORKDIR}"/compat Don't we have a better example than writing something invalid which only needs to be reverted later on? > + > + # this step creates everything dpkg-buildpackage needs, compat will not be > + # overwritten > deb_debianize > + > + # now if you are not happy you can post-process the result > + # now let us "repair" the compat > + echo 9 > "${S}/debian/compat" Better append something to the generated file, maybe change the package category or so. > + # compat happens to be used by this step, so do that again > + # see debianize.bbclass > + deb_create_control > } > diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass > index fb9c234..e1c79ab 100644 > --- a/meta/classes/debianize.bbclass > +++ b/meta/classes/debianize.bbclass > @@ -76,23 +76,29 @@ EOF > } > > deb_debianize() { > + # create the compat-file if there is no file with that name in WORKDIR > if [ -f ${WORKDIR}/compat ]; then > install -v -m 644 ${WORKDIR}/compat ${S}/debian/compat > else > deb_create_compat > fi > + # create the control-file if there is no contro-file in WORKDIR control file > if [ -f ${WORKDIR}/control ]; then > install -v -m 644 ${WORKDIR}/control ${S}/debian/control > else > deb_create_control > fi > + # create rules if WORKDIR does not contain a rules-file > if [ -f ${WORKDIR}/rules ]; then > install -v -m 755 ${WORKDIR}/rules ${S}/debian/rules > else > deb_create_rules > fi > + # prepend a changelog-entry unless an existing changelog file already > + # contains an entry with CHANGELOG_V > deb_add_changelog > > + # copy all hooks from WORKDIR into debian/, hooks are not generated > for t in pre post > do > for a in inst rm > Jan -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux