# $Id$ PNAME="pam" PVER="1.1.8" PBUILD="r1" PCAT="sys-libs" DESCRIPTION="Pluggable Authentication Modules." HOMEPAGE="http://www.kernel.org/pub/linux/libs/pam/" DEPEND=">= virtual/glibc >= sys-libs/cracklib-2.9 >= dev-db/db-6.0" SDEPEND=">= sys-dev/autoconf-5 >= sys-dev/automake-4 >= sys-dev/flex-2.5.35" SRCFILE="Linux-PAM-${PVER}.tar.bz2" SRCDIR="${BUILDDIR}/Linux-PAM-${PVER}" PAMCONFIG_PVER="1.5" PAMCONFIG_SRCFILE="pam-config-${PAMCONFIG_PVER}.tar.bz2" PAMCONFIG_SRCDIR="${BUILDDIR}/pam-config-${PAMCONFIG_PVER}" sminclude mtools multilib SRC_URI=( https://fedorahosted.org/releases/l/i/linux-pam/${SRCFILE} http://www.kernel.org/pub/linux/libs/pam/library/${SRCFILE} http://www.kernel.org/pub/linux/libs/pam/pre/library/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-1.1.4-pam-console.patch mirror://${PNAME}/${PAMCONFIG_SRCFILE} ) # dev releases #UP2DATE="updatecmd http://www.kernel.org/pub/linux/libs/pam/pre/library | lasttarball" # stable releases #UP2DATE="updatecmd http://www.kernel.org/pub/linux/libs/pam/library | lasttarball" # fedora hosted pam version UP2DATE="updatecmd 'https://fedorahosted.org/releases/l/i/linux-pam/?C=M;O=A' | lasttarball" # the strip option is not allowed, pam needs libpam.a msetfeature "!strip" CFLAGS="${CFLAGS/-s/}" CXXFLAGS="${CFLAGS}" src_prepare() { munpack ${SRCFILE} || die SRCDIR=${PAMCONFIG_SRCDIR} munpack ${PAMCONFIG_SRCFILE} || die # add pam_console module (Np1 is required!) mpatch -Np1 ${PNAME}-1.1.4-pam-console.patch || die # make sure to install readmes from all modules local abi for abi in ${MULTILIB_ABIS} do cd ${SRCDIR}-${abi} install -d doc/txts || die for readme in modules/pam_*/README do cp -f "${readme}" doc/txts/README.$(dirname "${readme}" | \ sed -e 's|^modules/||') done # search in /usr/lib/cracklib sed -i 's|DICT_DIR_CANDIDATES="|&/lib /usr/lib/cracklib |' configure || die done } src_compile() { export CFLAGS="${CFLAGS} -fPIC" mconfigure \ --libdir=/usr/'$(mlibdir)' \ --sbindir=/usr/sbin \ --docdir=/usr/share/doc/${PNAME}-${PVER} \ --enable-securedir=/usr/'$(mlibdir)'/security \ --enable-isadir=/usr/'$(mlibdir)'/security \ --enable-read-both-confs \ || die # python stuff in docs gives sandbox problems all-abis "sed -i 's|modules doc examples|modules|' Makefile" || die mmake -j1 || die } src_install() { # needed directories minstalldir /etc/pam.d || die all-abis minstalldir /usr/'$(mlibdir)' || die minstalldir /usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die mmake DESTDIR=${BINDIR} LDCONFIG="" install || die # fix permissions mchmod 4755 /usr/sbin/unix_chkpwd || die # install missing man-pages minstallman doc/man/*.3 || die minstallman doc/man/*.8 || die # missing empty dirs mkeepdir /etc/security/console.perms.d || die mkeepdir /etc/security/namespace.d || die mkeepdir /etc/security/limits.d || die # install our pam setup SRCDIR=${PAMCONFIG_SRCDIR} mmake DESTDIR=${BINDIR} install || die minstalldocs CHANGELOG Copyright README || die minstallfile doc/specs/\*.raw /usr/share/doc/${PNAME}-${PVER}/spec || die minstallfile doc/specs/\*.txt /usr/share/doc/${PNAME}-${PVER}/spec || die minstallfile doc/txts/\* /usr/share/doc/${PNAME}-${PVER}/txt || die gzip -9r ${BINDIR}/usr/share/doc/${PNAME}-${PVER}/{spec,txt} || die # check for pam_cracklib existence or die [ -e ${BINDIR}/usr/$(mlibdir)/security/pam_cracklib.so ] || die "pam_cracklib not found, your sys-libs/cracklib installation may be corrupt!" }