diff options
author | Armin Kuster <akuster808@gmail.com> | 2016-10-13 02:03:56 -0700 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2016-11-01 09:03:15 -0700 |
commit | 9e5c7358ad13ec6a957c868ffa786cbf07b9baea (patch) | |
tree | 507c5ad97c0ebfbe26cc584f08c83914e7bca3d2 | |
parent | 49951084334e9a2c50a3bf8f56d2f051d6516e41 (diff) | |
download | meta-security-9e5c7358ad13ec6a957c868ffa786cbf07b9baea.tar.gz |
swtpm: add new package
V2:
remove CACHED_CONFIGUREVARS, not needed after all
fix typo in selinux option
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | recipes-tpm/swtpm/files/fix_lib_search_path.patch | 41 | ||||
-rw-r--r-- | recipes-tpm/swtpm/swtpm_1.0.bb | 35 |
2 files changed, 76 insertions, 0 deletions
diff --git a/recipes-tpm/swtpm/files/fix_lib_search_path.patch b/recipes-tpm/swtpm/files/fix_lib_search_path.patch new file mode 100644 index 0000000..015f418 --- /dev/null +++ b/recipes-tpm/swtpm/files/fix_lib_search_path.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | |||
2 | Upstream-Status: Inappropriate [OE config] | ||
3 | |||
4 | Signed-off-by: Armin Kuster <akuster808@gmail.com> | ||
5 | |||
6 | Index: configure.ac | ||
7 | =================================================================== | ||
8 | --- a/configure.ac | ||
9 | +++ b/configure.ac | ||
10 | @@ -349,21 +349,17 @@ CFLAGS="$CFLAGS -Wformat -Wformat-securi | ||
11 | dnl We have to make sure libtpms is using the same crypto library | ||
12 | dnl to avoid problems | ||
13 | AC_MSG_CHECKING([the crypto library libtpms is using]) | ||
14 | -dirs=$($CC $CFLAGS -Xlinker --verbose 2>/dev/null | \ | ||
15 | - sed -n '/SEARCH_DIR/p' | \ | ||
16 | - sed 's/SEARCH_DIR("=\?\(@<:@^"@:>@\+\)"); */\1\n/g') | ||
17 | -for dir in $dirs; do | ||
18 | - if test -r $dir/libtpms.so; then | ||
19 | - if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then | ||
20 | - libtpms_cryptolib="openssl" | ||
21 | - break | ||
22 | - fi | ||
23 | - if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then | ||
24 | - libtpms_cryptolib="freebl" | ||
25 | - break | ||
26 | - fi | ||
27 | +dir="$SEARCH_DIR" | ||
28 | +if test -r $dir/libtpms.so; then | ||
29 | + if test -n "`ldd $dir/libtpms.so | grep libcrypto.so`"; then | ||
30 | + libtpms_cryptolib="openssl" | ||
31 | + break | ||
32 | fi | ||
33 | -done | ||
34 | + if test -n "`ldd $dir/libtpms.so | grep libnss3.so`"; then | ||
35 | + libtpms_cryptolib="freebl" | ||
36 | + break | ||
37 | + fi | ||
38 | +fi | ||
39 | |||
40 | if test -z "$libtpms_cryptolib"; then | ||
41 | AC_MSG_ERROR([Could not determine libtpms crypto library.]) | ||
diff --git a/recipes-tpm/swtpm/swtpm_1.0.bb b/recipes-tpm/swtpm/swtpm_1.0.bb new file mode 100644 index 0000000..04777e1 --- /dev/null +++ b/recipes-tpm/swtpm/swtpm_1.0.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | SUMMARY = "SWTPM - Software TPM Emulator" | ||
2 | LICENSE = "BSD-3-Clause" | ||
3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=fe8092c832b71ef20dfe4c6d3decb3a8" | ||
4 | SECTION = "apps" | ||
5 | |||
6 | DEPENDS = "libtasn1 fuse expect socat glib-2.0 libtpm libtpm-native" | ||
7 | |||
8 | SRCREV = "2cd10cee2f74c84bda22081514b6b2cb566fa42d" | ||
9 | SRC_URI = "git://github.com/stefanberger/swtpm.git \ | ||
10 | file://fix_lib_search_path.patch" | ||
11 | |||
12 | S = "${WORKDIR}/git" | ||
13 | |||
14 | inherit autotools-brokensep pkgconfig | ||
15 | PARALLEL_MAKE = "" | ||
16 | |||
17 | TSS_USER="tss" | ||
18 | TSS_GROUP="tss" | ||
19 | |||
20 | PACKAGECONFIG ?= "openssl" | ||
21 | PACKAGECONFIG += "${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)}" | ||
22 | PACKAGECONFIG[openssl] = "--with-openssl, --without-openssl, openssl" | ||
23 | PACKAGECONFIG[gnutls] = "--with-gnutls, --without-gnutls, gnutls" | ||
24 | PACKAGECONFIG[selinux] = "--with-selinux, --without-selinux, libselinux" | ||
25 | |||
26 | EXTRA_OECONF += "--with-tss-user=${TSS_USER} --with-tss-group=${TSS_GROUP}" | ||
27 | |||
28 | export SEARCH_DIR = "${STAGING_LIBDIR_NATIVE}" | ||
29 | |||
30 | USERADD_PACKAGES = "${PN}" | ||
31 | GROUPADD_PARAM_${PN} = "--system ${TSS_USER}" | ||
32 | USERADD_PARAM_${PN} = "--system -g ${TSS_GROUP} --home-dir \ | ||
33 | --no-create-home --shell /bin/false ${BPN}" | ||
34 | |||
35 | RDEPENDS_${PN} = "libtpm expect socat bash" | ||