--- /dev/null
+--- tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c~ 2011-12-20 19:30:06.000000000 +0100
++++ tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c 2015-03-30 21:19:18.288861679 +0200
+@@ -25,6 +25,8 @@
+ #include <linux/net.h>
+ #include <linux/un.h>
+
++#include <linux/version.h>
++
+ #include "config.h"
+
+ #define TPM_DEVICE_MINOR 224
+@@ -108,8 +108,12 @@
+ memset(&msg, 0, sizeof(msg));
+ iov.iov_base = (void*)in;
+ iov.iov_len = in_size;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
++#else
++ iov_iter_init(&msg.msg_iter, WRITE, &iov, 1, 1);
++#endif
+ res = sock_sendmsg(tpmd_sock, &msg, in_size);
+ if (res < 0) {
+ error("sock_sendmsg() failed: %d\n", res);
+@@ -122,8 +126,12 @@
+ memset(&msg, 0, sizeof(msg));
+ iov.iov_base = (void*)tpm_response.data;
+ iov.iov_len = tpm_response.size;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
+ msg.msg_iov = &iov;
+ msg.msg_iovlen = 1;
++#else
++ iov_iter_init(&msg.msg_iter, READ, &iov, 1, 1);
++#endif
+ oldmm = get_fs();
+ set_fs(KERNEL_DS);
+ res = sock_recvmsg(tpmd_sock, &msg, tpm_response.size, 0);
%define _duplicate_files_terminate_build 0
%define pname tpm_emulator
-%define rel 12
+%define rel 13
Summary: Software-based TPM and MTM Emulator
Summary(pl.UTF-8): Programowy emulator TPM i MTM
Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
Source0: http://downloads.sourceforge.net/tpm-emulator.berlios/%{pname}-%{version}.tar.gz
# Source0-md5: e26becb8a6a2b6695f6b3e8097593db8
Patch0: %{pname}-libdir.patch
+Patch1: linux-3.19.patch
URL: http://tpm-emulator.berlios.de/
BuildRequires: cmake >= 2.4
BuildRequires: gmp-devel
%prep
%setup -q -n %{pname}-%{version}
%patch0 -p1
+%patch1 -p1
# separate kernel module from userspace build
echo > tpmd_dev/CMakeLists.txt