diff --git a/trousers-0.3.14-noinline.patch b/trousers-0.3.14-noinline.patch new file mode 100644 index 0000000000000000000000000000000000000000..856fd5d85a70c97645ba4c908b4c2c97ad5d7ee7 --- /dev/null +++ b/trousers-0.3.14-noinline.patch @@ -0,0 +1,14 @@ +diff -ur trousers-0.3.15/src/include/tspps.h trousers-0.3.15-new/src/include/tspps.h +--- trousers-0.3.15/src/include/tspps.h 2020-05-27 23:01:45.000000000 -0700 ++++ trousers-0.3.15-new/src/include/tspps.h 2020-11-06 17:46:53.796319788 -0700 +@@ -18,8 +18,8 @@ + + TSS_RESULT get_file(int *); + int put_file(int); +-inline TSS_RESULT read_data(int, void *, UINT32); +-inline TSS_RESULT write_data(int, void *, UINT32); ++TSS_RESULT read_data(int, void *, UINT32); ++TSS_RESULT write_data(int, void *, UINT32); + UINT32 psfile_get_num_keys(int); + TSS_RESULT psfile_get_parent_uuid_by_uuid(int, TSS_UUID *, TSS_UUID *); + TSS_RESULT psfile_remove_key_by_uuid(int, TSS_UUID *); diff --git a/trousers-0.3.14-unlock-in-err-path.patch b/trousers-0.3.14-unlock-in-err-path.patch new file mode 100644 index 0000000000000000000000000000000000000000..d4f7540fda766b50ac90c0bfe93f5fe2a539569e --- /dev/null +++ b/trousers-0.3.14-unlock-in-err-path.patch @@ -0,0 +1,11 @@ +diff -ur a/src/tspi/obj_context.c b/src/tspi/obj_context.c +--- a/src/tspi/obj_context.c 2014-11-03 12:31:55.000000000 -0700 ++++ b/src/tspi/obj_context.c 2018-08-10 11:02:02.246962638 -0700 +@@ -276,6 +276,7 @@ + context->machineName = (BYTE *)calloc(1, len); + if (context->machineName == NULL) { + LogError("malloc of %u bytes failed.", len); ++ obj_list_put(&context_list); + return TSPERR(TSS_E_OUTOFMEMORY); + } + memcpy(context->machineName, name, len); diff --git a/trousers.spec b/trousers.spec index add16e618b5caf6988f0b265cd5e36973f0d7dc2..c37c022bc4f4ca5165d3e6490b24338f47c7f56d 100644 --- a/trousers.spec +++ b/trousers.spec @@ -1,4 +1,4 @@ -%define anolis_release 1 +%define anolis_release 2 Name: trousers Summary: TCG's Software Stack v1.2 Version: 0.3.15 @@ -9,6 +9,10 @@ Url: https://sourceforge.net/projects Source0: %{url}/trousers/files/trousers/%{version}/%{name}-%{version}.tar.gz Source1: tcsd.service +Patch1: trousers-0.3.14-noinline.patch +# submitted upstream +Patch2: trousers-0.3.14-unlock-in-err-path.patch + BuildRequires: make BuildRequires: libtool openssl-devel gettext-devel autoconf automake BuildRequires: systemd @@ -51,6 +55,14 @@ Requires: %{name}-lib%{?_isa} = %{version}-%{release} Header files and man pages for use in creating Trusted Computing enabled applications. +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + %prep %autosetup -p1 # fix man page paths @@ -69,6 +81,8 @@ find %{buildroot} -type f -name '*.la' -print -delete mkdir -p %{buildroot}%{_unitdir} install -Dpm0644 %{SOURCE1} %{buildroot}%{_unitdir}/ +%generate_compatibility_deps + %pre getent group tss >/dev/null || groupadd -f -g 59 -r tss if ! getent passwd tss >/dev/null ; then @@ -90,7 +104,6 @@ exit 0 %systemd_postun_with_restart tcsd.service %files -%doc README ChangeLog %{_sbindir}/tcsd %config(noreplace) %attr(0640, root, tss) %{_sysconfdir}/tcsd.conf %{_mandir}/man5/* @@ -99,13 +112,15 @@ exit 0 %attr(0700, tss, tss) %{_localstatedir}/lib/tpm/ %files lib +%dir %{abidir} %license LICENSE %{_libdir}/libtspi.so.1* +%{abidir}/libtspi.dump %files devel # The files to be used by developers, 'trousers-devel' %doc doc/LTC-TSS_LLD_08_r2.pdf doc/TSS_programming_SNAFUs.txt -%attr(0755, root, root) %{_libdir}/libtspi.so +%{_libdir}/libtspi.so %{_includedir}/tss/ %{_includedir}/trousers/ %{_mandir}/man3/Tspi_* @@ -114,6 +129,12 @@ exit 0 # The only static library shipped by trousers, the TDDL %{_libdir}/libtddl.a +%files doc +%doc README ChangeLog + %changelog +* Sun Mar 19 2023 Shawn Wang - 0.3.15-2 +- Optimize the spec file + * Thu Mar 10 2022 Mingyue Zhao - 0.3.15-1 - Init for Anolis OS 23