# Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit libtool eutils DESCRIPTION="pam_mysql is a module for pam to authenticate users with mysql" HOMEPAGE="http://pam-mysql.sourceforge.net/" SRC_URI="mirror://sourceforge/pam-mysql/${P}.tar.gz" DEPEND=" >=sys-libs/pam-0.72 >=dev-db/mysql-3.23.38 ssl? ( !build? ( >=dev-libs/openssl-0.9.7i ) ) sasl? ( !build? ( >=dev-libs/cyrus-sasl-2.1.20 ) )" RDEPEND=" pam? ( !build? ( >=sys-libs/pam-0.72 ) ) ssl? ( !build? ( >=dev-libs/openssl-0.9.7i ) ) sasl? ( !build? ( >=dev-libs/cyrus-sasl-2.1.20 ) )" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86" IUSE="pam ssl sasl" src_unpack() { unpack ${A} cd ${S} elibtoolize einfo " Applying mysql_patch to comply gentoo sasl openssl" patch -p0 -f < ${FILESDIR}/pam_mysql-${PV}.patch > patch.log einfo " Applying mysql_patch to be able to link with pam librairies" patch -p0 -f < ${FILESDIR}/pam_mysql-${PV}_v2.patch >> patch.log } src_compile() { einfo "Run automake" automake || die "automake error !" einfo "Run libtoolize" libtoolize --force --copy || die "libtoolize error !" einfo "Generate aclocal" aclocal || die "aclocal error !" einfo "Generate and run configure" autoconf ./configure.in > ./configure || die "autoconf error !" CONFIGURE="./configure --enable-FEATURE=yes --with-pam=/usr --with-pam-mods-dir=/lib/security " if ! use pam;then die "ADD USE FLAG \"pam\" in make.conf !" fi if use ssl;then CONFIGURE="${CONFIGURE} --with-openssl" fi if use sasl;then CONFIGURE="${CONFIGURE} --with-cyrus-sasl2" fi ${CONFIGURE} emake } src_install() { make DESTDIR=${D} install || die dodoc CREDITS ChangeLog NEWS README if use ssl || use sasl;then MESSAGE="Module pam_mysql installed with" if use ssl;then MESSAGE="${MESSAGE} openssl" fi if use sasl;then MESSAGE="${MESSAGE} sasl2" fi echo echo MESSAGE="${MESSAGE} support !" ewarn "${MESSAGE}" ewarn "This package was patched to comply the Gentoo organization" ewarn "If your experienced with some troubles, try first to deactivate" ewarn "it by adding a new line in /etc/portage/package.use config" ewarn "file." ewarn " sample : sys-auth/pam_mysql -sasl -ssl" echo ewarn "The package site is : http://pam-mysql.sourceforge.net/" echo ewarn "System paused 6 seconds" ebeep epause 6 fi }