Magellan Linux

Contents of /trunk/core/pam/pam-1.3.0-r2.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33017 - (show annotations) (download)
Wed Oct 9 13:48:03 2019 UTC (4 years, 6 months ago) by niro
File size: 3426 byte(s)
-fixed /var/run warnings from systemd-tmpfilesd
1 # $Id$
2
3 PNAME="pam"
4 PVER="1.3.0"
5 PBUILD="r2"
6
7 PCAT="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.9
14 >= dev-db/db-6.2"
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 PAMCONFIG_PVER="1.7"
24 PAMCONFIG_SRCFILE="pam-config-${PAMCONFIG_PVER}.tar.bz2"
25 PAMCONFIG_SRCDIR="${BUILDDIR}/pam-config-${PAMCONFIG_PVER}"
26
27 # NOTE: pam builds may break if an older pam is already installed!
28 sminclude mtools multilib
29
30 SRC_URI=(
31 http://linux-pam.org/library/${SRCFILE}
32 mirror://${PNAME}/${SRCFILE}
33 mirror://${PNAME}/${PAMCONFIG_SRCFILE}
34 mirror://${PNAME}/${PNAME}-1.1.8-full-relro.patch
35 )
36
37 UP2DATE="updatecmd http://linux-pam.org/library/ | highesttarball"
38
39 # the strip option is not allowed, pam needs libpam.a
40 msetfeature "!strip"
41
42 src_prepare()
43 {
44 munpack ${SRCFILE} || die
45 SRCDIR=${PAMCONFIG_SRCDIR} munpack ${PAMCONFIG_SRCFILE} || die
46
47 mpatch ${PNAME}-1.1.8-full-relro.patch || die
48 mautoreconf || die
49
50 # make sure to install readmes from all modules
51 local abi
52 for abi in ${MULTILIB_ABIS}
53 do
54 cd ${SRCDIR}-${abi}
55 install -d doc/txts || die
56 for readme in modules/pam_*/README
57 do
58 cp -f "${readme}" doc/txts/README.$(dirname "${readme}" | \
59 sed -e 's|^modules/||')
60 done
61
62 # search in /usr/lib/cracklib
63 sed -i 's|DICT_DIR_CANDIDATES="|&/lib /usr/lib/cracklib |' configure || die
64 done
65 }
66
67 src_compile()
68 {
69 mconfigure \
70 --libdir=/usr/'$(mlibdir)' \
71 --sbindir=/usr/sbin \
72 --docdir=/usr/share/doc/${PNAME}-${PVER} \
73 --enable-securedir=/usr/'$(mlibdir)'/security \
74 --enable-isadir=/usr/'$(mlibdir)'/security \
75 --enable-read-both-confs \
76 || die
77
78 # python stuff in docs gives sandbox problems
79 all-abis "sed -i 's|modules doc examples|modules|' Makefile" || die
80
81 mmake -j1 || die
82 }
83
84 src_install()
85 {
86 # needed directories
87 minstalldir /etc/pam.d || die
88 all-abis minstalldir /usr/'$(mlibdir)' || die
89 minstalldir /usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die
90
91 mmake -j1 DESTDIR=${BINDIR} install || die
92
93 # fix permissions
94 mchmod 4755 /usr/sbin/unix_chkpwd || die
95
96 # install missing man-pages
97 minstallman doc/man/*.3 || die
98 minstallman doc/man/*.8 || die
99
100 # missing empty dirs
101 mkeepdir /etc/security/console.perms.d || die
102 mkeepdir /etc/security/namespace.d || die
103 mkeepdir /etc/security/limits.d || die
104
105 # install our pam setup
106 SRCDIR=${PAMCONFIG_SRCDIR} mmake DESTDIR=${BINDIR} install || die
107
108 minstalldocs CHANGELOG Copyright README || die
109 minstallfile doc/specs/\*.raw /usr/share/doc/${PNAME}-${PVER}/spec || die
110 minstallfile doc/specs/\*.txt /usr/share/doc/${PNAME}-${PVER}/spec || die
111 minstallfile doc/txts/\* /usr/share/doc/${PNAME}-${PVER}/txt || die
112 gzip -9r ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die
113
114 # check for pam_cracklib existence or die
115 [ -e ${BINDIR}/usr/$(mlibdir)/security/pam_cracklib.so ] || die "pam_cracklib not found, your sys-libs/cracklib installation may be corrupt!"
116 }
117
118 postinstall()
119 {
120 local i
121 local conf="halt reboot poweroff"
122
123 # remove deprecated pam configs
124 for i in ${conf}
125 do
126 if [ -f ${MROOT}/etc/pam.d/${i} ]
127 then
128 rm ${MROOT}/etc/pam.d/${i}
129 fi
130 done
131
132 # remove deprected nproc.conf
133 if [ -f ${MROOT}/etc/security/limits.d/nproc.conf ]
134 then
135 rm ${MROOT}/etc/security/limits.d/nproc.conf
136 fi
137 }