--- /dev/null
+--- tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c~ 2016-08-01 22:08:44.000000000 +0200
++++ tpm_emulator-0.7.4/tpmd_dev/linux/tpmd_dev.c 2016-08-01 22:20:50.942899171 +0200
+@@ -140,7 +140,11 @@
+ #endif
+ oldmm = get_fs();
+ set_fs(KERNEL_DS);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
+ res = sock_recvmsg(tpmd_sock, &msg, tpm_response.size, 0);
++#else
++ res = sock_recvmsg(tpmd_sock, &msg, 0);
++#endif
+ set_fs(oldmm);
+ if (res < 0) {
+ error("sock_recvmsg() failed: %d\n", res);
%define _duplicate_files_terminate_build 0
%define pname tpm_emulator
-%define rel 14
+%define rel 15
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}
Patch0: %{pname}-libdir.patch
Patch1: linux-3.19.patch
Patch2: linux-4.1.patch
+Patch3: linux-4.7.patch
URL: http://tpm-emulator.berlios.de/
BuildRequires: cmake >= 2.4
BuildRequires: gmp-devel
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
# separate kernel module from userspace build
echo > tpmd_dev/CMakeLists.txt