Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 8844 - (hide annotations) (download)
Wed Aug 3 08:03:10 2011 UTC (12 years, 10 months ago) by niro
File size: 3804 byte(s)
-added missing base-files dep, which conains the passwd/group files now
1 niro 8828 # $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 niro 8844 >= sys-apps/base-files-0.5
14 niro 8828 >= 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     SRC_URI=(
29     ftp://pkg-${PNAME}.alioth.debian.org/pub/pkg-${PNAME}/${SRCFILE}
30     mirror://${PNAME}/${SRCFILE}
31     mirror://${PNAME}/pamd-systemauth/chage
32     mirror://${PNAME}/pamd-systemauth/login
33     mirror://${PNAME}/pamd-systemauth/su
34     mirror://${PNAME}/${PNAME}-4.1.2.1-defaults.patch
35     mirror://${PNAME}/${PNAME}-4.1.4.2-groupmod-username.patch
36     )
37    
38     UP2DATE="updatecmd ${HOMEPAGE} | grep 'New release' | sed 's/.*: \(.*\).*/\1/;q'"
39    
40     src_prepare()
41     {
42     munpack ${SRCFILE} || die
43    
44     # fixes useradd default settings (create_mail_spool)
45     mpatch ${PNAME}-4.1.2.1-defaults.patch || die
46    
47     # fixes username issues with groupadd if pam is enabled
48     # see: http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2009-November/007850.html
49     mpatch ${PNAME}-4.1.4.2-groupmod-username.patch || die
50    
51     # do not build 'groups'; coreutils provide a better version
52     all-abis "sed -i 's/groups$(EXEEXT) //' src/Makefile.in" || die
53     all-abis "sed -i '/groups/d' man/Makefile.in" || die
54     }
55    
56     src_compile()
57     {
58     # configures shadow with pam
59     mconfigure \
60     --enable-shared \
61     --with-libpam \
62     --with-libcrack \
63     --with-libcrypt \
64     --enable-nls \
65     --without-selinux \
66     || die
67    
68     mmake || die
69     }
70    
71     src_install()
72     {
73     # needed directories
74     minstalldir /etc/{default,skel} || die
75    
76     # added exec_prefix for better bin location
77     mmake DESTDIR=${BINDIR} install || die
78    
79     minstalletc etc/limits limits || die
80     minstalletc etc/login.access login.access || die
81    
82     # makes recovery easier, when /usr is not mounted :)
83     mv -v ${BINDIR}/usr/bin/passwd ${BINDIR}/bin || die
84     mlink /bin/passwd /usr/bin || die
85    
86     # install pam related configuration files
87     minstallpam login || die
88     minstallpam su || die
89     local i
90     for i in chage chfn chgpasswd chpasswd chsh \
91     groupadd groupdel groupmems groupmod \
92     newusers passwd useradd userdel usermod
93     do
94     minstallpam chage ${i} || die
95     done
96    
97     # disable these checks as pam controls them now
98     sed -e "s/^DIALUPS_CHECK_ENAB/# &/" \
99     -e "s/^LASTLOG_ENAB/# &/" \
100     -e "s/^MAIL_CHECK_ENAB/# &/" \
101     -e "s/^PORTTIME_CHECKS_ENAB/# &/" \
102     -e "s/^CONSOLE/# &/" \
103     -e "s/^MOTD_FILE/# &/" \
104     -e "s/^NOLOGINS_FILE/# &/" \
105     -e "s/^PASS_MIN_LEN/# &/" \
106     -e "s/^SU_WHEEL_ONLY/# &/" \
107     -e "s/^CONSOLE_GROUPS/# &/" \
108     -e "s/^ENVIRON_FILE/# &/" \
109     -e "s/^OBSCURE_CHECKS_ENAB/# &/" \
110     -e "s/^CRACKLIB_DICTPATH/# &/" \
111     -e "s/^PASS_CHANGE_TRIES/# &/" \
112     -e "s/^PASS_ALWAYS_WARN/# &/" \
113     -e "s/^FAILLOG_ENAB/# &/" \
114     -e "s/^QUOTAS_ENAB/# &/" \
115     -e "s/^FTMP_FILE/# &/" \
116     -e "s/^ENV_HZ/# &/" \
117     -e "s/^CHFN_AUTH/# &/" \
118     etc/login.defs > ${BINDIR}/etc/login.defs || die
119    
120     # fix some pathes in login.defs
121     # md5crypt is also controlled by pam !
122     sed -i -e "s/^MD5_CRYPT_ENAB/# &/" \
123     -e 's%/var/spool/mail%/var/mail%' \
124     -e 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' \
125     ${BINDIR}/etc/login.defs || die
126     }
127    
128     postinstall()
129     {
130     if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]]
131     then
132     /usr/sbin/pwconv
133     /usr/sbin/grpconv
134 niro 8843 elif [[ -x /sbin/chroot ]] && [[ -d ${MROOT} ]]
135     then
136     chroot ${MROOT} /usr/sbin/pwconv || die
137     chroot ${MROOT} /usr/sbin/grpconv || die
138     else
139     echo "pwconv and grpconv could not run in MROOT='${MROOT}'."
140     echo "PAM is not usable without any shadow/gshadow files."
141     echo "Please chroot in your systemroot and run them by hand."
142 niro 8828 fi
143     }