From 5a2e78f5a0f21f577c5c053c9ea2cb5f260633f4 Mon Sep 17 00:00:00 2001 From: Toyam Cox Date: Thu, 7 Jan 2016 22:40:13 -0500 Subject: [PATCH 1/2] New package: trousers-0.3.13 --- common/shlibs | 1 + srcpkgs/tpm-tools/template | 16 ++++++++++++++++ srcpkgs/trousers-devel | 1 + srcpkgs/trousers/INSTALL | 8 ++++++++ srcpkgs/trousers/template | 30 ++++++++++++++++++++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 srcpkgs/tpm-tools/template create mode 120000 srcpkgs/trousers-devel create mode 100644 srcpkgs/trousers/INSTALL create mode 100644 srcpkgs/trousers/template diff --git a/common/shlibs b/common/shlibs index 41fb8d53835..d6c61ef7c6b 100644 --- a/common/shlibs +++ b/common/shlibs @@ -2309,6 +2309,7 @@ libcryptmount.so.0 libpam-mount-2.15_1 libglob.so.0 libglob-1.0_1 libepub.so.0 ebook-tools-0.2.2_1 libosmgpsmap-1.0.so.1 libosmgpsmap-1.1.0_1 +libtspi.so.1 trousers-0.3.13_1 libflickcurl.so.0 flickcurl-1.26_1 libpsiconv.so.6 psiconv-0.9.9_1 libshout.so.3 libshout-2.4.1_1 diff --git a/srcpkgs/tpm-tools/template b/srcpkgs/tpm-tools/template new file mode 100644 index 00000000000..a6be2357388 --- /dev/null +++ b/srcpkgs/tpm-tools/template @@ -0,0 +1,16 @@ +# Template file for 'tpm-tools' +pkgname=tpm-tools +version=1.3.8 +revision=1 +build_style=gnu-configure +makedepends="libressl-devel trousers-devel" +short_desc="Manage and diagnose tools for a Trusted Platform Module (TPM)" +maintainer="Toyam Cox " +license="CPL" +homepage="http://trousers.sourceforge.net" +distfiles="${SOURCEFORGE_SITE}/trousers/${pkgname}/${pkgname}-${version}.tar.gz" +checksum=66eb4ff095542403db6b4bd4b574e8a5c08084fe4e9e5aa9a829ee84e20bea83 + +post_install() { + vlicense LICENSE +} diff --git a/srcpkgs/trousers-devel b/srcpkgs/trousers-devel new file mode 120000 index 00000000000..abac4f7e44d --- /dev/null +++ b/srcpkgs/trousers-devel @@ -0,0 +1 @@ +trousers \ No newline at end of file diff --git a/srcpkgs/trousers/INSTALL b/srcpkgs/trousers/INSTALL new file mode 100644 index 00000000000..6c9ad0943da --- /dev/null +++ b/srcpkgs/trousers/INSTALL @@ -0,0 +1,8 @@ +# INSTALL +case "$ACTION" in +post) + if [ "$UPDATE" != "yes" ]; then + chown tss:tss /etc/tcsd.conf + fi + ;; +esac diff --git a/srcpkgs/trousers/template b/srcpkgs/trousers/template new file mode 100644 index 00000000000..7c6014ae32f --- /dev/null +++ b/srcpkgs/trousers/template @@ -0,0 +1,30 @@ +# Template file for 'trousers' +pkgname=trousers +version=0.3.13 +revision=1 +build_style=gnu-configure +conf_files="/etc/tcsd.conf" +makedepends="libressl-devel" +system_accounts=tss +tss_homedir=/var/lib/tpm +short_desc="Trusted Computing Software Stack for the TPM" +maintainer="Toyam Cox " +license="BSD" +homepage="http://trousers.sourceforge.net/" +distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.tar.gz" +checksum=bb908e4a3c88a17b247a4fc8e0fff3419d8a13170fe7bdfbe0e2c5c082a276d3 + +post_install() { + vlicense LICENSE + vsv tcsd +} + +trousers-devel_package() { + short_desc+=" - development files" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/lib/*.a + vmove usr/lib/*.so + vmove usr/include + } +} From 427ae3416ba7d9538f04b85e3a2737ff4acf6f1c Mon Sep 17 00:00:00 2001 From: Toyam Cox Date: Thu, 7 Jan 2016 22:40:29 -0500 Subject: [PATCH 2/2] New package: tpm-tools-1.3.8 --- srcpkgs/tpm-tools/template | 2 +- srcpkgs/trousers/REMOVE | 5 ++ srcpkgs/trousers/files/tcsd/log/run | 2 + srcpkgs/trousers/files/tcsd/run | 4 ++ .../trousers/patches/musl-getpwent_r.patch | 47 +++++++++++++++++++ srcpkgs/trousers/patches/musl-local_lim.patch | 14 ++++++ 6 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/trousers/REMOVE create mode 100644 srcpkgs/trousers/files/tcsd/log/run create mode 100644 srcpkgs/trousers/files/tcsd/run create mode 100644 srcpkgs/trousers/patches/musl-getpwent_r.patch create mode 100644 srcpkgs/trousers/patches/musl-local_lim.patch diff --git a/srcpkgs/tpm-tools/template b/srcpkgs/tpm-tools/template index a6be2357388..e2e7906f4a9 100644 --- a/srcpkgs/tpm-tools/template +++ b/srcpkgs/tpm-tools/template @@ -13,4 +13,4 @@ checksum=66eb4ff095542403db6b4bd4b574e8a5c08084fe4e9e5aa9a829ee84e20bea83 post_install() { vlicense LICENSE -} +} diff --git a/srcpkgs/trousers/REMOVE b/srcpkgs/trousers/REMOVE new file mode 100644 index 00000000000..b5784be9df3 --- /dev/null +++ b/srcpkgs/trousers/REMOVE @@ -0,0 +1,5 @@ +case "$ACTION" in +purge) + [ -d var/lib/tpm ] && rm -rf var/lib/tpm + ;; +esac diff --git a/srcpkgs/trousers/files/tcsd/log/run b/srcpkgs/trousers/files/tcsd/log/run new file mode 100644 index 00000000000..f74f42b898e --- /dev/null +++ b/srcpkgs/trousers/files/tcsd/log/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec logger -p daemon.info -t tcsd diff --git a/srcpkgs/trousers/files/tcsd/run b/srcpkgs/trousers/files/tcsd/run new file mode 100644 index 00000000000..0405459562b --- /dev/null +++ b/srcpkgs/trousers/files/tcsd/run @@ -0,0 +1,4 @@ +#!/bin/sh +exec 2>&1 +[ -d /var/lib/tpm ] || install -m 0700 -o tss -g tss -d /var/lib/tpm +exec chpst -u tss:tss tcsd -f diff --git a/srcpkgs/trousers/patches/musl-getpwent_r.patch b/srcpkgs/trousers/patches/musl-getpwent_r.patch new file mode 100644 index 00000000000..894adbb111e --- /dev/null +++ b/srcpkgs/trousers/patches/musl-getpwent_r.patch @@ -0,0 +1,47 @@ +--- src/tspi/ps/tspps.c.orig 2015-11-18 12:45:47.585113542 +0100 ++++ src/tspi/ps/tspps.c 2015-11-18 12:46:37.605577956 +0100 +@@ -45,7 +45,7 @@ + + static int user_ps_fd = -1; + static MUTEX_DECLARE_INIT(user_ps_lock); +-#if (defined (__FreeBSD__) || defined (__OpenBSD__)) ++#if !defined(__GLIBC__) + static MUTEX_DECLARE_INIT(user_ps_path); + #endif + static struct flock fl; +@@ -60,7 +60,7 @@ + TSS_RESULT result; + char *file_name = NULL, *home_dir = NULL; + struct passwd *pwp; +-#if (defined (__linux) || defined (linux) || defined(__GLIBC__)) ++#if defined(__GLIBC__) + struct passwd pw; + #endif + struct stat stat_buf; +@@ -72,7 +72,7 @@ + *file = strdup(file_name); + return (*file) ? TSS_SUCCESS : TSPERR(TSS_E_OUTOFMEMORY); + } +-#if (defined (__FreeBSD__) || defined (__OpenBSD__)) ++#if !defined(__GLIBC__) + MUTEX_LOCK(user_ps_path); + #endif + +@@ -90,7 +90,7 @@ + #else + setpwent(); + while (1) { +-#if (defined (__linux) || defined (linux) || defined(__GLIBC__)) ++#if defined(__GLIBC__) + rc = getpwent_r(&pw, buf, PASSWD_BUFSIZE, &pwp); + if (rc) { + LogDebugFn("USER PS: Error getting path to home directory: getpwent_r: %s", +@@ -99,7 +99,7 @@ + return TSPERR(TSS_E_INTERNAL_ERROR); + } + +-#elif (defined (__FreeBSD__) || defined (__OpenBSD__)) ++#elif !defined(__GLIBC__) + if ((pwp = getpwent()) == NULL) { + LogDebugFn("USER PS: Error getting path to home directory: getpwent: %s", + strerror(rc)); diff --git a/srcpkgs/trousers/patches/musl-local_lim.patch b/srcpkgs/trousers/patches/musl-local_lim.patch new file mode 100644 index 00000000000..766dbffd263 --- /dev/null +++ b/srcpkgs/trousers/patches/musl-local_lim.patch @@ -0,0 +1,14 @@ +--- src/tspi/tsp_tcsi_param.c.orig 2015-11-18 10:44:20.263987906 +0100 ++++ src/tspi/tsp_tcsi_param.c 2015-11-18 10:45:20.524547393 +0100 +@@ -11,7 +11,11 @@ + #include + #include + #include ++#if defined(__GLIBC__) + #include ++#else ++#define HOST_NAME_MAX 64 ++#endif + #include "trousers/tss.h" + #include "trousers/trousers.h" + #include "trousers_types.h"