Magellan Linux

Annotation of /trunk/core/shadow/shadow-4.6-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 31996 - (hide annotations) (download)
Tue Feb 12 12:35:41 2019 UTC (5 years, 2 months ago) by niro
File size: 4192 byte(s)
auto added: ver bump to 4.6-r1
1 niro 31996 # $Id$
2    
3     PNAME="shadow"
4     PVER="4.6"
5     PBUILD="r1"
6    
7     PCAT="sys-apps"
8    
9     DESCRIPTION="Utilities to deal with user accounts, with pam support."
10     HOMEPAGE="https://github.com/shadow-maint/shadow/"
11    
12     DEPEND=">= virtual/glibc
13     >= sys-apps/base-files-0.7
14     >= app-shells/bash-4
15     >= sys-libs/pam-1.1
16     >= sys-libs/cracklib-2.8
17     >= sys-libs/readline-8.0
18     >= sys-apps/coreutils-8.19"
19    
20     SDEPEND=">= sys-dev/autoconf-5
21     >= sys-dev/automake-4
22     >= sys-dev/libtool-2.4"
23    
24     SRCFILE="${PNAME}-${PVER}.tar.xz"
25     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
26    
27     # no shared libs get installed, is multilib needed anymore?
28     sminclude multilib mtools
29    
30     PAMD_CHAGE_REV=1.3
31     PAMD_LOGIN_REV=1.3
32     PAMD_SU_REV=1.3
33    
34     SRC_URI=(
35     https://github.com/shadow-maint/${PNAME}/releases/download/${PVER}/${SRCFILE}
36     mirror://${PNAME}/${SRCFILE}
37     mirror://${PNAME}/pamd-systemauth/chage-${PAMD_CHAGE_REV}
38     mirror://${PNAME}/pamd-systemauth/login-${PAMD_LOGIN_REV}
39     mirror://${PNAME}/pamd-systemauth/su-${PAMD_SU_REV}
40     mirror://${PNAME}/pamd-systemauth/passwd
41     mirror://${PNAME}/${PNAME}-4.1.2.1-defaults.patch
42     mirror://${PNAME}/${PNAME}-4.1.5-missing-include.patch
43     )
44    
45     UP2DATE="updatecmd ${HOMEPAGE} | grep 'New release' | sed 's/.*: \(.*\).*/\1/;q'"
46    
47     src_prepare()
48     {
49     munpack ${SRCFILE} || die
50    
51     # fixes useradd default settings (create_mail_spool)
52     mpatch ${PNAME}-4.1.2.1-defaults.patch || die
53    
54     # fix a missing include
55     mpatch ${PNAME}-4.1.5-missing-include.patch || die
56    
57     # do not build 'groups'; coreutils provide a better version
58     all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die
59     all-abis "sed -i '/groups/d' man/Makefile.in" || die
60     }
61    
62     src_compile()
63     {
64     # configures shadow with pam
65     mconfigure \
66     --bindir=/usr/bin \
67     --sbindir=/usr/sbin \
68     --enable-shared \
69     --with-libpam \
70     --with-libcrack \
71     --with-libcrypt \
72     --enable-nls \
73     --without-selinux \
74     --with-group-name-max-length=32 \
75     || die
76    
77     mmake || die
78     }
79    
80     src_install()
81     {
82     # needed directories
83     minstalldir /etc/{default,skel} || die
84    
85     # added exec_prefix for better bin location
86     mmake DESTDIR=${BINDIR} install || die
87    
88     minstalletc etc/login.access login.access || die
89    
90     # install pam related configuration files
91     minstallpam login-${PAMD_LOGIN_REV} login || die
92     minstallpam su-${PAMD_SU_REV} su || die
93     local i
94     for i in chgpasswd chpasswd passwd
95     do
96     minstallpam passwd ${i} || die
97     done
98     for i in chage chfn chsh \
99     groupadd groupdel groupmems groupmod \
100     newusers useradd userdel usermod
101     do
102     minstallpam chage-${PAMD_CHAGE_REV} ${i} || die
103     done
104    
105     # disable these checks as pam controls them now
106     sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
107     -e "s/^LASTLOG_ENAB/# &/" \
108     -e "s/^MAIL_CHECK_ENAB/# &/" \
109     -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
110     -e "s/^CONSOLE/# &/" \
111     -e "s/^MOTD_FILE/# &/" \
112     -e "s/^NOLOGINS_FILE/# &/" \
113     -e "s/^PASS_MIN_LEN/# &/" \
114     -e "s/^SU_WHEEL_ONLY/# &/" \
115     -e "s/^CONSOLE_GROUPS/# &/" \
116     -e "s/^ENVIRON_FILE/# &/" \
117     -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
118     -e "s/^CRACKLIB_DICTPATH/# &/" \
119     -e "s/^PASS_CHANGE_TRIES/# &/" \
120     -e "s/^PASS_ALWAYS_WARN/# &/" \
121     -e "s/^FAILLOG_ENAB/# &/" \
122     -e "s/^QUOTAS_ENAB/# &/" \
123     -e "s/^FTMP_FILE/# &/" \
124     -e "s/^ENV_HZ/# &/" \
125     -e "s/^CHFN_AUTH/# &/" \
126     etc/login.defs > ${BINDIR}/etc/login.defs || die
127    
128     # fix some pathes in login.defs
129     # md5crypt is also controlled by pam !
130     sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
131     -e 's%/var/spool/mail%/var/mail%' \
132     -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
133     ${BINDIR}/etc/login.defs || die
134     }
135    
136     postinstall()
137     {
138     if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
139     then
140     /usr/sbin/pwconv
141     /usr/sbin/grpconv
142     elif [[ -x $(type -P chroot) ]] && [[ -d ${MROOT} ]]
143     then
144     chroot ${MROOT} /usr/sbin/pwconv || die
145     chroot ${MROOT} /usr/sbin/grpconv || die
146     else
147     echo
148     echo "pwconv and grpconv could not run in MROOT='${MROOT}'."
149     echo "PAM is not usable without any shadow/gshadow files."
150     echo "Please chroot in your systemroot and run them by hand."
151     echo
152     fi
153    
154     # pam handles limits from now on
155     if [[ -f ${MROOT}/etc/limits ]]
156     then
157     echo
158     echo "/etc/limits found and will be removed!"
159     echo "PAM handles all system limitations from now on."
160     echo "Please edit /etc/security/limits.conf accordingly."
161     echo
162     rm ${MROOT}/etc/limits
163     fi
164     }