Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11293 - (hide annotations) (download)
Fri Mar 2 13:09:25 2012 UTC (12 years, 6 months ago) by niro
File size: 4324 byte(s)
-added patches to fix a usedel crash and restore wtmp writes
1 niro 11288 # $Id$
2    
3     PNAME="shadow"
4     PVER="4.1.5"
5     PBUILD="r1"
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.5
14     >= app-shells/bash-4
15     >= sys-libs/pam-1.1.1
16     >= sys-libs/cracklib-2.8"
17    
18     SDEPEND=">= sys-dev/autoconf-5
19     >= sys-dev/automake-4
20     >= sys-dev/libtool-2.2"
21    
22     SRCFILE="${PNAME}-${PVER}.tar.bz2"
23     SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
24    
25     # no shared libs get installed, is multilib needed anymore?
26     sminclude multilib mtools
27    
28     PAMD_CHAGE_REV=1.2
29     PAMD_LOGIN_REV=1.2
30     PAMD_SU_REV=1.2
31    
32     SRC_URI=(
33 niro 11289 http://pkg-${PNAME}.alioth.debian.org/releases/${SRCFILE}
34 niro 11288 mirror://${PNAME}/${SRCFILE}
35     mirror://${PNAME}/pamd-systemauth/chage-${PAMD_CHAGE_REV}
36     mirror://${PNAME}/pamd-systemauth/login-${PAMD_LOGIN_REV}
37     mirror://${PNAME}/pamd-systemauth/su-${PAMD_SU_REV}
38     mirror://${PNAME}/${PNAME}-4.1.2.1-defaults.patch
39 niro 11291 mirror://${PNAME}/${PNAME}-${PVER}-missing-include.patch
40 niro 11292 mirror://${PNAME}/${PNAME}-${PVER}-nscd-error-reporting.patch
41 niro 11293 mirror://${PNAME}/${PNAME}-${PVER}-write-utmp-wtmp-entries.patch
42     mirror://${PNAME}/${PNAME}-${PVER}-userdel-avoid-bad-mem-access.patch
43 niro 11288 )
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 niro 11291 # fix a missing include
55     mpatch ${PNAME}-${PVER}-missing-include.patch || die
56    
57 niro 11292 # fix nscd error handling
58     mpatch ${PNAME}-${PVER}-nscd-error-reporting.patch || die
59    
60 niro 11293 # revert change to login preventing utmp/wtmp writes
61     mpatch ${PNAME}-${PVER}-write-utmp-wtmp-entries.patch || die
62    
63     # fix x86 userdel crash
64     mpatch ${PNAME}-${PVER}-userdel-avoid-bad-mem-access.patch || die
65    
66 niro 11288 # do not build 'groups'; coreutils provide a better version
67     all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die
68     all-abis "sed -i '/groups/d' man/Makefile.in" || die
69     }
70    
71     src_compile()
72     {
73     # configures shadow with pam
74     mconfigure \
75     --enable-shared \
76     --with-libpam \
77     --with-libcrack \
78     --with-libcrypt \
79     --enable-nls \
80     --without-selinux \
81     || die
82    
83     mmake || die
84     }
85    
86     src_install()
87     {
88     # needed directories
89     minstalldir /etc/{default,skel} || die
90    
91     # added exec_prefix for better bin location
92     mmake DESTDIR=${BINDIR} install || die
93    
94     minstalletc etc/limits limits || die
95     minstalletc etc/login.access login.access || die
96    
97     # makes recovery easier, when /usr is not mounted :)
98     mv -v ${BINDIR}/usr/bin/passwd ${BINDIR}/bin || die
99     mlink /bin/passwd /usr/bin || die
100    
101     # install pam related configuration files
102     minstallpam login-${PAMD_LOGIN_REV} login || die
103     minstallpam su-${PAMD_SU_REV} su || die
104     local i
105     for i in chage chfn chgpasswd chpasswd chsh \
106     groupadd groupdel groupmems groupmod \
107     newusers passwd useradd userdel usermod
108     do
109     minstallpam chage-${PAMD_CHAGE_REV} ${i} || die
110     done
111    
112     # disable these checks as pam controls them now
113     sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
114     -e "s/^LASTLOG_ENAB/# &/" \
115     -e "s/^MAIL_CHECK_ENAB/# &/" \
116     -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
117     -e "s/^CONSOLE/# &/" \
118     -e "s/^MOTD_FILE/# &/" \
119     -e "s/^NOLOGINS_FILE/# &/" \
120     -e "s/^PASS_MIN_LEN/# &/" \
121     -e "s/^SU_WHEEL_ONLY/# &/" \
122     -e "s/^CONSOLE_GROUPS/# &/" \
123     -e "s/^ENVIRON_FILE/# &/" \
124     -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
125     -e "s/^CRACKLIB_DICTPATH/# &/" \
126     -e "s/^PASS_CHANGE_TRIES/# &/" \
127     -e "s/^PASS_ALWAYS_WARN/# &/" \
128     -e "s/^FAILLOG_ENAB/# &/" \
129     -e "s/^QUOTAS_ENAB/# &/" \
130     -e "s/^FTMP_FILE/# &/" \
131     -e "s/^ENV_HZ/# &/" \
132     -e "s/^CHFN_AUTH/# &/" \
133     etc/login.defs > ${BINDIR}/etc/login.defs || die
134    
135     # fix some pathes in login.defs
136     # md5crypt is also controlled by pam !
137     sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
138     -e 's%/var/spool/mail%/var/mail%' \
139     -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
140     ${BINDIR}/etc/login.defs || die
141     }
142    
143     postinstall()
144     {
145     if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
146     then
147     /usr/sbin/pwconv
148     /usr/sbin/grpconv
149     elif [[ -x /sbin/chroot ]] && [[ -d ${MROOT} ]]
150     then
151     chroot ${MROOT} /usr/sbin/pwconv || die
152     chroot ${MROOT} /usr/sbin/grpconv || die
153     else
154     echo "pwconv and grpconv could not run in MROOT='${MROOT}'."
155     echo "PAM is not usable without any shadow/gshadow files."
156     echo "Please chroot in your systemroot and run them by hand."
157     fi
158     }