Magellan Linux

Contents of /branches/magellan-next/core/shadow/shadow-4.1.4.3-r3.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8828 - (show annotations) (download)
Tue Aug 2 10:15:58 2011 UTC (12 years, 10 months ago) by niro
File size: 3442 byte(s)
-use new system-auth stack
1 # $Id$
2
3 PNAME="shadow"
4 PVER="4.1.4.3"
5 PBUILD="r3"
6
7 PCATEGORIE="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 >= app-shells/bash-4
14 >= sys-libs/pam-1.1.1
15 >= sys-libs/cracklib-2.8"
16
17 SDEPEND=">= sys-dev/autoconf-5
18 >= sys-dev/automake-4
19 >= sys-dev/libtool-2.2"
20
21 SRCFILE="${PNAME}-${PVER}.tar.bz2"
22 SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
23
24 # no shared libs get installed, is multilib needed anymore?
25 sminclude multilib mtools
26
27 SRC_URI=(
28 ftp://pkg-${PNAME}.alioth.debian.org/pub/pkg-${PNAME}/${SRCFILE}
29 mirror://${PNAME}/${SRCFILE}
30 mirror://${PNAME}/pamd-systemauth/chage
31 mirror://${PNAME}/pamd-systemauth/login
32 mirror://${PNAME}/pamd-systemauth/su
33 mirror://${PNAME}/${PNAME}-4.1.2.1-defaults.patch
34 mirror://${PNAME}/${PNAME}-4.1.4.2-groupmod-username.patch
35 )
36
37 UP2DATE="updatecmd ${HOMEPAGE} | grep 'New release' | sed 's/.*: \(.*\).*/\1/;q'"
38
39 src_prepare()
40 {
41 munpack ${SRCFILE} || die
42
43 # fixes useradd default settings (create_mail_spool)
44 mpatch ${PNAME}-4.1.2.1-defaults.patch || die
45
46 # fixes username issues with groupadd if pam is enabled
47 # see: http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2009-November/007850.html
48 mpatch ${PNAME}-4.1.4.2-groupmod-username.patch || die
49
50 # do not build 'groups'; coreutils provide a better version
51 all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die
52 all-abis "sed -i '/groups/d' man/Makefile.in" || die
53 }
54
55 src_compile()
56 {
57 # configures shadow with pam
58 mconfigure \
59 --enable-shared \
60 --with-libpam \
61 --with-libcrack \
62 --with-libcrypt \
63 --enable-nls \
64 --without-selinux \
65 || die
66
67 mmake || die
68 }
69
70 src_install()
71 {
72 # needed directories
73 minstalldir /etc/{default,skel} || die
74
75 # added exec_prefix for better bin location
76 mmake DESTDIR=${BINDIR} install || die
77
78 minstalletc etc/limits limits || die
79 minstalletc etc/login.access login.access || die
80
81 # makes recovery easier, when /usr is not mounted :)
82 mv -v ${BINDIR}/usr/bin/passwd ${BINDIR}/bin || die
83 mlink /bin/passwd /usr/bin || die
84
85 # install pam related configuration files
86 minstallpam login || die
87 minstallpam su || die
88 local i
89 for i in chage chfn chgpasswd chpasswd chsh \
90 groupadd groupdel groupmems groupmod \
91 newusers passwd useradd userdel usermod
92 do
93 minstallpam chage ${i} || die
94 done
95
96 # disable these checks as pam controls them now
97 sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
98 -e "s/^LASTLOG_ENAB/# &/" \
99 -e "s/^MAIL_CHECK_ENAB/# &/" \
100 -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
101 -e "s/^CONSOLE/# &/" \
102 -e "s/^MOTD_FILE/# &/" \
103 -e "s/^NOLOGINS_FILE/# &/" \
104 -e "s/^PASS_MIN_LEN/# &/" \
105 -e "s/^SU_WHEEL_ONLY/# &/" \
106 -e "s/^CONSOLE_GROUPS/# &/" \
107 -e "s/^ENVIRON_FILE/# &/" \
108 -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
109 -e "s/^CRACKLIB_DICTPATH/# &/" \
110 -e "s/^PASS_CHANGE_TRIES/# &/" \
111 -e "s/^PASS_ALWAYS_WARN/# &/" \
112 -e "s/^FAILLOG_ENAB/# &/" \
113 -e "s/^QUOTAS_ENAB/# &/" \
114 -e "s/^FTMP_FILE/# &/" \
115 -e "s/^ENV_HZ/# &/" \
116 -e "s/^CHFN_AUTH/# &/" \
117 etc/login.defs > ${BINDIR}/etc/login.defs || die
118
119 # fix some pathes in login.defs
120 # md5crypt is also controlled by pam !
121 sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
122 -e 's%/var/spool/mail%/var/mail%' \
123 -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
124 ${BINDIR}/etc/login.defs || die
125 }
126
127 postinstall()
128 {
129 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
130 then
131 /usr/sbin/pwconv
132 /usr/sbin/grpconv
133 fi
134 }