media-libs/sdl-ttf: remove; upstream EAPI is high enough now
[sgilles-overlay.git] / app-crypt / trousers / trousers-0.3.13-r2.ebuild
blob5c6436d48e2b510e476c01da3af8d3cc096ba39a
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
5 EAPI=5
7 inherit autotools eutils linux-info readme.gentoo systemd user udev
9 #MY_P="${PN}-${PV%.*}-${PV##*.}"
11 DESCRIPTION="An open-source TCG Software Stack (TSS) v1.1 implementation"
12 HOMEPAGE="http://trousers.sf.net"
13 SRC_URI="mirror://sourceforge/trousers/${P}.tar.gz"
15 LICENSE="CPL-1.0 GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~arm ~arm64 ~m68k ~ppc ~ppc64 ~s390 ~sh ~x86"
18 IUSE="doc libressl selinux" # gtk
20 # gtk support presently does NOT compile.
21 #       gtk? ( >=x11-libs/gtk+-2 )
23 CDEPEND=">=dev-libs/glib-2
24         !libressl? ( >=dev-libs/openssl-0.9.7:0 )
25         libressl? ( dev-libs/libressl )
27 DEPEND="${CDEPEND}
28         virtual/pkgconfig"
29 RDEPEND="${CDEPEND}
30         selinux? ( sec-policy/selinux-tcsd )"
31 # S="${WORKDIR}/${P}git"
33 DOCS="AUTHORS ChangeLog NICETOHAVES README TODO"
35 DOC_CONTENTS="
36         If you have problems starting tcsd, please check permissions and
37         ownership on /dev/tpm* and ~tss/system.data
40 pkg_setup() {
41         # Check for driver (not sure it can be an rdep, because ot depends on the
42         # version of virtual/linux-sources... Is that supported by portage?)
43         linux-info_pkg_setup
44         local tpm_kernel_version tpm_kernel_present tpm_module
45         kernel_is ge 2 6 12 && tpm_kernel_version="yes"
46         if linux_config_exists; then
47                 linux_chkconfig_present TCG_TPM && tpm_kernel_present="yes"
48         else
49                 ewarn "No kernel configuration could be found."
50         fi
51         has_version app-crypt/tpm-emulator && tpm_module="yes"
52         if [[ -n "${tpm_kernel_present}" ]]; then
53                 einfo "Good, you seem to have in-kernel TPM support."
54         elif [[ -n "${tpm_module}" ]]; then
55                 einfo "Good, you seem to have TPM support with the external module."
56                 if [[ -n "${tpm_kernel_version}" ]]; then
57                         elog
58                         elog "Note that since you have a >=2.6.12 kernel, you could use"
59                         elog "the in-kernel driver instead of (CONFIG_TCG_TPM)."
60                 fi
61         elif [[ -n "${tpm_kernel_version}" ]]; then
62                 eerror
63                 eerror "To use this package, you will have to activate TPM support"
64                 eerror "in your kernel configuration. That's at least CONFIG_TCG_TPM,"
65                 eerror "plus probably a chip specific driver (like CONFIG_TCG_ATMEL)."
66                 eerror
67         else
68                 eerror
69                 eerror "To use this package, you should install a TPM driver."
70                 eerror "You can have the following options:"
71                 eerror "  - install app-crypt/tpm-emulator"
72                 eerror "  - switch to a >=2.6.12 kernel and compile the kernel module"
73                 eerror
74         fi
76         # New user/group for the daemon
77         enewgroup tss
78         enewuser tss -1 -1 /var/lib/tpm tss
81 src_prepare() {
82         epatch "${FILESDIR}"/${P}-nouseradd.patch
83         epatch "${FILESDIR}"/${P}-build.patch
84         epatch "${FILESDIR}"/${P}-musl-fixes.patch
85         mv configure.in configure.ac || die
86         eautoreconf
89 src_configure() {
90         # econf --with-gui=$(usex gtk gtk openssl)
91         econf --with-gui=openssl
94 src_install() {
95         keepdir /var/lib/tpm
96         default
97         use doc && dodoc doc/*
98         newinitd "${FILESDIR}"/tcsd.initd tcsd
99         newconfd "${FILESDIR}"/tcsd.confd tcsd
100         systemd_dounit "${FILESDIR}"/tcsd.service
101         udev_dorules "${FILESDIR}"/61-trousers.rules
102         fowners tss:tss /var/lib/tpm
103         prune_libtool_files
104         readme.gentoo_create_doc