aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tolnay <dtolnay@chromium.org>2019-03-11 16:50:28 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-08 18:14:18 -0700
commit1dba349a7b272071d613869adaaef7bd576ae0c2 (patch)
treedf71531ad06215586f3a6fd53eced7eb2aa6d54b
parentea24233c2bb4f7e4a31aec478d45122fda79739d (diff)
downloadtpm2-1dba349a7b272071d613869adaaef7bd576ae0c2.tar.gz
pkg-config: Script to produce libtpm2.pc
Required in order for crosvm to find and use the correct libtpm2.a. Based on a similar script in src/platform2/libtpmcrypto and Kokoro's libtpm2.pc in src/platform/crosvm/kokoro/pkgconfig/libtpm2.pc. BUG=chromium:911799 TEST=./thirdparty_preinstall.sh 9999 /tmp/pkgconfig; cat /tmp/pkgconfig/libtpm2.pc TEST=(with CL:1515975) emerge-nami tpm2 TEST=(with CL:1515975) USE=crosvm-tpm emerge-nami crosvm Change-Id: I574799c94ae488bbc54548a0abdd3ec23204fdac Reviewed-on: https://chromium-review.googlesource.com/1516261 Commit-Ready: David Tolnay <dtolnay@chromium.org> Tested-by: David Tolnay <dtolnay@chromium.org> Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
-rw-r--r--libtpm2.pc.in7
-rwxr-xr-xthirdparty_preinstall.sh13
2 files changed, 20 insertions, 0 deletions
diff --git a/libtpm2.pc.in b/libtpm2.pc.in
new file mode 100644
index 0000000..03671dc
--- /dev/null
+++ b/libtpm2.pc.in
@@ -0,0 +1,7 @@
+bslot=@BSLOT@
+
+Name: tpm2
+Description: TPM simulator extracted from the TCG TPM 2.0 library specification
+Version: ${bslot}
+Requires.private: libcrypto
+Libs: -ltpm2
diff --git a/thirdparty_preinstall.sh b/thirdparty_preinstall.sh
new file mode 100755
index 0000000..2dee1ff
--- /dev/null
+++ b/thirdparty_preinstall.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# Copyright 2019 The Chromium OS Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+set -ex
+
+v=$1
+out=$2
+
+mkdir -p "${out}"
+sed -e "s/@BSLOT@/${v}/g" libtpm2.pc.in > "${out}/libtpm2.pc"