/[gentoo-x86]/app-crypt/tpm-emulator/tpm-emulator-0.5.1.ebuild
Gentoo

Contents of /app-crypt/tpm-emulator/tpm-emulator-0.5.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu May 31 03:31:59 2012 UTC (2 years, 6 months ago) by zmedico
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +3 -3 lines
inherit user for enewuser, and multilib for get_libdir

(Portage version: 2.2.0_alpha108_p8/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-crypt/tpm-emulator/tpm-emulator-0.5.1.ebuild,v 1.2 2009/10/14 01:01:50 halcy0n Exp $
4
5 EAPI=2
6 inherit toolchain-funcs linux-mod eutils multilib user
7
8 MY_P=${P/-/_}
9 DESCRIPTION="Emulator driver for tpm"
10 HOMEPAGE="https://developer.berlios.de/projects/tpm-emulator"
11
12 SRC_URI="mirror://berlios/tpm-emulator/${MY_P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="modules"
18 DEPEND="dev-libs/gmp"
19 RDEPEND=""
20 S="${WORKDIR}"/${P/-/_}
21
22 #fixups at:
23 #https://developer.berlios.de/feature/index.php?func=detailfeature&feature_id=3304&group_id=2491
24
25 pkg_setup() {
26 use modules && linux-mod_pkg_setup
27 MODULE_NAMES="tpmd_dev(crypt::${S}/tpmd_dev)"
28 BUILD_TARGETS="all"
29 BUILD_PARAMS="CC=$(tc-getCC)"
30 enewuser tss -1 -1 /var/lib/tpm tss
31 }
32
33 src_prepare() {
34 sed -i 's/LDFLAGS :=/override LDFLAGS +=/g' tpmd/Makefile
35 sed -i 's#/var/tpm#/var/run/tpm#g' tpmd/tpmd.c tddl/tddl.c tpmd_dev/tpmd_dev.c
36
37 # use kernel object directory found by linux-info getversion() (bug 241956)
38 sed -i 's#/lib/modules/\$(KERNEL_RELEASE)/build#'"${KV_OUT_DIR}#" tpmd_dev/Makefile
39
40 # reorder -lgmp so --as-needed works (bug 264073)
41 sed -i 's/LDFLAGS/LDLIBS/' tpmd/Makefile
42
43 # fix parallel make
44 epatch "${FILESDIR}"/${P}-parallel-make.patch
45 }
46
47 src_compile() {
48 emake user || die "Failed to build userspace"
49 if use modules; then
50 linux-mod_src_compile || die "Failed to build kernelspace"
51 fi
52 }
53
54 src_install() {
55 if [ -x /usr/bin/scanelf -a -f tpm_emulator.ko ]; then
56 [ -z "$(/usr/bin/scanelf -qs __guard tpm_emulator.ko)" ] || \
57 die 'cannot have gmp compiled with hardened flags'
58 [ -z "$(/usr/bin/scanelf -qs __stack_smash_handler tpm_emulator.ko)" ] || \
59 die 'cannot have gmp compiled with hardened flags'
60 fi
61
62 use modules && linux-mod_src_install
63 dodoc README
64
65 emake user_install DESTDIR="${D}" LIBDIR="/usr/$(get_libdir)" \
66 || die "Failed to install userspace"
67
68 newinitd "${FILESDIR}"/${PN}.initd-0.5.1 ${PN}
69 newconfd "${FILESDIR}"/${PN}.confd-0.5.1 ${PN}
70
71 insinto /etc/udev/rules.d
72 newins "${FILESDIR}"/${PN}.udev 60-${PN}.rules
73
74 keepdir /var/run/tpm
75 fowners tss /var/run/tpm
76
77 keepdir /var/log/tpm
78 fowners tss:tss /var/log/tpm
79 }

  ViewVC Help
Powered by ViewVC 1.1.20