diff options
author | Scott Garman <scott.a.garman@intel.com> | 2012-03-14 17:14:43 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-19 14:37:45 +0000 |
commit | 2a7afb661a45ea4f557059eaaad3f91682970477 (patch) | |
tree | 94c1a32f15d2d736a3b2a38e6ea9853a3feb83f1 /meta/recipes-core/base-passwd/base-passwd_3.5.24.bb | |
parent | 35c4c79fa423715c8aaf9a6db0f18bee700af457 (diff) | |
download | poky-2a7afb661a45ea4f557059eaaad3f91682970477.tar.gz |
base-passwd: upgrade to 3.5.24
Includes minor formatting cleanups.
(From OE-Core rev: 5c0be0af8090839588c04ffdba8fd5d75321126c)
Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/base-passwd/base-passwd_3.5.24.bb')
-rw-r--r-- | meta/recipes-core/base-passwd/base-passwd_3.5.24.bb | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/meta/recipes-core/base-passwd/base-passwd_3.5.24.bb b/meta/recipes-core/base-passwd/base-passwd_3.5.24.bb new file mode 100644 index 0000000000..6eeee5cd5b --- /dev/null +++ b/meta/recipes-core/base-passwd/base-passwd_3.5.24.bb | |||
@@ -0,0 +1,94 @@ | |||
1 | SUMMARY = "Base system master password/group files." | ||
2 | DESCRIPTION = "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." | ||
3 | SECTION = "base" | ||
4 | PR = "r0" | ||
5 | LICENSE = "GPLv2+" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" | ||
7 | |||
8 | SRC_URI = "${DEBIAN_MIRROR}/main/b/base-passwd/base-passwd_${PV}.tar.gz \ | ||
9 | file://nobash.patch \ | ||
10 | file://root-home.patch" | ||
11 | |||
12 | SRC_URI[md5sum] = "8f6b9420c50e90edaff41eb2fb7e9e16" | ||
13 | SRC_URI[sha256sum] = "196083d6f675190d4e2cede0a5fa6b3c91088705c5386f76292fec8e74b6369e" | ||
14 | |||
15 | S = "${WORKDIR}/base-passwd" | ||
16 | |||
17 | inherit autotools | ||
18 | |||
19 | SSTATEPOSTINSTFUNCS += "base_passwd_sstate_postinst" | ||
20 | |||
21 | do_install () { | ||
22 | install -d -m 755 ${D}${sbindir} | ||
23 | install -o root -g root -p -m 755 update-passwd ${D}${sbindir}/ | ||
24 | install -d -m 755 ${D}${mandir}/man8 ${D}${mandir}/pl/man8 | ||
25 | install -p -m 644 man/update-passwd.8 ${D}${mandir}/man8/ | ||
26 | install -p -m 644 man/update-passwd.pl.8 \ | ||
27 | ${D}${mandir}/pl/man8/update-passwd.8 | ||
28 | gzip -9 ${D}${mandir}/man8/* ${D}${mandir}/pl/man8/* | ||
29 | install -d -m 755 ${D}${datadir}/base-passwd | ||
30 | install -o root -g root -p -m 644 passwd.master ${D}${datadir}/base-passwd/ | ||
31 | install -o root -g root -p -m 644 group.master ${D}${datadir}/base-passwd/ | ||
32 | |||
33 | install -d -m 755 ${D}${docdir}/${BPN} | ||
34 | install -p -m 644 debian/changelog ${D}${docdir}/${BPN}/ | ||
35 | gzip -9 ${D}${docdir}/${BPN}/* | ||
36 | install -p -m 644 README ${D}${docdir}/${BPN}/ | ||
37 | install -p -m 644 debian/copyright ${D}${docdir}/${BPN}/ | ||
38 | } | ||
39 | |||
40 | base_passwd_sstate_postinst() { | ||
41 | if [ "${BB_CURRENTTASK}" = "populate_sysroot" -o "${BB_CURRENTTASK}" = "populate_sysroot_setscene" ] | ||
42 | then | ||
43 | # Staging does not copy ${sysconfdir} files into the | ||
44 | # target sysroot, so we need to do so manually. We | ||
45 | # put these files in the target sysroot so they can | ||
46 | # be used by recipes which use custom user/group | ||
47 | # permissions. | ||
48 | install -d -m 755 ${STAGING_DIR_TARGET}${sysconfdir} | ||
49 | install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/passwd.master ${STAGING_DIR_TARGET}${sysconfdir}/passwd | ||
50 | install -p -m 644 ${STAGING_DIR_TARGET}${datadir}/base-passwd/group.master ${STAGING_DIR_TARGET}${sysconfdir}/group | ||
51 | fi | ||
52 | } | ||
53 | |||
54 | python populate_packages_prepend() { | ||
55 | # Add in the preinst function for ${PN} | ||
56 | # We have to do this here as prior to this, passwd/group.master | ||
57 | # would be unavailable. We need to create these files at preinst | ||
58 | # time before the files from the package may be available, hence | ||
59 | # storing the data from the files in the preinst directly. | ||
60 | |||
61 | f = open(d.expand("${STAGING_DATADIR}/base-passwd/passwd.master"), 'r') | ||
62 | passwd = "".join(f.readlines()) | ||
63 | f.close() | ||
64 | f = open(d.expand("${STAGING_DATADIR}/base-passwd/group.master"), 'r') | ||
65 | group = "".join(f.readlines()) | ||
66 | f.close() | ||
67 | |||
68 | preinst = """#!/bin/sh | ||
69 | if [ ! -e $D${sysconfdir}/passwd ]; then | ||
70 | cat << EOF > $D${sysconfdir}/passwd | ||
71 | """ + passwd + """EOF | ||
72 | fi | ||
73 | if [ ! -e $D${sysconfdir}/group ]; then | ||
74 | cat << EOF > $D${sysconfdir}/group | ||
75 | """ + group + """EOF | ||
76 | fi | ||
77 | """ | ||
78 | d.setVar('pkg_preinst_${PN}', preinst) | ||
79 | } | ||
80 | |||
81 | addtask do_package after do_populate_sysroot | ||
82 | |||
83 | ALLOW_EMPTY_${PN} = "1" | ||
84 | |||
85 | PACKAGES =+ "${PN}-update" | ||
86 | FILES_${PN}-update = "${sbindir}/* ${datadir}/${PN}" | ||
87 | |||
88 | pkg_postinst_${PN}-update () { | ||
89 | #!/bin/sh | ||
90 | if [ -n "$D" ]; then | ||
91 | exit 0 | ||
92 | fi | ||
93 | ${sbindir}/update-passwd | ||
94 | } | ||