summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
diff options
context:
space:
mode:
authorUpgrade Helper <uh@not.set>2014-01-04 11:44:14 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-10 15:16:47 +0000
commit0509a60ba5820bd94e107a244b8a01e6f4776741 (patch)
treee0d1e55b8245fe4681c96b9cc065c59c88f7e0ab /meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
parent6ee5d95317de77c1cfb6db6f1ab2de77f5fa085e (diff)
downloadpoky-0509a60ba5820bd94e107a244b8a01e6f4776741.tar.gz
base-passwd: upgrade to 3.5.29
(From OE-Core rev: 7c79e70d3a803f2ccb9b9c6ed2134019631672fd) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/base-passwd/base-passwd_3.5.29.bb')
-rw-r--r--meta/recipes-core/base-passwd/base-passwd_3.5.29.bb98
1 files changed, 98 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
new file mode 100644
index 0000000000..082037a2a3
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.29.bb
@@ -0,0 +1,98 @@
1SUMMARY = "Base system master password/group files."
2DESCRIPTION = "The master copies of the user database files (/etc/passwd and /etc/group). The update-passwd tool is also provided to keep the system databases synchronized with these master files."
3SECTION = "base"
4LICENSE = "GPLv2+"
5LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
6
7DEPENDS = "docbook-utils-native linuxdoc-tools-native"
8
9SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
10 file://add_shutdown.patch \
11 file://nobash.patch \
12 file://input.patch \
13 file://disable-docs.patch \
14 "
15
16SRC_URI[md5sum] = "6beccac48083fe8ae5048acd062e5421"
17SRC_URI[sha256sum] = "f0b66388b2c8e49c15692439d2bee63bcdd4bbbf7a782c7f64accc55986b6a36"
18
19inherit autotools
20
21SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
22
23do_install () {
24 install -d -m 755 ${D}${sbindir}
25 install -o root -g root -p -m 755 ${B}/update-passwd ${D}${sbindir}/
26 install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
27 install -p -m 644 ${S}/man/update-passwd.8 ${D}${mandir}/man8/
28 install -p -m 644 ${S}/man/update-passwd.pl.8 \
29 ${D}${mandir}/pl/man8/update-passwd.8
30 gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
31 install -d -m 755 ${D}${datadir}/base-passwd
32 sed -i 's#:/root:#:${ROOT_HOME}:#' ${S}/passwd.master
33 install -o root -g root -p -m 644 ${S}/passwd.master ${D}${datadir}/base-passwd/
34 install -o root -g root -p -m 644 ${S}/group.master ${D}${datadir}/base-passwd/
35
36 install -d -m 755 ${D}${docdir}/${BPN}
37 install -p -m 644 ${S}/debian/changelog ${D}${docdir}/${BPN}/
38 gzip -9 ${D}${docdir}/${BPN}/*
39 install -p -m 644 ${S}/README ${D}${docdir}/${BPN}/
40 install -p -m 644 ${S}/debian/copyright ${D}${docdir}/${BPN}/
41}
42
43base_passwd_sstate_postinst() {
44 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
45 then
46 # Staging does not copy ${sysconfdir} files into the
47 # target sysroot, so we need to do so manually. We
48 # put these files in the target sysroot so they can
49 # be used by recipes which use custom user/group
50 # permissions.
51 install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
52 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd
53 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group
54 fi
55}
56
57python populate_packages_prepend() {
58 # Add in the preinst function for ${PN}
59 # We have to do this here as prior to this, passwd/group.master
60 # would be unavailable. We need to create these files at preinst
61 # time before the files from the package may be available, hence
62 # storing the data from the files in the preinst directly.
63
64 f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
65 passwd = "".join(f.readlines())
66 f.close()
67 f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
68 group = "".join(f.readlines())
69 f.close()
70
71 preinst = """#!/bin/sh
72mkdir -p $D${sysconfdir}
73if [ ! -e $D${sysconfdir}/passwd ]; then
74\tcat << EOF > $D${sysconfdir}/passwd
75""" + passwd + """EOF
76fi
77if [ ! -e $D${sysconfdir}/group ]; then
78\tcat << EOF > $D${sysconfdir}/group
79""" + group + """EOF
80fi
81"""
82 d.setVar('pkg_preinst_${PN}', preinst)
83}
84
85addtask do_package after do_populate_sysroot
86
87ALLOW_EMPTY_${PN} = "1"
88
89PACKAGES =+ "${PN}-update"
90FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
91
92pkg_postinst_${PN}-update () {
93#!/bin/sh
94if [ -n "$D" ]; then
95 exit 0
96fi
97${sbindir}/update-passwd
98}