From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6460145516460113920 X-Received: by 10.25.158.132 with SMTP id h126mr260213lfe.6.1504119838054; Wed, 30 Aug 2017 12:03:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.6.1 with SMTP id 1ls459339ljg.54.gmail; Wed, 30 Aug 2017 12:03:57 -0700 (PDT) X-Google-Smtp-Source: ADKCNb6IOv/Zk4xkcmJX3R6hRcuf4a4WQSJJxnzrjpkhAu4PLvXWxXHFr/Zx2kJ3H5Z13ORI0lpD X-Received: by 10.25.19.26 with SMTP id j26mr249814lfi.9.1504119837612; Wed, 30 Aug 2017 12:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504119837; cv=none; d=google.com; s=arc-20160816; b=ujMeJfMd1FgNJolVrhZGM/gnIvCuF33+i9p5uf4rpl6BOmmJ0pzCNPsgLO69mFuzWL 5LK5YdRU5oE06YCiULBKcJ6Ag4L/WA57yAERZ+cLlDWgvTDlB6kLshHil54quKFO75JH M+eHOl4K5rU/hF2rNlJe5GUnNSFQXyvl7/PoMeH/zm/lbogqCwrr6YBP3gEKJhZGpQE9 +TmQK4v6Rz1h5ato8gq9r3uxDxZgL4hoRe4VhS+aGv+cbFJBj9x1GdBD0x3/yebr1YMV 0p9qCaqwuUqNQ07Bbws8hAqYxNg2fUCsVfURp8zOacqBsfTxF0+lJ8JQl60l1z0hThSS NDfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=e4JjZ1H5Aif1cVZhdk27rpzYVnvj1i4kUPJyKk8+6QQ=; b=EV86nwgGAPvHsE2tqrn+1q8CBwhLHH02EIqqlUVly74ItS9F0B4NqqEgko8jJkdxv8 VqhEepK5RyGwwMsSHIPRJOo2bCgK+6mRzHja8MLSrXeVYk68rarhHcw/agVOcmsabHXx 98n/pjtN+D62M0KKfSv4krTYLp3hyrJvc5baSZrFlHUG6VmKeUBUC0nc4+7gZgrAEYe+ FN5c0e4yh62mLi+PyghQIpbwOZ2wQCD7+W2zf/aaFYH2tTMIs0pkzkFdS2UikJCD0PIn 7yPY6bW+flKRpLhbkLeXlOexu0vGfoVgVz39BvdGS6ZAgx06uu3bAcpLxzzJKrTAXWGi lmgQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id v7si60709wmb.3.2017.08.30.12.03.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Aug 2017 12:03:57 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.14 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id v7UJ3uKT015308 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Aug 2017 21:03:56 +0200 Received: from md1em3qc.ad001.siemens.net ([139.25.68.40]) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id v7UJ3t5l027281; Wed, 30 Aug 2017 21:03:56 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Alexander Smirnov , Christian Storm , Claudius Heine , Henning Schild Subject: [PATCH 6/6] recipes-app/example-custom: add example on how to use dpkg-custom Date: Wed, 30 Aug 2017 21:03:57 +0200 Message-Id: <3dabf24441bb486c830ef72df228848206b1bef5.1504119538.git.henning.schild@siemens.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: References: In-Reply-To: References: X-TUID: M/BfiZcxfEy+ Issue: It might not be clear to a user how to make use of the class dpkg-custom. Change: Add an example that demonstrates some features. Impact: This patch does not change the behaviour of Isar. It addresses the issue partially, documentation would also be useful. Signed-off-by: Henning Schild --- .../example-custom/example-custom_0.1.bb | 35 ++++++++++++++++++++++ meta-isar/recipes-app/example-custom/files/README | 1 + .../recipes-app/example-custom/files/postinst | 16 ++++++++++ 3 files changed, 52 insertions(+) create mode 100644 meta-isar/recipes-app/example-custom/example-custom_0.1.bb create mode 100644 meta-isar/recipes-app/example-custom/files/README create mode 100644 meta-isar/recipes-app/example-custom/files/postinst diff --git a/meta-isar/recipes-app/example-custom/example-custom_0.1.bb b/meta-isar/recipes-app/example-custom/example-custom_0.1.bb new file mode 100644 index 0000000..efa813e --- /dev/null +++ b/meta-isar/recipes-app/example-custom/example-custom_0.1.bb @@ -0,0 +1,35 @@ +# Sample application using dpkg-custom, which turns a folder (${D}) of +# files into a .deb +# +# This software is a part of ISAR. + +DESCRIPTION = "Sample application for ISAR" +MAINTAINER = "Your name here " +DEBIAN_DEPENDS = "apt" + +SRC_URI = "file://README \ + file://postinst" + +inherit dpkg-custom + +do_populate_package() { + bbnote "Creating ${PN} binary" + echo "#!/bin/sh" > ${WORKDIR}/${PN} + echo "echo Hello ISAR! ${PN}_${PV}" >> ${WORKDIR}/${PN} + + bbnote "Putting ${PN} into package" + install -v -d ${D}/usr/local/bin/ + install -v -m 755 ${WORKDIR}/${PN} ${D}/usr/local/bin/${PN} + + bbnote "Now copy ${FILESDIR}/README into package" + install -v -d ${D}/usr/local/doc/ + install -v -m 644 ${WORKDIR}/README ${D}/usr/local/doc/README-${P} + + bbnote "Now for a debian hook, see dpkg-deb" + install -v -m 755 ${WORKDIR}/postinst ${D}/DEBIAN/postinst + + bbnote "Now for a fake config file" + echo "# empty config file" > ${WORKDIR}/${PN}.conf + install -v -d ${D}/usr/local/etc/ + install -v -m 644 ${WORKDIR}/${PN}.conf ${D}/usr/local/etc/${PN}.conf +} diff --git a/meta-isar/recipes-app/example-custom/files/README b/meta-isar/recipes-app/example-custom/files/README new file mode 100644 index 0000000..6e2ce0f --- /dev/null +++ b/meta-isar/recipes-app/example-custom/files/README @@ -0,0 +1 @@ +This is an example file that we get from FILESDIR in recipe. diff --git a/meta-isar/recipes-app/example-custom/files/postinst b/meta-isar/recipes-app/example-custom/files/postinst new file mode 100644 index 0000000..a28afa3 --- /dev/null +++ b/meta-isar/recipes-app/example-custom/files/postinst @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +if ! getent group isar >/dev/null; then + addgroup --quiet --system isar +fi + +if ! getent passwd isar >/dev/null; then + useradd --system --gid isar --create-home \ + --home /var/lib/isar --no-user-group \ + --comment "My isar user" \ + isar +fi + +chown -R isar:isar /var/lib/isar -- 2.13.5