summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/base-passwd/base-passwd_3.5.26.bb
diff options
context:
space:
mode:
authorConstantin Musca <constantinx.musca@intel.com>2012-08-24 13:26:17 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-25 14:46:59 +0100
commit4d8ea0216fd08473e16480677e7ec5cf9af31138 (patch)
treee29561f24deaeb871ed9a126f93ac60911135f2c /meta/recipes-core/base-passwd/base-passwd_3.5.26.bb
parent5183f31b90416dd8e0cbc15950792ac5e478d359 (diff)
downloadpoky-4d8ea0216fd08473e16480677e7ec5cf9af31138.tar.gz
base-passwd: upgrade to 3.5.26
The S variable is now the default one. (From OE-Core rev: a8b1081791af60873c6fd26cbf298cfe1886f97d) Signed-off-by: Constantin Musca <constantinx.musca@intel.com> 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.26.bb')
-rw-r--r--meta/recipes-core/base-passwd/base-passwd_3.5.26.bb92
1 files changed, 92 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.26.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.26.bb
new file mode 100644
index 0000000000..2073b3fa4a
--- /dev/null
+++ b/meta/recipes-core/base-passwd/base-passwd_3.5.26.bb
@@ -0,0 +1,92 @@
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"
4PR = "r0"
5LICENSE = "GPLv2+"
6LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a"
7
8SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \
9 file://nobash.patch \
10 file://root-home.patch"
11
12SRC_URI[md5sum] = "74245e5c21dc74d9675c77cd8dfa02e6"
13SRC_URI[sha256sum] = "258a78317aa563143d10375c6e1e63a60898e503887f00fffd70b6b297c1b429"
14
15inherit autotools
16
17SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst"
18
19do_install () {
20 install -d -m 755 ${D}${sbindir}
21 install -o root -g root -p -m 755 update-passwd ${D}${sbindir}/
22 install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8
23 install -p -m 644 man/update-passwd.8 ${D}${mandir}/man8/
24 install -p -m 644 man/update-passwd.pl.8 \
25 ${D}${mandir}/pl/man8/update-passwd.8
26 gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/*
27 install -d -m 755 ${D}${datadir}/base-passwd
28 install -o root -g root -p -m 644 passwd.master ${D}${datadir}/base-passwd/
29 install -o root -g root -p -m 644 group.master ${D}${datadir}/base-passwd/
30
31 install -d -m 755 ${D}${docdir}/${BPN}
32 install -p -m 644 debian/changelog ${D}${docdir}/${BPN}/
33 gzip -9 ${D}${docdir}/${BPN}/*
34 install -p -m 644 README ${D}${docdir}/${BPN}/
35 install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/
36}
37
38base_passwd_sstate_postinst() {
39 if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ]
40 then
41 # Staging does not copy ${sysconfdir} files into the
42 # target sysroot, so we need to do so manually. We
43 # put these files in the target sysroot so they can
44 # be used by recipes which use custom user/group
45 # permissions.
46 install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir}
47 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd
48 install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group
49 fi
50}
51
52python populate_packages_prepend() {
53 # Add in the preinst function for ${PN}
54 # We have to do this here as prior to this, passwd/group.master
55 # would be unavailable. We need to create these files at preinst
56 # time before the files from the package may be available, hence
57 # storing the data from the files in the preinst directly.
58
59 f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r')
60 passwd = "".join(f.readlines())
61 f.close()
62 f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r')
63 group = "".join(f.readlines())
64 f.close()
65
66 preinst = """#!/bin/sh
67if [ ! -e $D${sysconfdir}/passwd ]; then
68\tcat << EOF > $D${sysconfdir}/passwd
69""" + passwd + """EOF
70fi
71if [ ! -e $D${sysconfdir}/group ]; then
72\tcat << EOF > $D${sysconfdir}/group
73""" + group + """EOF
74fi
75"""
76 d.setVar('pkg_preinst_${PN}', preinst)
77}
78
79addtask do_package after do_populate_sysroot
80
81ALLOW_EMPTY_${PN} = "1"
82
83PACKAGES =+ "${PN}-update"
84FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}"
85
86pkg_postinst_${PN}-update () {
87#!/bin/sh
88if [ -n "$D" ]; then
89 exit 0
90fi
91${sbindir}/update-passwd
92}