Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33016 - (hide annotations) (download)
Wed Oct 9 13:43:34 2019 UTC (4 years, 7 months ago) by niro
File size: 3470 byte(s)
-fixed /var/run warnings from systemd-tmpfilesd
1 niro 33016 # $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     CFLAGS="${CFLAGS/-s/}"
42     CXXFLAGS="${CFLAGS}"
43    
44     src_prepare()
45     {
46     munpack ${SRCFILE} || die
47     SRCDIR=${PAMCONFIG_SRCDIR} munpack ${PAMCONFIG_SRCFILE} || die
48    
49     mpatch ${PNAME}-1.1.8-full-relro.patch || die
50     mautoreconf || die
51    
52     # make sure to install readmes from all modules
53     local abi
54     for abi in ${MULTILIB_ABIS}
55     do
56     cd ${SRCDIR}-${abi}
57     install -d doc/txts || die
58     for readme in modules/pam_*/README
59     do
60     cp -f "${readme}" doc/txts/README.$(dirname "${readme}" | \
61     sed -e 's|^modules/||')
62     done
63    
64     # search in /usr/lib/cracklib
65     sed -i 's|DICT_DIR_CANDIDATES="|&/lib /usr/lib/cracklib |' configure || die
66     done
67     }
68    
69     src_compile()
70     {
71     mconfigure \
72     --libdir=/usr/'$(mlibdir)' \
73     --sbindir=/usr/sbin \
74     --docdir=/usr/share/doc/${PNAME}-${PVER} \
75     --enable-securedir=/usr/'$(mlibdir)'/security \
76     --enable-isadir=/usr/'$(mlibdir)'/security \
77     --enable-read-both-confs \
78     || die
79    
80     # python stuff in docs gives sandbox problems
81     all-abis "sed -i 's|modules doc examples|modules|' Makefile" || die
82    
83     mmake -j1 || die
84     }
85    
86     src_install()
87     {
88     # needed directories
89     minstalldir /etc/pam.d || die
90     all-abis minstalldir /usr/'$(mlibdir)' || die
91     minstalldir /usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die
92    
93     mmake -j1 DESTDIR=${BINDIR} install || die
94    
95     # fix permissions
96     mchmod 4755 /usr/sbin/unix_chkpwd || die
97    
98     # install missing man-pages
99     minstallman doc/man/*.3 || die
100     minstallman doc/man/*.8 || die
101    
102     # missing empty dirs
103     mkeepdir /etc/security/console.perms.d || die
104     mkeepdir /etc/security/namespace.d || die
105     mkeepdir /etc/security/limits.d || die
106    
107     # install our pam setup
108     SRCDIR=${PAMCONFIG_SRCDIR} mmake DESTDIR=${BINDIR} install || die
109    
110     minstalldocs CHANGELOG Copyright README || die
111     minstallfile doc/specs/\*.raw /usr/share/doc/${PNAME}-${PVER}/spec || die
112     minstallfile doc/specs/\*.txt /usr/share/doc/${PNAME}-${PVER}/spec || die
113     minstallfile doc/txts/\* /usr/share/doc/${PNAME}-${PVER}/txt || die
114     gzip -9r ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die
115    
116     # check for pam_cracklib existence or die
117     [ -e ${BINDIR}/usr/$(mlibdir)/security/pam_cracklib.so ] || die "pam_cracklib not found, your sys-libs/cracklib installation may be corrupt!"
118     }
119    
120     postinstall()
121     {
122     local i
123     local conf="halt reboot poweroff"
124    
125     # remove deprecated pam configs
126     for i in ${conf}
127     do
128     if [ -f ${MROOT}/etc/pam.d/${i} ]
129     then
130     rm ${MROOT}/etc/pam.d/${i}
131     fi
132     done
133    
134     # remove deprected nproc.conf
135     if [ -f ${MROOT}/etc/security/limits.d/nproc.conf ]
136     then
137     rm ${MROOT}/etc/security/limits.d/nproc.conf
138     fi
139     }