Magellan Linux

Contents of /branches/magellan-next/core/pam/pam-1.1.4-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9790 - (show annotations) (download)
Wed Jan 11 19:06:13 2012 UTC (12 years, 4 months ago) by niro
File size: 4160 byte(s)
-use mage-features
1 # $Id$
2
3 PNAME="pam"
4 PVER="1.1.4"
5 PBUILD="r4"
6
7 PCATEGORIE="sys-libs"
8
9 DESCRIPTION="Pluggable Authentication Modules."
10 HOMEPAGE="http://www.kernel.org/pub/linux/libs/pam/"
11
12 DEPEND=">= virtual/glibc
13 >= sys-libs/cracklib-2.8
14 >= dev-db/db-5.1"
15
16 SDEPEND=">= sys-dev/autoconf-5
17 >= sys-dev/automake-4
18 >= sys-dev/flex-2.5.35"
19
20 SRCFILE="Linux-PAM-${PVER}.tar.bz2"
21 SRCDIR="${BUILDDIR}/Linux-PAM-${PVER}"
22
23 sminclude mtools multilib
24
25 PAMD_HALT_REV=1.2
26 PAMD_OTHER_REV=1.2
27 PAMD_SYSAUTH_REV=1.2
28
29 SRC_URI=(
30 http://www.kernel.org/pub/linux/libs/pam/library/${SRCFILE}
31 http://www.kernel.org/pub/linux/libs/pam/pre/library/${SRCFILE}
32 mirror://${PNAME}/${SRCFILE}
33 mirror://${PNAME}/${PNAME}-${PVER}-pam-console.patch
34 mirror://${PNAME}/halt-${PAMD_HALT_REV}
35 mirror://${PNAME}/other-${PAMD_OTHER_REV}
36 mirror://${PNAME}/system-auth-${PAMD_SYSAUTH_REV}
37 mirror://${PNAME}/securetty
38 mirror://${PNAME}/console.handlers
39 )
40
41 # dev releases
42 #UP2DATE="updatecmd http://www.kernel.org/pub/linux/libs/pam/pre/library | lasttarball"
43 # stable releases
44 UP2DATE="updatecmd http://www.kernel.org/pub/linux/libs/pam/library | lasttarball"
45
46 # the strip option is not allowed, pam needs libpam.a
47 msetfeature "!strip"
48 CFLAGS="${CFLAGS/-s/}"
49 CXXFLAGS="${CFLAGS}"
50
51 src_prepare()
52 {
53 munpack ${SRCFILE} || die
54
55 # add pam_console module
56 mpatch ${PNAME}-${PVER}-pam-console.patch || die
57
58 # make sure to install readmes from all modules
59 local abi
60 for abi in ${MULTILIB_ABIS}
61 do
62 cd ${SRCDIR}-${abi}
63 install -d doc/txts || die
64 for readme in modules/pam_*/README
65 do
66 cp -f "${readme}" doc/txts/README.$(dirname "${readme}" | \
67 sed -e 's|^modules/||')
68 done
69
70 # search in /lib/cracklib
71 sed -i 's|DICT_DIR_CANDIDATES="|&/lib /lib/cracklib |' configure || die
72 done
73 }
74
75 src_compile()
76 {
77 export CFLAGS="${CFLAGS} -fPIC"
78
79 mconfigure \
80 --libdir=/'$(mlibdir)' \
81 --docdir=/usr/share/doc/${PNAME}-${PVER} \
82 --enable-securedir=/'$(mlibdir)'/security \
83 --enable-isadir=/'$(mlibdir)'/security \
84 --enable-read-both-confs \
85 || die
86
87 # python stuff in docs gives sandbox problems
88 all-abis "sed -i 's|modules doc examples|modules|' Makefile" || die
89
90 mmake -j1 || die
91 }
92
93 src_install()
94 {
95 # needed directories
96 minstalldir /etc/pam.d || die
97 all-abis minstalldir /usr/'$(mlibdir)' || die
98 minstalldir /usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die
99
100 mmake DESTDIR=${BINDIR} LDCONFIG="" install || die
101
102 local i ilver
103 for i in libpam libpam_misc libpamc
104 do
105 # get internal lib version
106 ilver="$(readlink ${BINDIR}/$(mlibdir)/${i}.so | sed s:${i}.so.::)"
107
108 # fixing symlinks in /usr/lib
109 all-abis rm -f ${BINDIR}/usr/'$(mlibdir)'/${i}.so || die
110 all-abis mlink ../../'$(mlibdir)'/${i}.so.${ilver} /usr/'$(mlibdir)'/${i}.so || die
111
112 # fixing symlinks in /lib
113 all-abis rm -f ${BINDIR}/'$(mlibdir)'/${i}.so || die
114 all-abis mlink ${i}.so.${ilver} /'$(mlibdir)'/${i}.so || die
115 all-abis mlink ${i}.so.${ilver} /'$(mlibdir)'/${i}.so.0 || die
116 done
117
118 # fix permissions
119 mchmod 4755 /sbin/unix_chkpwd || die
120
121 # install missing man-pages
122 minstallman doc/man/*.3 || die
123 minstallman doc/man/*.8 || die
124
125 # needed by pam_console
126 mkeepdir /var/run/console || die
127
128 # install our pam setup
129 minstalldir /etc/security || die
130 minstallfile -s console.handlers /etc/security/ || die
131 minstallfile -s securetty /etc/ || die
132 # pam_env needs en empty /etc/environment file or it complains
133 memptyfile /etc/environment || die
134 minstalldir /etc/pam.d || die
135 minstallpam system-auth-${PAMD_SYSAUTH_REV} system-auth || die
136 minstallpam other-${PAMD_OTHER_REV} other || die
137 for i in halt reboot poweroff
138 do
139 minstallpam halt-${PAMD_HALT_REV} ${i} || die
140 done
141
142 minstalldocs CHANGELOG Copyright README || die
143 minstallfile doc/specs/\*.raw /usr/share/doc/${PNAME}-${PVER}/spec || die
144 minstallfile doc/specs/\*.txt /usr/share/doc/${PNAME}-${PVER}/spec || die
145 minstallfile doc/txts/\* /usr/share/doc/${PNAME}-${PVER}/txt || die
146 gzip -9r ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die
147
148 # check for pam_cracklib existence or die
149 [ -e ${BINDIR}/$(mlibdir)/security/pam_cracklib.so ] || die "pam_cracklib not found, your sys-libs/cracklib installation may be corrupt!"
150 }