Magellan Linux

Contents of /trunk/core/shadow/shadow-4.1.5.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12695 - (show annotations) (download)
Thu Jun 28 10:55:12 2012 UTC (11 years, 11 months ago) by niro
File size: 4142 byte(s)
-removed upstream applied patches
1 # $Id$
2
3 PNAME="shadow"
4 PVER="4.1.5.1"
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.7
14 >= app-shells/bash-4
15 >= sys-libs/pam-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}-4.1.5-missing-include.patch
41 mirror://${PNAME}/${PNAME}-4.1.5-write-utmp-wtmp-entries.patch
42 mirror://${PNAME}/${PNAME}-4.1.5-userdel-avoid-bad-mem-access.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 # revert change to login preventing utmp/wtmp writes
58 mpatch -RNp1 ${PNAME}-4.1.5-write-utmp-wtmp-entries.patch || die
59
60 # fix x86 userdel crash
61 mpatch ${PNAME}-4.1.5-userdel-avoid-bad-mem-access.patch || die
62
63 # do not build 'groups'; coreutils provide a better version
64 all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die
65 all-abis "sed -i '/groups/d' man/Makefile.in" || die
66 }
67
68 src_compile()
69 {
70 # configures shadow with pam
71 mconfigure \
72 --exec-prefix=/usr \
73 --enable-shared \
74 --with-libpam \
75 --with-libcrack \
76 --with-libcrypt \
77 --enable-nls \
78 --without-selinux \
79 || die
80
81 mmake || die
82 }
83
84 src_install()
85 {
86 # needed directories
87 minstalldir /etc/{default,skel} || die
88
89 # added exec_prefix for better bin location
90 mmake DESTDIR=${BINDIR} install || die
91
92 minstalletc etc/limits limits || die
93 minstalletc etc/login.access login.access || die
94
95 # install pam related configuration files
96 minstallpam login-${PAMD_LOGIN_REV} login || die
97 minstallpam su-${PAMD_SU_REV} su || die
98 local i
99 for i in chgpasswd chpasswd passwd
100 do
101 minstallpam passwd ${i} || die
102 done
103 for i in chage chfn chsh \
104 groupadd groupdel groupmems groupmod \
105 newusers useradd userdel usermod
106 do
107 minstallpam chage-${PAMD_CHAGE_REV} ${i} || die
108 done
109
110 # disable these checks as pam controls them now
111 sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
112 -e "s/^LASTLOG_ENAB/# &/" \
113 -e "s/^MAIL_CHECK_ENAB/# &/" \
114 -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
115 -e "s/^CONSOLE/# &/" \
116 -e "s/^MOTD_FILE/# &/" \
117 -e "s/^NOLOGINS_FILE/# &/" \
118 -e "s/^PASS_MIN_LEN/# &/" \
119 -e "s/^SU_WHEEL_ONLY/# &/" \
120 -e "s/^CONSOLE_GROUPS/# &/" \
121 -e "s/^ENVIRON_FILE/# &/" \
122 -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
123 -e "s/^CRACKLIB_DICTPATH/# &/" \
124 -e "s/^PASS_CHANGE_TRIES/# &/" \
125 -e "s/^PASS_ALWAYS_WARN/# &/" \
126 -e "s/^FAILLOG_ENAB/# &/" \
127 -e "s/^QUOTAS_ENAB/# &/" \
128 -e "s/^FTMP_FILE/# &/" \
129 -e "s/^ENV_HZ/# &/" \
130 -e "s/^CHFN_AUTH/# &/" \
131 etc/login.defs > ${BINDIR}/etc/login.defs || die
132
133 # fix some pathes in login.defs
134 # md5crypt is also controlled by pam !
135 sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
136 -e 's%/var/spool/mail%/var/mail%' \
137 -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
138 ${BINDIR}/etc/login.defs || die
139 }
140
141 postinstall()
142 {
143 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
144 then
145 /usr/bin/pwconv
146 /usr/bin/grpconv
147 elif [[ -x /usr/bin/chroot ]] && [[ -d ${MROOT} ]]
148 then
149 chroot ${MROOT} /usr/bin/pwconv || die
150 chroot ${MROOT} /usr/bin/grpconv || die
151 else
152 echo "pwconv and grpconv could not run in MROOT='${MROOT}'."
153 echo "PAM is not usable without any shadow/gshadow files."
154 echo "Please chroot in your systemroot and run them by hand."
155 fi
156 }