aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc')
-rw-r--r--meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc30
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc b/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc
new file mode 100644
index 00000000000..106fa25e146
--- /dev/null
+++ b/meta/recipes-devtools/update-alternatives/update-alternatives-dpkg.inc
@@ -0,0 +1,30 @@
+LICENSE = "GPL"
+SECTION = "base"
+SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.gz"
+S = "${WORKDIR}/dpkg-${PV}"
+PACKAGE_ARCH = "all"
+PR = "r2"
+
+do_patch () {
+ cat ${S}/scripts/update-alternatives.pl | \
+ sed -n -e '
+ /^\$admindir=.*staging/{
+ x
+ s/^.*$/$D=$ENV{"D"} || ""\;/;
+ p;
+ x;
+ s,^\$admindir=.*staging.*$,$admindir="$D${localstatedir}/dpkg"\;,;
+ };
+ s,^\$altdir=.*$,$altdir="$D${sysconfdir}/alternatives"\;,;
+ p;' > ${S}/scripts/update-alternatives
+}
+
+do_install () {
+ install -d ${D}${sbindir} \
+ ${D}${localstatedir}/dpkg/alternatives \
+ ${D}${sysconfdir}/alternatives
+
+ install -m 0755 scripts/update-alternatives ${D}${sbindir}/update-alternatives
+}
+
+BBCLASSEXTEND = "native"