summaryrefslogtreecommitdiffstats
path: root/meta
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
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')
-rw-r--r--meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb15
-rw-r--r--meta/recipes-extended/shadow/shadow.inc113
-rw-r--r--meta/recipes-extended/shadow/shadow_4.1.4.3.bb93
3 files changed, 113 insertions, 108 deletions
diff --git a/meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb
deleted file mode 100644
index ba208f7888..0000000000
--- a/meta/recipes-extended/shadow/shadow-native_4.1.4.3.bb
+++ /dev/null
@@ -1,15 +0,0 @@
1require shadow.inc
2
3PR = "r8"
4
5SRC_URI += " \
6 file://add_root_cmd_options.patch \
7 file://disable-syslog.patch \
8 file://useradd.patch \
9 file://add_root_cmd_groupmems.patch \
10 "
11inherit native
12
13EXTRA_OECONF += "--without-libpam \
14 --without-nscd"
15
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}
diff --git a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
index 91ff24975d..6f1723ed6d 100644
--- a/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
+++ b/meta/recipes-extended/shadow/shadow_4.1.4.3.bb
@@ -1,99 +1,10 @@
1require shadow.inc 1require shadow.inc
2 2
3DEPENDS = "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)} \
4 shadow-native"
5RDEPENDS_${PN} = "shadow-securetty ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_PLUGINS}', '', d)} \
6 base-passwd"
7PR = "r13"
8
9SRC_URI += " \
10 file://login_defs_pam.sed \
11 ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)} \
12 file://shadow-4.1.4.2-groupmod-pam-check.patch \
13 file://shadow-4.1.4.2-su_no_sanitize_env.patch \
14 file://shadow-update-pam-conf.patch \
15 file://slackware_fix_for_glib-2.17_crypt.patch \
16 file://fix-etc-gshadow-reading.patch \
17 "
18
19EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'pam', '--with-libpam', '--without-libpam', d)}"
20EXTRA_OECONF_libc-uclibc += "--with-nscd=no"
21
22# Build falsely assumes that if --enable-libpam is set, we don't need to link against 3# Build falsely assumes that if --enable-libpam is set, we don't need to link against
23# libcrypt. This breaks chsh. 4# libcrypt. This breaks chsh.
24BUILD_LDFLAGS += "${@base_contains('DISTRO_FEATURES', 'pam', base_contains('DISTRO_FEATURES', 'libc-crypt', '-lcrypt', '', d), '', d)}" 5BUILD_LDFLAGS_append_class-target = " ${@base_contains('DISTRO_FEATURES', 'pam', base_contains('DISTRO_FEATURES', 'libc-crypt', '-lcrypt', '', d), '', d)}"
25
26PAM_PLUGINS = "libpam-runtime \
27 pam-plugin-faildelay \
28 pam-plugin-securetty \
29 pam-plugin-nologin \
30 pam-plugin-env \
31 pam-plugin-group \
32 pam-plugin-limits \
33 pam-plugin-lastlog \
34 pam-plugin-motd \
35 pam-plugin-mail \
36 pam-plugin-shells \
37 pam-plugin-rootok"
38
39# Additional Policy files for PAM
40PAM_SRC_URI = "file://pam.d/chfn \
41 file://pam.d/chpasswd \
42 file://pam.d/chsh \
43 file://pam.d/login \
44 file://pam.d/newusers \
45 file://pam.d/passwd \
46 file://pam.d/su"
47
48do_install_append() {
49 # Ensure that the image has as a /var/spool/mail dir so shadow can
50 # put mailboxes there if the user reconfigures shadow to its
51 # defaults (see sed below).
52 install -d ${D}${localstatedir}/spool/mail
53
54 if [ -e ${WORKDIR}/pam.d ]; then
55 install -d ${D}${sysconfdir}/pam.d/
56 install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/
57 # Remove defaults that are not used when supporting PAM.
58 sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs
59 fi
60
61 install -d ${D}${sbindir} ${D}${base_sbindir} ${D}${base_bindir}
62
63 # Move binaries to the locations we want
64 rm ${D}${sbindir}/vigr
65 ln -sf vipw.${BPN} ${D}${base_sbindir}/vigr
66 if [ "${sbindir}" != "${base_sbindir}" ]; then
67 mv ${D}${sbindir}/vipw ${D}${base_sbindir}/vipw
68 fi
69 if [ "${bindir}" != "${base_bindir}" ]; then
70 mv ${D}${bindir}/login ${D}${base_bindir}/login
71 mv ${D}${bindir}/su ${D}${base_bindir}/su
72 fi
73
74 # Handle link properly after rename, otherwise missing files would
75 # lead rpm failed dependencies.
76 ln -sf newgrp.${BPN} ${D}${bindir}/sg
77}
78
79inherit update-alternatives
80 6
81ALTERNATIVE_PRIORITY = "200" 7BBCLASSEXTEND = "native"
82 8
83ALTERNATIVE_${PN} = "passwd chfn newgrp chsh groups chpasswd login vipw vigr su"
84ALTERNATIVE_LINK_NAME[chpasswd] = "${sbindir}/chpasswd"
85ALTERNATIVE_LINK_NAME[login] = "${base_bindir}/login"
86ALTERNATIVE_LINK_NAME[vipw] = "${base_sbindir}/vipw"
87ALTERNATIVE_LINK_NAME[vigr] = "${base_sbindir}/vigr"
88ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
89 9
90pkg_postinst_${PN} () {
91 if [ "x$D" != "x" ]; then
92 rootarg="--root=$D"
93 else
94 rootarg=""
95 fi
96 10
97 pwconv $rootarg
98 grpconv $rootarg
99}