summaryrefslogtreecommitdiff
path: root/elements/core/shadow.bst
blob: e154b69b3b00abd5f850c8922d575ee873ca501b (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
53
54
55
56
57
58
kind: autotools
depends:
- gnu-toolchain.bst
- core/autoconf.bst
- core/automake.bst
- core/gettext-tarball.bst
- core/libtool.bst
- core/bison.bst
- core/attr.bst
- core/acl.bst
- core/linux-pam.bst
- core/libcap2.bst
- core/perl.bst
sources:
- kind: git
  url: upstream:shadow
  track: upstream/4.2.1
  ref: bfaa59229d61adb7fa0c570f0d94fd324c6e05aa
config:
  pre-configure-commands:
  - autoreconf -vfi
  configure-commands:
  - |
    ./configure  --with-selinux=no \
                 --sysconfdir=/etc \
                 --with-libpam=yes \
                 --prefix="%{prefix}"
  post-install-commands:
  - |
    for OPTION in FAIL_DELAY \
                  FAILLOG_ENAB \
                  LASTLOG_ENAB \
                  MAIL_CHECK_ENAB \
                  OBSCURE_CHECKS_ENAB \
                  PORTTIME_CHECKS_ENAB \
                  QUOTAS_ENAB \
                  CONSOLE MOTD_FILE \
                  FTMP_FILE \
                  NOLOGINS_FILE \
                  ENV_HZ \
                  PASS_MIN_LEN \
                  SU_WHEEL_ONLY \
                  CRACKLIB_DICTPATH \
                  PASS_CHANGE_TRIES \
                  PASS_ALWAYS_WARN \
                  CHFN_AUTH \
                  ENVIRON_FILE
    do
      sed -i -e "s/^${OPTION}.*/# & #This option is handled by PAM instead./" \
          "%{install-root}/etc/login.defs"
    done
  - |
    if grep -q '[\s#]ENCRYPT_METHOD' "%{install-root}/etc/login.defs"; then
        sed -i -e '/^[\s#]*ENCRYPT_METHOD /s/.*/ENCRYPT_METHOD SHA512/g' "%{install-root}/etc/login.defs"
    else
        echo 'ENCRYPT_METHOD SHA512' >>"%{install-root}/etc/login.defs"
    fi
  - sed -i -e 's/\(.*\)required\(.*pam_selinux.so.*\)/\1optional\2/' "%{install-root}"/etc/pam.d/*