From 6f244e3e24faccb0f34c741b5da7cdc7a5dfc854 Mon Sep 17 00:00:00 2001
From: kallan <>
Date: Dec 16 2022 16:56:59 +0000
Subject: Update open-vm-tools to version 12.1.5 / rev 107 via SR 1043006


https://build.opensuse.org/request/show/1043006
by user kallan + dimstar_suse

---

diff --git a/packages/o/open-vm-tools/.files b/packages/o/open-vm-tools/.files
index 1bc15f9..d69d49d 100644
Binary files a/packages/o/open-vm-tools/.files and b/packages/o/open-vm-tools/.files differ
diff --git a/packages/o/open-vm-tools/.rev b/packages/o/open-vm-tools/.rev
index 241d22b..3e09427 100644
--- a/packages/o/open-vm-tools/.rev
+++ b/packages/o/open-vm-tools/.rev
@@ -888,4 +888,12 @@ this is ever going to be fixed</comment>
     <comment></comment>
     <requestid>999302</requestid>
   </revision>
+  <revision rev="107" vrev="1">
+    <srcmd5>57b63263be97082376bf958f3e392ad1</srcmd5>
+    <version>12.1.5</version>
+    <time>1671209455</time>
+    <user>dimstar_suse</user>
+    <comment></comment>
+    <requestid>1043006</requestid>
+  </revision>
 </revisionlist>
diff --git a/packages/o/open-vm-tools/.servicemark b/packages/o/open-vm-tools/.servicemark
new file mode 100644
index 0000000..c731a0d
--- /dev/null
+++ b/packages/o/open-vm-tools/.servicemark
@@ -0,0 +1 @@
+39242319f0e42655645f8f424aca15d4
diff --git a/packages/o/open-vm-tools/_service b/packages/o/open-vm-tools/_service
new file mode 100644
index 0000000..cc6f9e4
--- /dev/null
+++ b/packages/o/open-vm-tools/_service
@@ -0,0 +1,14 @@
+<services>
+  <service name="tar_scm" mode="disabled">
+    <param name="scm">git</param>
+    <param name="url">https://github.com/vmware/open-vm-tools.git</param>
+    <param name="revision">stable-12.1.5</param>
+    <param name="filename">open-vm-tools</param>
+    <param name="versionformat">12.1.5</param>
+  </service>
+  <service name="recompress" mode="disabled">
+    <param name="file">*.tar</param>
+    <param name="compression">xz</param>
+  </service>
+  <service name="set_version" mode="disabled"/>
+</services>
diff --git a/packages/o/open-vm-tools/detect-suse-location.patch b/packages/o/open-vm-tools/detect-suse-location.patch
new file mode 100644
index 0000000..c31b956
--- /dev/null
+++ b/packages/o/open-vm-tools/detect-suse-location.patch
@@ -0,0 +1,26 @@
+diff --git a/open-vm-tools/configure.ac b/open-vm-tools/configure.ac
+index 3c058135..203fdc6f 100644
+--- a/open-vm-tools/configure.ac
++++ b/open-vm-tools/configure.ac
+@@ -726,12 +726,18 @@ AC_DEFUN([AC_VMW_CONTAINERINFO_MSG],[
+ #
+ # proto files needed by containerd grpc client.
+ #
+-   shared_prefix=/usr/share/gocode/src/github.com
++   for d in /usr/share/gocode/src /usr/share/go/1.*/contrib/src; do
++      if test -d "$d"/github.com; then
++         src_prefix="$d"
++         break
++      fi
++   done
++   shared_prefix=$src_prefix/github.com
+    AC_SUBST(TYPES_DIR, github.com/containerd/containerd/api/types)
+    AC_SUBST(TASKS_PROTOPATH, $shared_prefix/containerd/containerd/api/services/tasks/v1)
+-   AC_SUBST(DEP_PROTOPATH, /usr/share/gocode/src)
++   AC_SUBST(DEP_PROTOPATH, $src_prefix)
+    AC_SUBST(CONTAINERD_PROTOPATH, $shared_prefix/containerd/containerd/api/services/containers/v1)
+-   AC_SUBST(GOGO_PROTOPATH, $shared_prefix/gogo/protobuf)
++   AC_SUBST(GOGO_PROTOPATH, $shared_prefix/containerd/containerd/vendor/github.com/gogo/protobuf)
+    AC_CHECK_FILE([${CONTAINERD_PROTOPATH}/containers.proto],
+                  [],
+                  [AC_VMW_CONTAINERINFO_MSG(["containerd package"])])
diff --git a/packages/o/open-vm-tools/open-vm-tools-12.1.0-20219665.tar.gz b/packages/o/open-vm-tools/open-vm-tools-12.1.0-20219665.tar.gz
deleted file mode 120000
index 3951400..0000000
--- a/packages/o/open-vm-tools/open-vm-tools-12.1.0-20219665.tar.gz
+++ /dev/null
@@ -1 +0,0 @@
-/ipfs/bafybeieooakc2lxqmxppglwme2thlvdspybl2pk42ptkdoz5occlt3xbfi
\ No newline at end of file
diff --git a/packages/o/open-vm-tools/open-vm-tools-12.1.5.tar.xz b/packages/o/open-vm-tools/open-vm-tools-12.1.5.tar.xz
new file mode 120000
index 0000000..6ebcf8d
--- /dev/null
+++ b/packages/o/open-vm-tools/open-vm-tools-12.1.5.tar.xz
@@ -0,0 +1 @@
+/ipfs/bafybeiasxh6vubc5zg23kagypzf6w3wkvo7punypjyf6ugl7kchqnb67mm
\ No newline at end of file
diff --git a/packages/o/open-vm-tools/open-vm-tools.changes b/packages/o/open-vm-tools/open-vm-tools.changes
index c8434c4..fda579e 100644
--- a/packages/o/open-vm-tools/open-vm-tools.changes
+++ b/packages/o/open-vm-tools/open-vm-tools.changes
@@ -1,4 +1,50 @@
 -------------------------------------------------------------------
+Wed Dec 14 21:24:00 UTC 2022 - Kirk Allan <kallan@suse.com>
+
+- Don't list libgrpc++, libgrpc, and libprotobuf in the containerinfo Requires
+  section.  The dependencies will be added automatically.
+
+-------------------------------------------------------------------
+Tue Dec 13 19:54:02 UTC 2022 - Kirk Allan <kallan@suse.com>
+
+- Don't use new LDFLAGS, -labsl_synchronization -lgpr, when building for SLE.
+
+-------------------------------------------------------------------
+Mon Dec 12 19:01:53 UTC 2022 - Caleb Crane <caleb.crane@suse.com>
+
+- Add containerInfo plugin (jsc-PED-1344)
+  - Add dependencies on grpc, protobuf, and containerd for container
+    introspection
+
+- Added patches (jsc-PED-1344)
+  + detect-suse-location.patch
+
+-------------------------------------------------------------------
+Thu Dec  8 20:24:29 UTC 2022 - Caleb Crane <caleb.crane@suse.com>
+
+- Add _service to handle open-vm-tools sources
+- Update to 12.1.5 (build 20735119) (boo#1205962)
+  - A number of Coverity reported issues have been addressed.
+
+  - The deployPkg plugin may prematurely reboot the guest VM before cloud-init 
+    has completed user data setup. If both the Perl based Linux customization 
+    script and cloud-init run when the guest VM boots, the deployPkg plugin 
+    may reboot the guest before cloud-init has finished. The deployPkg 
+    plugin has been updated to wait for a running cloud-init process to 
+    finish before the guest VM reboot is initiated. This issue is fixed in 
+    this release.
+
+  - A SIGSEGV may be encountered when a non-quiesing snapshot times out. 
+    This issue is fixed in this release.
+
+  - Unwanted vmtoolsd service error message if not on a VMware hypervisor.
+    When open-vm-tools comes preinstalled in a base Linux release, the vmtoolsd
+    services are started automatically at system start and desktop login. 
+    If running on physical hardware or in a non-VMware hypervisor, the services
+    will emit an error message to the Systemd's logging service before stopping.
+    This issue is fixed in this release.
+
+-------------------------------------------------------------------
 Thu Aug 25 15:57:57 UTC 2022 - Kirk Allan <kallan@suse.com>
 
 - Update to 12.1.0 (build 20219665) (boo#1202733)
diff --git a/packages/o/open-vm-tools/open-vm-tools.spec b/packages/o/open-vm-tools/open-vm-tools.spec
index a56fd8b..a92d3f8 100644
--- a/packages/o/open-vm-tools/open-vm-tools.spec
+++ b/packages/o/open-vm-tools/open-vm-tools.spec
@@ -38,16 +38,13 @@
 %define with_X 1
 
 Name:           open-vm-tools
-%define subname open-vm-tools
-%define tarname open-vm-tools
-%define bldnum  20219665
-Version:        12.1.0
+Version:        12.1.5
 Release:        0
 Summary:        Open Virtual Machine Tools
 License:        BSD-3-Clause AND GPL-2.0-only AND LGPL-2.1-only
 Group:          System/Emulators/PC
 URL:            https://github.com/vmware/open-vm-tools
-Source:         %{tarname}-%{version}-%{bldnum}.tar.gz
+Source:         %{name}-%{version}.tar.xz
 Source1:        vmtoolsd
 Source2:        vmtoolsd.service
 Source3:        vmware-user-autostart.desktop
@@ -74,8 +71,12 @@ BuildRequires:  pcre-devel
 BuildRequires:  procps-devel
 BuildRequires:  update-desktop-files
 %if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300
+BuildRequires:  containerd-devel
 BuildRequires:  glibc >= 2.27
+BuildRequires:  grpc-devel
+BuildRequires:  libcurl-devel
 BuildRequires:  libtirpc-devel
+BuildRequires:  protobuf-devel
 BuildRequires:  rpcgen
 BuildRequires:  pkgconfig(gdk-pixbuf-xlib-2.0) >= 2.21.0
 BuildRequires:  pkgconfig(sm)
@@ -86,9 +87,11 @@ BuildRequires:  pkgconfig(xinerama)
 BuildRequires:  pkgconfig(xrandr)
 BuildRequires:  pkgconfig(xrender)
 BuildRequires:  pkgconfig(xtst)
+%define         arg_containerinfo --enable-containerinfo=yes
 %else
 BuildRequires:  glibc >= 2.12
 BuildRequires:  xorg-x11-devel
+%define         arg_containerinfo --enable-containerinfo=no
 %endif
 BuildRequires:  pkgconfig(libdrm)
 BuildRequires:  pkgconfig(libudev)
@@ -151,6 +154,7 @@ ExclusiveArch:  %ix86 x86_64 aarch64
 
 #SUSE specific patches
 Patch0:         pam-vmtoolsd.patch
+Patch1:         detect-suse-location.patch
 
 %if 0%{?suse_version} >= 1500
 %systemd_ordering
@@ -233,8 +237,18 @@ Requires:       libvmtools0 = %{version}
 Those are the development headers for libvmtools. They are needed
 if you intend to create own plugins for vmtoolsd.
 
+%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300
+%package        containerinfo
+Summary:        Container Info Plugin
+Group:          System Environment/Libraries
+Requires:       %{name}%{?_isa} = %{version}-%{release}, curl
+
+%description    containerinfo
+This package interfaces with the container runtime to retrieve a list of containers running on a Linux guest
+%endif
+
 %prep
-%setup -q -n %{tarname}-%{version}-%{bldnum}
+%setup -q -n %{name}-%{version}/%{name}
 
 # fix for an rpmlint warning regarding wrong line feeds
 sed -i -e "s/\r//" README
@@ -242,6 +256,7 @@ sed -i -e "s/\r//" README
 
 #SUSE specific patches
 %patch0 -p2
+%patch1 -p2
 
 %build
 %if %{with_X}
@@ -256,11 +271,15 @@ sed -i -e "s/\r//" README
 # (this is because of 'g_static_mutex_init' usage which is now deprecated)
 export CFLAGS="%{optflags} -Wno-unused-local-typedefs -Wno-unused-but-set-variable -Wno-deprecated-declarations -Wno-sizeof-pointer-memaccess -Wno-cpp -fPIE"
 export CXXFLAGS="%{optflags} -Wno-unused-local-typedefs -Wno-unused-but-set-variable -Wno-deprecated-declarations -Wno-sizeof-pointer-memaccess -Wno-cpp -fPIE"
-%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300
+%if 0%{?suse_version} > 1500
+export LDFLAGS="-pie -ltirpc -labsl_synchronization -lgpr"
+%else
+%if 0%{?sle_version} >= 150300
 export LDFLAGS="-pie -ltirpc"
 %else
 export LDFLAGS="-pie"
 %endif
+%endif
 # Required for version 9.4.0
 export CUSTOM_PROCPS_NAME=procps
 autoreconf -fi
@@ -281,7 +300,8 @@ chmod 755 configure
     --enable-servicediscovery \
     %{arg_with_fuse} \
     --enable-salt-minion \
-    --disable-static
+    --disable-static \
+    %{?arg_containerinfo}
 make
 
 %install
@@ -412,6 +432,14 @@ systemctl try-restart vmtoolsd.service || :
 
 %postun -n libvmtools0 -p /sbin/ldconfig
 
+%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300
+%post containerinfo
+systemctl try-restart vmtoolsd.service || :
+
+%postun containerinfo
+systemctl try-restart vmtoolsd.service || :
+%endif
+
 %files
 %defattr(-, root, root)
 %if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 0120300
@@ -537,4 +565,9 @@ systemctl try-restart vmtoolsd.service || :
 %{_includedir}/libDeployPkg
 %{_libdir}/pkgconfig/libDeployPkg.pc
 
+%if 0%{?suse_version} > 1500 || 0%{?sle_version} >= 150300
+%files containerinfo
+%{_libdir}/%{name}/plugins/vmsvc/libcontainerInfo.so
+%endif
+
 %changelog