blob: c4c2bc3e287cbcc09b0acde6c8a7e3923fc40476 [file] [log] [blame]
# Copyright 1999-2009 Gentoo Foundation
# Copyright 2010 Google, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header$
EAPI="4"
CROS_WORKON_COMMIT="416d30f74a9c1dc08b95b907d8b7e81edf6c9db0"
CROS_WORKON_TREE="2cd21e92b13e88448a3462987e159e8e96567f98"
CROS_WORKON_PROJECT="chromiumos/third_party/trousers"
inherit autotools base cros-debug cros-workon libchrome user
DESCRIPTION="An open-source TCG Software Stack (TSS) v1.1 implementation"
HOMEPAGE="http://trousers.sf.net"
LICENSE="CPL-1.0"
KEYWORDS="*"
SLOT="0"
IUSE="doc tss_trace"
RDEPEND=">=dev-libs/openssl-0.9.7"
DEPEND="${RDEPEND}
chromeos-base/metrics
dev-util/pkgconfig"
## TODO: Check if this patch is useful for us.
## PATCHES=( "${FILESDIR}/${PN}-0.2.3-nouseradd.patch" )
pkg_setup() {
# New user/group for the daemon
enewgroup tss
enewuser tss -1 -1 /var/lib/tpm tss
}
src_prepare() {
base_src_prepare
sed -e "s/-Werror //" -i configure.in
if use tss_trace ; then
# Enable tracing of TSS calls.
export CFLAGS="$CFLAGS -DTSS_TRACE"
fi
eautoreconf
}
src_configure() {
cros-workon_src_configure
}
src_install() {
default
dodoc NICETOHAVES
use doc && dodoc doc/*
# Install the empty system.data files
dodir /etc/trousers
insinto /etc/trousers
doins "${S}"/dist/system.data.*
# Install the init scripts
insinto /etc/init
doins init/*.conf
}
pkg_postinst() {
elog "If you have problems starting tcsd, please check permissions and"
elog "ownership on /dev/tpm* and ~tss/system.data"
}