# Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit subversion DESCRIPTION="USB Authentication Module" HOMEPAGE="http://usbng.delta-xi.net" ESVN_REPO_URI="svn://delta-xi.net/svn/pam_usbng" LICENSE="GPL-2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="" DEPEND=">=dev-libs/openssl-0.9.8i" RDEPEND="${DEPEND} >=sys-libs/pam-1.0.2 >=sys-fs/udev-133 >=sys-apps/parted-1.8.8" S="${WORKDIR}/${PN}" src_unpack() { subversion_src_unpack cd ${S} epatch "${FILESDIR}"/${PN}-udevadm.patch sed -i "/^SHARED =/ s,$, -fPIC," Makefile } src_compile() { emake || die "emake failed" } src_install() { emake DESTDIR="${D}" install || die "emake install failed" cd ${S}/doc && dodoc TODO rm "${D}"/usr/sbin/uaconf.pl exeinto /etc/init.d doexe "${FILESDIR}"/uauthd } pkg_postinst() { ewarn "uaconf.pl needs parted compiled with the us locale, don't use it." echo einfo "Modify pamauth-ng.conf to reflect your USB device" einfo "For instance:" einfo "[user] jack usbid=077314380188#2+ iv=U3D85N9qWXHn" einfo "means," einfo "device 077314380188 authentificates the user jack and contains" einfo "information on the second partition based on PIN verification." einfo "U3D85N9qWXHn is a random alphanumerical value for hash" echo einfo "Also, create a new dedicated partition (~1 cyl) on your authentification USB device" ewarn "Don't use the first partition, some OSes only understand the first one" ewarn "Also _all_ data on the selected device will be _lost_!" echo einfo "Start uawritedev." einfo "For instance, uadevwrite pamauth-ng.conf 077314380188" einfo "Data will be written on the USB device as described in pamauth-ng.conf file" einfo "and /etc/.pamauth.otp/jack_077314380188 will be created." einfo "Make sure that your main authentication USB device is plugged in." echo einfo "Copy the new config to /etc/pamauth-ng.conf" einfo "To protect su, add/substitute the auth line in /etc/pamd.d/su :" einfo "auth sufficient pam_usbng.so" echo ebeep 5 epause 10 }