summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/shadow/shadow.inc
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-23 21:40:28 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-09-24 17:24:14 +0100
commit139e887c9a59134b519f1a56e07c461071ae58aa (patch)
tree6e3c4e4881cba0e7f778c6ae638395472b783575 /meta/recipes-extended/shadow/shadow.inc
parent9bed1a3e5286d5cfd71ef7de89b00cd2b1e09286 (diff)
downloadpoky-139e887c9a59134b519f1a56e07c461071ae58aa.tar.gz
shadow: Turn shadow-native into a BBCLASSEXTEND
(From OE-Core rev: 44fafdb5eca1fc8766bf649bc78e770e1d18979d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/shadow/shadow.inc')
-rw-r--r--meta/recipes-extended/shadow/shadow.inc113
1 files changed, 111 insertions, 2 deletions
diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc
index 4df5e5edb9..75b0afcab1 100644
--- a/meta/recipes-extended/shadow/shadow.inc
+++ b/meta/recipes-extended/shadow/shadow.inc
@@ -7,22 +7,79 @@ LICENSE = "BSD | Artistic-1.0"
7LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \ 7LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
8 file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661" 8 file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
9 9
10DEPENDS = "shadow-native"
11DEPENDS_class-native = ""
12
10SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.bz2 \ 13SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.bz2 \
11 file://shadow.automake-1.11.patch \ 14 file://shadow.automake-1.11.patch \
12 file://shadow_fix_for_automake-1.12.patch \ 15 file://shadow_fix_for_automake-1.12.patch \
13 file://shadow-4.1.3-dots-in-usernames.patch \ 16 file://shadow-4.1.3-dots-in-usernames.patch \
14 file://shadow-4.1.4.2-env-reset-keep-locale.patch \ 17 file://shadow-4.1.4.2-env-reset-keep-locale.patch \
18 ${@base_contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
19 "
20
21SRC_URI_append_class-target = " \
22 file://login_defs_pam.sed \
23 file://shadow-4.1.4.2-groupmod-pam-check.patch \
24 file://shadow-4.1.4.2-su_no_sanitize_env.patch \
25 file://shadow-update-pam-conf.patch \
26 file://slackware_fix_for_glib-2.17_crypt.patch \
27 file://fix-etc-gshadow-reading.patch \
28 "
29
30SRC_URI_append_class-native = " \
31 file://add_root_cmd_options.patch \
32 file://disable-syslog.patch \
33 file://useradd.patch \
34 file://add_root_cmd_groupmems.patch \
15 " 35 "
16 36
17SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79" 37SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
18SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778" 38SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
19 39
40PR = "r13"
41
42# Additional Policy files for PAM
43PAM_SRC_URI = "file://pam.d/chfn \
44 file://pam.d/chpasswd \
45 file://pam.d/chsh \
46 file://pam.d/login \
47 file://pam.d/newusers \
48 file://pam.d/passwd \
49 file://pam.d/su"
50
20inherit autotools gettext 51inherit autotools gettext
21 52
22EXTRA_OECONF += "--without-audit \ 53EXTRA_OECONF += "--without-audit \
23 --without-libcrack \ 54 --without-libcrack \
24 --without-selinux" 55 --without-selinux \
25 56 ${NSCDOPT}"
57
58NSCDOPT = ""
59NSCDOPT_class-native = "--without-nscd"
60NSCDOPT_libc-uclibc = " --without-nscd"
61
62PAM_PLUGINS = "libpam-runtime \
63 pam-plugin-faildelay \
64 pam-plugin-securetty \
65 pam-plugin-nologin \
66 pam-plugin-env \
67 pam-plugin-group \
68 pam-plugin-limits \
69 pam-plugin-lastlog \
70 pam-plugin-motd \
71 pam-plugin-mail \
72 pam-plugin-shells \
73 pam-plugin-rootok"
74
75PACKAGECONFIG = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}"
76PACKAGECONFIG_class-native = ""
77PACKAGECONFIG[pam] = "--with-libpam,--without-libpam,libpam,${PAM_PLUGINS}"
78
79RDEPENDS_${PN} = "shadow-securetty \
80 base-passwd"
81RDEPENDS_${PN}_class-native = ""
82
26do_install() { 83do_install() {
27 oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install 84 oe_runmake DESTDIR="${D}" sbindir="${base_sbindir}" usbindir="${sbindir}" install
28 85
@@ -51,3 +108,55 @@ do_install() {
51 sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd 108 sed -i 's,^GROUP=1000,GROUP=100,g' ${D}${sysconfdir}/default/useradd
52} 109}
53 110
111do_install_append() {
112 # Ensure that the image has as a /var/spool/mail dir so shadow can
113 # put mailboxes there if the user reconfigures shadow to its
114 # defaults (see sed below).
115 install -d ${D}${localstatedir}/spool/mail
116
117 if [ -e ${WORKDIR}/pam.d ]; then
118 install -d ${D}${sysconfdir}/pam.d/
119 install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
120 # Remove defaults that are not used when supporting PAM.
121 sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs
122 fi
123
124 install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir}
125
126 # Move binaries to the locations we want
127 rm ${D}${sbindir}/vigr
128 ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr
129 if [ "${sbindir}" != "${base_sbindir}" ]; then
130 mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw
131 fi
132 if [ "${bindir}" != "${base_bindir}" ]; then
133 mv ${D}${bindir}/login ${D}${base_bindir}/login
134 mv ${D}${bindir}/su ${D}${base_bindir}/su
135 fi
136
137 # Handle link properly after rename, otherwise missing files would
138 # lead rpm failed dependencies.
139 ln -sf newgrp.${BPN} ${D}${bindir}/sg
140}
141
142inherit update-alternatives
143
144ALTERNATIVE_PRIORITY = "200"
145
146ALTERNATIVE_${PN} = "passwd chfn newgrp chsh groups chpasswd login vipw vigr su"
147ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
148ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
149ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
150ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
151ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
152
153pkg_postinst_${PN} () {
154 if [ "x$D" != "x" ]; then
155 rootarg="--root=$D"
156 else
157 rootarg=""
158 fi
159
160 pwconv $rootarg
161 grpconv $rootarg
162}