Magellan Linux

Contents of /trunk/core/shadow/shadow-4.1.5-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11766 - (show annotations) (download)
Thu Apr 5 12:33:33 2012 UTC (12 years, 1 month ago) by niro
File size: 4425 byte(s)
-reworked system-auth
1 # $Id$
2
3 PNAME="shadow"
4 PVER="4.1.5"
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.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.3
29 PAMD_LOGIN_REV=1.3
30 PAMD_SU_REV=1.3
31
32 SRC_URI=(
33 http://pkg-${PNAME}.alioth.debian.org/releases/${SRCFILE}
34 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}/pamd-systemauth/passwd
39 mirror://${PNAME}/${PNAME}-4.1.2.1-defaults.patch
40 mirror://${PNAME}/${PNAME}-${PVER}-missing-include.patch
41 mirror://${PNAME}/${PNAME}-${PVER}-nscd-error-reporting.patch
42 mirror://${PNAME}/${PNAME}-${PVER}-write-utmp-wtmp-entries.patch
43 mirror://${PNAME}/${PNAME}-${PVER}-userdel-avoid-bad-mem-access.patch
44 )
45
46 UP2DATE="updatecmd ${HOMEPAGE} | grep 'New release' | sed 's/.*: \(.*\).*/\1/;q'"
47
48 src_prepare()
49 {
50 munpack ${SRCFILE} || die
51
52 # fixes useradd default settings (create_mail_spool)
53 mpatch ${PNAME}-4.1.2.1-defaults.patch || die
54
55 # fix a missing include
56 mpatch ${PNAME}-${PVER}-missing-include.patch || die
57
58 # fix nscd error handling
59 mpatch ${PNAME}-${PVER}-nscd-error-reporting.patch || die
60
61 # revert change to login preventing utmp/wtmp writes
62 mpatch -RNp1 ${PNAME}-${PVER}-write-utmp-wtmp-entries.patch || die
63
64 # fix x86 userdel crash
65 mpatch ${PNAME}-${PVER}-userdel-avoid-bad-mem-access.patch || die
66
67 # do not build 'groups'; coreutils provide a better version
68 all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die
69 all-abis "sed -i '/groups/d' man/Makefile.in" || die
70 }
71
72 src_compile()
73 {
74 # configures shadow with pam
75 mconfigure \
76 --enable-shared \
77 --with-libpam \
78 --with-libcrack \
79 --with-libcrypt \
80 --enable-nls \
81 --without-selinux \
82 || die
83
84 mmake || die
85 }
86
87 src_install()
88 {
89 # needed directories
90 minstalldir /etc/{default,skel} || die
91
92 # added exec_prefix for better bin location
93 mmake DESTDIR=${BINDIR} install || die
94
95 minstalletc etc/limits limits || die
96 minstalletc etc/login.access login.access || die
97
98 # makes recovery easier, when /usr is not mounted :)
99 mv -v ${BINDIR}/usr/bin/passwd ${BINDIR}/bin || die
100 mlink /bin/passwd /usr/bin || die
101
102 # install pam related configuration files
103 minstallpam login-${PAMD_LOGIN_REV} login || die
104 minstallpam su-${PAMD_SU_REV} su || die
105 local i
106 for i in chgpasswd chpasswd passwd
107 do
108 minstallpam passwd ${i} || die
109 done
110 for i in chage chfn chsh \
111 groupadd groupdel groupmems groupmod \
112 newusers useradd userdel usermod
113 do
114 minstallpam chage-${PAMD_CHAGE_REV} ${i} || die
115 done
116
117 # disable these checks as pam controls them now
118 sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
119 -e "s/^LASTLOG_ENAB/# &/" \
120 -e "s/^MAIL_CHECK_ENAB/# &/" \
121 -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
122 -e "s/^CONSOLE/# &/" \
123 -e "s/^MOTD_FILE/# &/" \
124 -e "s/^NOLOGINS_FILE/# &/" \
125 -e "s/^PASS_MIN_LEN/# &/" \
126 -e "s/^SU_WHEEL_ONLY/# &/" \
127 -e "s/^CONSOLE_GROUPS/# &/" \
128 -e "s/^ENVIRON_FILE/# &/" \
129 -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
130 -e "s/^CRACKLIB_DICTPATH/# &/" \
131 -e "s/^PASS_CHANGE_TRIES/# &/" \
132 -e "s/^PASS_ALWAYS_WARN/# &/" \
133 -e "s/^FAILLOG_ENAB/# &/" \
134 -e "s/^QUOTAS_ENAB/# &/" \
135 -e "s/^FTMP_FILE/# &/" \
136 -e "s/^ENV_HZ/# &/" \
137 -e "s/^CHFN_AUTH/# &/" \
138 etc/login.defs > ${BINDIR}/etc/login.defs || die
139
140 # fix some pathes in login.defs
141 # md5crypt is also controlled by pam !
142 sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
143 -e 's%/var/spool/mail%/var/mail%' \
144 -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
145 ${BINDIR}/etc/login.defs || die
146 }
147
148 postinstall()
149 {
150 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
151 then
152 /usr/sbin/pwconv
153 /usr/sbin/grpconv
154 elif [[ -x /sbin/chroot ]] && [[ -d ${MROOT} ]]
155 then
156 chroot ${MROOT} /usr/sbin/pwconv || die
157 chroot ${MROOT} /usr/sbin/grpconv || die
158 else
159 echo "pwconv and grpconv could not run in MROOT='${MROOT}'."
160 echo "PAM is not usable without any shadow/gshadow files."
161 echo "Please chroot in your systemroot and run them by hand."
162 fi
163 }