--- /dev/null
+--- tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c~ 2015-07-03 20:04:49.000000000 +0200
++++ tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c 2015-07-04 15:11:47.916586982 +0200
+@@ -116,7 +116,11 @@
+ #else
+ iov_iter_init(&msg.msg_iter, WRITE, &iov, 1, 1);
+ #endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
+ res = sock_sendmsg(tpmd_sock, &msg, in_size);
++#else
++ res = sock_sendmsg(tpmd_sock, &msg);
++#endif
+ if (res < 0) {
+ error("sock_sendmsg() failed: %d\n", res);
+ return res;
%define _duplicate_files_terminate_build 0
%define pname tpm_emulator
-%define rel 13
+%define rel 14
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-md5: e26becb8a6a2b6695f6b3e8097593db8
Patch0: %{pname}-libdir.patch
Patch1: linux-3.19.patch
+Patch2: linux-4.1.patch
URL: http://tpm-emulator.berlios.de/
BuildRequires: cmake >= 2.4
BuildRequires: gmp-devel
%setup -q -n %{pname}-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
# separate kernel module from userspace build
echo > tpmd_dev/CMakeLists.txt