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