summaryrefslogtreecommitdiff
path: root/recipes/shadow/shadow_4.1.4.2.bb
blob: 04887a01d1c3544f05813feb3ef4b95d32ccd72c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
DESCRIPTION = "login/password and account utilities"
LICENSE = "GPL"

DEPEND = "libpam"
RDEPEND = "${DEPEND}"

PR = "r5"

EXTRA_OECONF += " --enable-shared  --enable-static --with-libpam --without-libcrack"

inherit autotools

HOMEPAGE = "http://pkg-shadow.alioth.debian.org/"
SRC_URI = "ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-${PV}.tar.bz2 \
           file://login_defs_pam.sed \
"

# Additional Policy files for PAM
SRC_URI_append = " \
           file://pam.d/chfn \ 
           file://pam.d/chpasswd \
           file://pam.d/chsh \
           file://pam.d/login \
           file://pam.d/newusers \
           file://pam.d/passwd \
           file://pam.d/su \
"

S = "${WORKDIR}/shadow-${PV}"

CFLAGS_append = " -I../include"

do_install_append() {
  # Ensure that the image has as /var/spool/mail dir so shadow can put mailboxes there if the user
  # reconfigures Shadow to default (see sed below).
  install -d ${D}${localstatedir}/spool/mail/  
  
  install -d ${D}${sysconfdir}/pam.d/  
  install -m 0644 ${WORKDIR}/pam.d/* ${D}${sysconfdir}/pam.d/

  # Remove defaults that are not used when supporting PAM
  sed -i -f ${WORKDIR}/login_defs_pam.sed ${D}${sysconfdir}/login.defs

  # Enable CREATE_HOME by default.
  sed -i 's/#CREATE_HOME/CREATE_HOME/g' ${D}${sysconfdir}/login.defs 
  
  # As we are on an embedded system ensure the users mailbox is in ~/ not 
  # /var/spool/mail by default as who knows where or how big /var is.
  # The system MDA will set this later anyway.
  sed -i 's/MAIL_DIR/#MAIL_DIR/g' ${D}${sysconfdir}/login.defs 
  sed -i 's/#MAIL_FILE/MAIL_FILE/g' ${D}${sysconfdir}/login.defs 
}