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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue Dec 11 15:44:01 2012 UTC (19 months, 2 weeks ago) by axs
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +3 -7 lines
use udev.eclass to handle rules installation (a cleaner method than the previous commit)

(Portage version: 2.1.11.33/cvs/Linux x86_64, signed Manifest commit with key 2B6559ED)

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-r1.ebuild,v 1.2 2012/12/11 14:03:27 axs Exp $
4
5 EAPI=2
6 inherit toolchain-funcs linux-mod eutils multilib udev 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 virtual/pkgconfig"
20 RDEPEND=""
21 S=${WORKDIR}/${P/-/_}
22
23 #fixups at:
24 #https://developer.berlios.de/feature/index.php?func=detailfeature&feature_id=3304&group_id=2491
25
26 pkg_setup() {
27 use modules && linux-mod_pkg_setup
28 MODULE_NAMES="tpmd_dev(crypt::${S}/tpmd_dev)"
29 BUILD_TARGETS="all"
30 BUILD_PARAMS="CC=$(tc-getCC)"
31 enewuser tss -1 -1 /var/lib/tpm tss
32 }
33
34 src_prepare() {
35 sed -i 's/LDFLAGS :=/override LDFLAGS +=/g' tpmd/Makefile
36 sed -i 's#/var/tpm#/var/run/tpm#g' tpmd/tpmd.c tddl/tddl.c tpmd_dev/tpmd_dev.c
37
38 # use kernel object directory found by linux-info getversion() (bug 241956)
39 sed -i 's#/lib/modules/\$(KERNEL_RELEASE)/build#'"${KV_OUT_DIR}#" tpmd_dev/Makefile
40
41 # reorder -lgmp so --as-needed works (bug 264073)
42 sed -i 's/LDFLAGS/LDLIBS/' tpmd/Makefile
43
44 # fix parallel make
45 epatch "${FILESDIR}"/${P}-parallel-make.patch
46 }
47
48 src_compile() {
49 emake user || die "Failed to build userspace"
50 if use modules; then
51 linux-mod_src_compile || die "Failed to build kernelspace"
52 fi
53 }
54
55 src_install() {
56 if [ -x /usr/bin/scanelf -a -f tpm_emulator.ko ]; then
57 [ -z "$(/usr/bin/scanelf -qs __guard tpm_emulator.ko)" ] || \
58 die 'cannot have gmp compiled with hardened flags'
59 [ -z "$(/usr/bin/scanelf -qs __stack_smash_handler tpm_emulator.ko)" ] || \
60 die 'cannot have gmp compiled with hardened flags'
61 fi
62
63 use modules && linux-mod_src_install
64 dodoc README
65
66 emake user_install DESTDIR="${D}" LIBDIR="/usr/$(get_libdir)" \
67 || die "Failed to install userspace"
68
69 newinitd "${FILESDIR}"/${PN}.initd-0.5.1 ${PN}
70 newconfd "${FILESDIR}"/${PN}.confd-0.5.1 ${PN}
71
72 udev_newrules "${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