# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # References # eclass autotools :: http://devmanual.gentoo.org/eclass-reference/autotools.eclass/index.html # eclass git-2 :: http://devmanual.gentoo.org/eclass-reference/git-2.eclass/index.html EAPI="4" DESCRIPTION="Yubico PAM module" HOMEPAGE="https://github.com/Yubico/yubico-pam" LICENSE="BSD" SLOT="0" IUSE="doc ldap static-libs" DEPEND="sys-auth/ykclient sys-auth/libyubikey sys-auth/ykpers virtual/pam" RDEPEND="${DEPEND}" if [[ "${PV}" == "9999" ]] ; then inherit eutils git-2 autotools pam EGIT_REPO_URI="git://github.com/Yubico/yubico-pam.git" EGIT_COMMIT="${PV}" EGIT_HAS_SUBMODULES="true" SRC_URI="" KEYWORDS="" else inherit eutils autotools pam SRC_URI="http://yubico-pam.googlecode.com/files/${P}.tar.gz" KEYWORDS="amd64" fi WANT_AUTOMAKE="1.11.1" src_unpack() { if [[ "${PV}" == "9999*" ]] ; then # Fetch the git repository and move to tag ${EGIT_COMMIT} git-2_src_unpack else unpack ${P}.tar.gz fi } src_prepare() { epatch "${FILESDIR}/configure.ac.patch" eautoreconf --install || die eautoreconf failed } src_configure() { local myconf if ! use ldap ; then myconf="${mconf} --without-ldap" fi econf \ $(use_enable static-libs static) \ ${myconf} } src_compile() { emake || die make failed } src_test() { emake check || die tests failed } src_install() { emake DESTDIR="${D}" install # If USE=static-libs the .la file is required otherwise remove it use static-libs || find "${ED}" -name '*.la' -exec rm -f {} + # Default install action installs PAM .so to /usr, use pam eclass to # install to / and then remove /usr/lib from image newpammod .libs/pam_yubico.so pam_yubico.so rm -rf "${D}/usr/lib" dodoc AUTHORS NEWS README if use doc ; then docinto doc dodoc doc/* fi }