From 2d31b682d812f1d1d9d42acfd09f81cdf0d5fa40 Mon Sep 17 00:00:00 2001 From: Gang Wei Date: Wed, 22 Aug 2012 01:40:07 -0400 Subject: [PATCH] Fix build with latest zilb 1.2.7. Signed-off-by: Gang Wei --- tboot-1.7.0-zlib-fix.patch | 42 ++++++++++++++++++++++++++++++++++++++ tboot.spec | 5 +++++ 2 files changed, 47 insertions(+) create mode 100644 tboot-1.7.0-zlib-fix.patch diff --git a/tboot-1.7.0-zlib-fix.patch b/tboot-1.7.0-zlib-fix.patch new file mode 100644 index 0000000..bac03aa --- /dev/null +++ b/tboot-1.7.0-zlib-fix.patch @@ -0,0 +1,42 @@ +diff -r 7db3c64d7b75 lcptools/mlehash.c +--- a/lcptools/mlehash.c Wed Aug 22 11:49:46 2012 +0800 ++++ b/lcptools/mlehash.c Wed Aug 22 12:14:03 2012 +0800 +@@ -233,7 +233,7 @@ + */ + static bool read_file(const char *filename, void **buffer, size_t *length) + { +- FILE *fcompressed = NULL; ++ gzFile fcompressed = NULL; + FILE *fdecompressed = NULL; + struct stat filestat; + char tmpbuffer[1024]; +diff -r 7db3c64d7b75 tb_polgen/commands.c +--- a/tb_polgen/commands.c Wed Aug 22 11:49:46 2012 +0800 ++++ b/tb_polgen/commands.c Wed Aug 22 12:14:03 2012 +0800 +@@ -60,7 +60,7 @@ + int read_cnt; + + if ( unzip ) +- f = gzopen(filename, "rb"); ++ f = (FILE *)gzopen(filename, "rb"); + else + f = fopen(filename, "rb"); + +@@ -73,7 +73,7 @@ + EVP_DigestInit(&ctx, md); + do { + if ( unzip ) +- read_cnt = gzread(f, buf, sizeof(buf)); ++ read_cnt = gzread((gzFile)f, buf, sizeof(buf)); + else + read_cnt = fread(buf, 1, sizeof(buf), f); + if ( read_cnt == 0 ) +@@ -84,7 +84,7 @@ + EVP_DigestFinal(&ctx, hash->sha1, NULL); + + if ( unzip ) +- gzclose(f); ++ gzclose((gzFile)f); + else + fclose(f); + diff --git a/tboot.spec b/tboot.spec index 5b078eb..0639d89 100644 --- a/tboot.spec +++ b/tboot.spec @@ -9,6 +9,7 @@ Group: System Environment/Base License: BSD URL: http://sourceforge.net/projects/tboot/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz +Patch0: tboot-1.7.0-zlib-fix.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: trousers-devel openssl-devel @@ -22,6 +23,7 @@ and verified launch of an OS kernel/VMM. %prep %setup -q +%patch0 -p1 -b .zlib-fix %build CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS @@ -60,6 +62,9 @@ rm -rf $RPM_BUILD_ROOT %changelog +* Wed Aug 22 2012 Gang Wei - 1:1.7.0-2 +- Fix build error with zlib 1.2.7 + * Sat Jul 21 2012 Fedora Release Engineering - 1:1.7.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild