From: Stefan Herbrechtsmeier <stefan.herbrechtsme...@weidmueller.com>

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsme...@weidmueller.com>
---

 meta/classes/npm_build_dist.bbclass | 31 +++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 meta/classes/npm_build_dist.bbclass

diff --git a/meta/classes/npm_build_dist.bbclass 
b/meta/classes/npm_build_dist.bbclass
new file mode 100644
index 0000000000..074edb8552
--- /dev/null
+++ b/meta/classes/npm_build_dist.bbclass
@@ -0,0 +1,31 @@
+# Copyright (C) 2021 Weidmüller Interface GmbH & Co. KG
+# Author: Stefan Herbrechtsmeier <stefan.herbrechtsme...@weidmueller.com>
+#
+# A bbclass to build npm package and install its dist folder.
+#
+# Usage:
+#  inherit npm_build_dist
+#
+# Optional variables:
+#  NPM_DIST:
+#       Path of dist source folder
+#
+#  NPM_BUILD_ARCH:
+#       Path of www install folder
+
+inherit allarch npm_build
+
+NPM_RDEPENDS = ""
+
+NPM_DIST ?= "${NPM_SOURCEPATH}/dist"
+NPM_WWW ?= "${servicedir}/www/${BPN}"
+
+do_compile[noexec] = "1"
+
+do_install() {
+    install -d ${D}${NPM_WWW}
+    cp -a --no-preserve=ownership ${NPM_DIST}/* ${D}${NPM_WWW}/
+}
+
+FILES:${PN} = "${NPM_WWW}"
+
-- 
2.20.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#158705): 
https://lists.openembedded.org/g/openembedded-core/message/158705
Mute This Topic: https://lists.openembedded.org/mt/87282284/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to