view sys-auth/otpw/otpw-1.5.ebuild @ 501:f0e3db391f04

new ebuild for vscodium
author Dirk Olmes <dirk.olmes@codedo.de>
date Thu, 19 Mar 2020 08:54:42 +0100
parents e320ad3655b7
children
line wrap: on
line source

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

inherit eutils pam

DESCRIPTION="Generator and PAM module for one-time password lists with a user-defined static password prefix."
HOMEPAGE="http://www.cl.cam.ac.uk/~mgk25/otpw.html"
SRC_URI="http://www.cl.cam.ac.uk/~mgk25/download/${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="pam"

RDEPEND="pam? ( sys-libs/pam )"

DEPEND="${RDEPEND}"

pkg_setup() {
	if [ ! -c /dev/urandom ]; then
		die "/dev/urandom is missing or faulty, fix this and try again!"
	fi
}

src_compile() {
	sed -i "s/CC\s*=.*/CC = $(tc-getCC)/" "${S}"/Makefile
	#sed -i "s/CFLAGS\s*=.*/CFLAGS = -fPIC ${CFLAGS} \$(DFLAGS)/" "${S}"/Makefile   # TODO: -fPIC should become obsolete in the next version
	emake otpw-gen || die "emake otpw-gen failed"
	emake demologin || die "emake demologin failed"
	if use pam; then
		emake pam_otpw.so || die "emake pam_otpw.so failed"
	fi
}

src_install() {
	mv "${S}"/demologin "${S}"/otpw-demologin
	dobin otpw-gen || "installing otpw-gen failed"
	dobin otpw-demologin || "installing otpw-demologin failed"
	if use pam; then
		dopammod pam_otpw.so || "installing pam_otpw.so failed"
	fi
	doman otpw-gen.1
	doman pam_otpw.8
}