Magellan Linux

Contents of /branches/R11-stable/core/shadow/shadow-4.2.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 21659 - (show annotations) (download)
Mon Jul 21 09:27:50 2014 UTC (9 years, 9 months ago) by niro
File size: 4109 byte(s)
-release branches/R11-stable
1 # $Id$
2
3 PNAME="shadow"
4 PVER="4.2.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 >= 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 || die
74
75 mmake || die
76 }
77
78 src_install()
79 {
80 # needed directories
81 minstalldir /etc/{default,skel} || die
82
83 # added exec_prefix for better bin location
84 mmake DESTDIR=${BINDIR} install || die
85
86 minstalletc etc/login.access login.access || die
87
88 # install pam related configuration files
89 minstallpam login-${PAMD_LOGIN_REV} login || die
90 minstallpam su-${PAMD_SU_REV} su || die
91 local i
92 for i in chgpasswd chpasswd passwd
93 do
94 minstallpam passwd ${i} || die
95 done
96 for i in chage chfn chsh \
97 groupadd groupdel groupmems groupmod \
98 newusers useradd userdel usermod
99 do
100 minstallpam chage-${PAMD_CHAGE_REV} ${i} || die
101 done
102
103 # disable these checks as pam controls them now
104 sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
105 -e "s/^LASTLOG_ENAB/# &/" \
106 -e "s/^MAIL_CHECK_ENAB/# &/" \
107 -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
108 -e "s/^CONSOLE/# &/" \
109 -e "s/^MOTD_FILE/# &/" \
110 -e "s/^NOLOGINS_FILE/# &/" \
111 -e "s/^PASS_MIN_LEN/# &/" \
112 -e "s/^SU_WHEEL_ONLY/# &/" \
113 -e "s/^CONSOLE_GROUPS/# &/" \
114 -e "s/^ENVIRON_FILE/# &/" \
115 -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
116 -e "s/^CRACKLIB_DICTPATH/# &/" \
117 -e "s/^PASS_CHANGE_TRIES/# &/" \
118 -e "s/^PASS_ALWAYS_WARN/# &/" \
119 -e "s/^FAILLOG_ENAB/# &/" \
120 -e "s/^QUOTAS_ENAB/# &/" \
121 -e "s/^FTMP_FILE/# &/" \
122 -e "s/^ENV_HZ/# &/" \
123 -e "s/^CHFN_AUTH/# &/" \
124 etc/login.defs > ${BINDIR}/etc/login.defs || die
125
126 # fix some pathes in login.defs
127 # md5crypt is also controlled by pam !
128 sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
129 -e 's%/var/spool/mail%/var/mail%' \
130 -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
131 ${BINDIR}/etc/login.defs || die
132 }
133
134 postinstall()
135 {
136 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
137 then
138 /usr/sbin/pwconv
139 /usr/sbin/grpconv
140 elif [[ -x $(type -P chroot) ]] && [[ -d ${MROOT} ]]
141 then
142 chroot ${MROOT} /usr/sbin/pwconv || die
143 chroot ${MROOT} /usr/sbin/grpconv || die
144 else
145 echo
146 echo "pwconv and grpconv could not run in MROOT='${MROOT}'."
147 echo "PAM is not usable without any shadow/gshadow files."
148 echo "Please chroot in your systemroot and run them by hand."
149 echo
150 fi
151
152 # pam handles limits from now on
153 if [[ -f ${MROOT}/etc/limits ]]
154 then
155 echo
156 echo "/etc/limits found and will be removed!"
157 echo "PAM handles all system limitations from now on."
158 echo "Please edit /etc/security/limits.conf accordingly."
159 echo
160 rm ${MROOT}/etc/limits
161 fi
162 }