Magellan Linux

Annotation of /branches/R11-unstable/core/shadow/shadow-4.2.1-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


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