From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6450128687666823168 X-Received: by 10.223.183.47 with SMTP id l47mr309815wre.26.1501787615809; Thu, 03 Aug 2017 12:13:35 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.46.7.10 with SMTP id 10ls175178ljh.29.gmail; Thu, 03 Aug 2017 12:13:35 -0700 (PDT) X-Received: by 10.25.150.130 with SMTP id y124mr509005lfd.36.1501787615382; Thu, 03 Aug 2017 12:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501787615; cv=none; d=google.com; s=arc-20160816; b=nB0KIW81ODUqYH23IAl3agg+wOoL8FHiUzGzB0wonX/sKQOjktVXTaQUTiAwGdZ/JZ XTbbVVm+yFa640I/d5X1UXMD0oPtx/adCuykZmdS3BkQk4OkKDUlNS2DNcjJFccu5Do5 i4gwTAtVYCxzneVQnt+XvR1b6i2ZQ7GC5s890zvz5q0milRkQ+W6QSLpNEK9JFGV6cGV PooEkRM3BRMtNtFUql8JnxVE3FRuN1FfSY0Y41aUxltYZItyDTGJObYq9FVYzJu73pj4 p51OG/r3gDmk5hHAKdnjDX4RAyTVCvNQmqgWBBqeccjYBYxGvDbVNzIPeEGSn4Su0mki 3iCQ== 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=s1XeGE6HDNBfJt9lp95onFXObtXPszNTSHmsmvFCOOA=; b=yg3IGjSwks+CSgY1XT/D4phVkiffwWDzvjCTIfNfNuk5cwet0LXj0KABBopd1JAg35 l6jpi6TUQD967r8L7nyMmMrc54QU94ZxQca/4XjAqCWXKadFxY7RNofrl3TAHEDRQYU5 Fw9hLVUtOJUX+5imIu7VN8aR/fHRNXsYa2NoGuPM3ZbSzC/qM30ghJ3y8tA4xHLph32l McsPOo7RaC9eJc7ZdBS4StYlmSIEYpU36ZWP5B8YnnZAdfLuHJl+U1e8GUmqyUsuYRRr NCqgyvaGTmQuho/7QjwhqN984JgU6kqq/KIu1F4WxAk+MeQrFgvVtCD8HI0jFYPwI+8z 5bYQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 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 thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id m89si1170576wmi.0.2017.08.03.12.13.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 12:13:35 -0700 (PDT) Received-SPF: neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 192.35.17.2 is neither permitted nor denied by best guess record for domain of henning.schild@siemens.com) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id v73JDXO2031240 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 3 Aug 2017 21:13:33 +0200 Received: from md1em3qc.erlm.siemens.de ([139.22.106.2]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id v73JDVpl008615; Thu, 3 Aug 2017 21:13:33 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Alexander Smirnov , Henning Schild Subject: [PATCH 11-16 of 16 v2 6/6] recipes-app/hello-bin: add example on how to use dpkg-bin Date: Thu, 3 Aug 2017 21:15:24 +0200 Message-Id: X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: X-TUID: BAfdwEWm+5AO Signed-off-by: Henning Schild --- meta-isar/recipes-app/hello-bin/files/README | 1 + meta-isar/recipes-app/hello-bin/files/postinst | 16 ++++++++++ meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb | 38 ++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 meta-isar/recipes-app/hello-bin/files/README create mode 100644 meta-isar/recipes-app/hello-bin/files/postinst create mode 100644 meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb diff --git a/meta-isar/recipes-app/hello-bin/files/README b/meta-isar/recipes-app/hello-bin/files/README new file mode 100644 index 0000000..6e2ce0f --- /dev/null +++ b/meta-isar/recipes-app/hello-bin/files/README @@ -0,0 +1 @@ +This is an example file that we get from FILESDIR in recipe. diff --git a/meta-isar/recipes-app/hello-bin/files/postinst b/meta-isar/recipes-app/hello-bin/files/postinst new file mode 100644 index 0000000..a47abf3 --- /dev/null +++ b/meta-isar/recipes-app/hello-bin/files/postinst @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +if ! getent group hello >/dev/null; then + addgroup --quiet --system hello +fi + +if ! getent passwd hello >/dev/null; then + useradd --system --gid hello --create-home \ + --home /var/lib/hello --no-user-group \ + --comment "My hello user" \ + hello +fi + +chown -R hello:hello /var/lib/hello diff --git a/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb new file mode 100644 index 0000000..d739dbf --- /dev/null +++ b/meta-isar/recipes-app/hello-bin/hello-bin_0.1.bb @@ -0,0 +1,38 @@ +# Sample application using dpkg-bin, which turns a folder (${D}) of +# files into a .deb +# +# This software is a part of ISAR. + +DESCRIPTION = "Sample bin application for ISAR" +MAINTAINER = "Your name here " +DEBIAN_DEPENDS = "apt" + +SRC_URI = "file://README \ + file://postinst" + +# we have to do that because we are using a broken unpack +WORKDIR = "${BUILDROOT}" + +inherit dpkg-bin + +do_install() { + bbnote "Creating ${PN} binary" + echo "#!/bin/sh" > ${WORKDIR}/${PN} + echo "echo Hello World! ${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 faked 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 +} -- 2.13.0