Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12843 - (show annotations) (download)
Wed Jul 4 08:48:12 2012 UTC (11 years, 10 months ago) by niro
File size: 3798 byte(s)
-marked stable
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 )
42
43 UP2DATE="updatecmd ${HOMEPAGE} | grep 'New release' | sed 's/.*: \(.*\).*/\1/;q'"
44
45 src_prepare()
46 {
47 munpack ${SRCFILE} || die
48
49 # fixes useradd default settings (create_mail_spool)
50 mpatch ${PNAME}-4.1.2.1-defaults.patch || die
51
52 # fix a missing include
53 mpatch ${PNAME}-4.1.5-missing-include.patch || die
54
55 # do not build 'groups'; coreutils provide a better version
56 all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die
57 all-abis "sed -i '/groups/d' man/Makefile.in" || die
58 }
59
60 src_compile()
61 {
62 # configures shadow with pam
63 mconfigure \
64 --exec-prefix=/usr \
65 --enable-shared \
66 --with-libpam \
67 --with-libcrack \
68 --with-libcrypt \
69 --enable-nls \
70 --without-selinux \
71 || die
72
73 mmake || die
74 }
75
76 src_install()
77 {
78 # needed directories
79 minstalldir /etc/{default,skel} || die
80
81 # added exec_prefix for better bin location
82 mmake DESTDIR=${BINDIR} install || die
83
84 minstalletc etc/limits limits || die
85 minstalletc etc/login.access login.access || die
86
87 # install pam related configuration files
88 minstallpam login-${PAMD_LOGIN_REV} login || die
89 minstallpam su-${PAMD_SU_REV} su || die
90 local i
91 for i in chgpasswd chpasswd passwd
92 do
93 minstallpam passwd ${i} || die
94 done
95 for i in chage chfn chsh \
96 groupadd groupdel groupmems groupmod \
97 newusers useradd userdel usermod
98 do
99 minstallpam chage-${PAMD_CHAGE_REV} ${i} || die
100 done
101
102 # disable these checks as pam controls them now
103 sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
104 -e "s/^LASTLOG_ENAB/# &/" \
105 -e "s/^MAIL_CHECK_ENAB/# &/" \
106 -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
107 -e "s/^CONSOLE/# &/" \
108 -e "s/^MOTD_FILE/# &/" \
109 -e "s/^NOLOGINS_FILE/# &/" \
110 -e "s/^PASS_MIN_LEN/# &/" \
111 -e "s/^SU_WHEEL_ONLY/# &/" \
112 -e "s/^CONSOLE_GROUPS/# &/" \
113 -e "s/^ENVIRON_FILE/# &/" \
114 -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
115 -e "s/^CRACKLIB_DICTPATH/# &/" \
116 -e "s/^PASS_CHANGE_TRIES/# &/" \
117 -e "s/^PASS_ALWAYS_WARN/# &/" \
118 -e "s/^FAILLOG_ENAB/# &/" \
119 -e "s/^QUOTAS_ENAB/# &/" \
120 -e "s/^FTMP_FILE/# &/" \
121 -e "s/^ENV_HZ/# &/" \
122 -e "s/^CHFN_AUTH/# &/" \
123 etc/login.defs > ${BINDIR}/etc/login.defs || die
124
125 # fix some pathes in login.defs
126 # md5crypt is also controlled by pam !
127 sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
128 -e 's%/var/spool/mail%/var/mail%' \
129 -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
130 ${BINDIR}/etc/login.defs || die
131 }
132
133 postinstall()
134 {
135 if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
136 then
137 /usr/sbin/pwconv
138 /usr/sbin/grpconv
139 elif [[ -x /sbin/chroot ]] && [[ -d ${MROOT} ]]
140 then
141 chroot ${MROOT} /usr/sbin/pwconv || die
142 chroot ${MROOT} /usr/sbin/grpconv || die
143 else
144 echo "pwconv and grpconv could not run in MROOT='${MROOT}'."
145 echo "PAM is not usable without any shadow/gshadow files."
146 echo "Please chroot in your systemroot and run them by hand."
147 fi
148 }