Bundle gtkmm3.0 stack on RHEL 10 to allow its removal

It will be dropped once upstream is ported to GTK 4 and open-vm-tools
is rebased in RHEL 10

Resolves: RHEL-55821
This commit is contained in:
Tomas Popela 2024-08-22 18:50:46 +02:00
parent b048e94cd3
commit 275b66c237
3 changed files with 220 additions and 1 deletions

6
.gitignore vendored
View File

@ -31,3 +31,9 @@
/open-vm-tools-12.3.0-22234872.tar.gz /open-vm-tools-12.3.0-22234872.tar.gz
/open-vm-tools-12.3.5-22544099.tar.gz /open-vm-tools-12.3.5-22544099.tar.gz
/open-vm-tools-12.4.0-23259341.tar.gz /open-vm-tools-12.4.0-23259341.tar.gz
/atkmm-2.28.4-2.el10.src.rpm
/cairomm-1.14.5-5.el10.src.rpm
/glibmm2.4-2.66.6-5.el10.src.rpm
/gtkmm3.0-3.24.8-6.el10.src.rpm
/libsigc++20-2.12.1-4.el9.src.rpm
/pangomm-2.46.4-2.el10.src.rpm

View File

@ -24,6 +24,9 @@
%global toolsversion %{majorversion}.%{minorversion} %global toolsversion %{majorversion}.%{minorversion}
%global toolsdaemon vmtoolsd %global toolsdaemon vmtoolsd
%global vgauthdaemon vgauthd %global vgauthdaemon vgauthd
# gtkmm3 is removed from RHEL 10, bundle it until the project is ported
# GTK 4, see RHEL-35537
%global bundle_gtkmm3 0%{?rhel} && 0%{?rhel} == 10
%if 0%{?rhel} == 7 %if 0%{?rhel} == 7
%global _modulesloaddir %{_prefix}/lib/modules-load.d %global _modulesloaddir %{_prefix}/lib/modules-load.d
@ -31,9 +34,19 @@
Name: open-vm-tools Name: open-vm-tools
Version: %{toolsversion} Version: %{toolsversion}
Release: 4%{?dist} Release: 5%{?dist}
Summary: Open Virtual Machine Tools for virtual machines hosted on VMware Summary: Open Virtual Machine Tools for virtual machines hosted on VMware
%if 0%{?bundle_gtkmm3}
# atkmm: LGPL-2.1-or-later
# cairomm: LGPL-2.0-or-later
# glibmm2.4: LGPL-2.1-or-later AND GPL-2.0-or-later
# gtkmm3.0: LGPL-2.1-or-later AND GPL-2.0-or-later
# libsigc++20: LGPL-2.1-or-later
# pangomm: LGPL-2.1-or-later AND GPL-2.0-only
License: GPL-2.0 AND W3C AND LGPL-2.1 AND ICU AND ISC AND MIT AND LGPL-2.1-or-later AND LGPL-2.0-or-later AND GPL-2.0-or-later
%else
License: GPL-2.0 AND W3C AND LGPL-2.1 AND ICU AND ISC AND MIT License: GPL-2.0 AND W3C AND LGPL-2.1 AND ICU AND ISC AND MIT
%endif
URL: https://github.com/vmware/%{name} URL: https://github.com/vmware/%{name}
Source0: https://github.com/vmware/%{name}/releases/download/stable-%{version}/%{name}-%{version}-%{toolsbuild}.tar.gz Source0: https://github.com/vmware/%{name}/releases/download/stable-%{version}/%{name}-%{version}-%{toolsbuild}.tar.gz
@ -43,6 +56,23 @@ Source3: run-vmblock\x2dfuse.mount
Source4: open-vm-tools.conf Source4: open-vm-tools.conf
Source5: vmtoolsd.pam Source5: vmtoolsd.pam
%if 0%{?bundle_gtkmm3}
%global bundled_install_path %{_libdir}/%{name}
%global __provides_exclude_from ^%{bundled_install_path}
%global __requires_exclude ^(libatkmm|libcairomm|libgdkmm|libgiomm|libglibmm|libgtkmm|libpangomm|libsigc).*$
# Generally use the content that was already part of RHEL 10 apart from libsigc++20
# as it was modified to not build documentation because of docbook5, see i.e. RHEL-45565
# In order of use:
Source101: libsigc++20-2.12.1-4.el9.src.rpm
Source102: https://kojihub.stream.centos.org/kojifiles/vol/koji02/packages/glibmm2.4/2.66.6/5.el10/src/glibmm2.4-2.66.6-5.el10.src.rpm
Source103: https://kojihub.stream.centos.org/kojifiles/vol/koji02/packages/atkmm/2.28.4/2.el10/src/atkmm-2.28.4-2.el10.src.rpm
Source104: https://kojihub.stream.rdu2.redhat.com/kojifiles/vol/koji02/packages/cairomm/1.14.5/5.el10/src/cairomm-1.14.5-5.el10.src.rpm
Source105: https://kojihub.stream.rdu2.redhat.com/kojifiles/vol/koji02/packages/pangomm/2.46.4/2.el10/src/pangomm-2.46.4-2.el10.src.rpm
Source106: https://kojihub.stream.rdu2.redhat.com/kojifiles/vol/koji02/packages/gtkmm3.0/3.24.8/6.el10/src/gtkmm3.0-3.24.8-6.el10.src.rpm
%endif
%if 0%{?rhel} >= 7 %if 0%{?rhel} >= 7
ExclusiveArch: x86_64 aarch64 ExclusiveArch: x86_64 aarch64
%else %else
@ -87,7 +117,20 @@ BuildRequires: xmlsec1-openssl-devel
%if 0%{?fedora} || 0%{?rhel} >= 8 %if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: gtk3-devel >= 3.10.0 BuildRequires: gtk3-devel >= 3.10.0
%if 0%{?bundle_gtkmm3}
BuildRequires: atk-devel
# For cairomm tests, could be dropped
BuildRequires: boost-devel
BuildRequires: libxslt
BuildRequires: m4
BuildRequires: meson
BuildRequires: mm-common
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Getopt::Long)
%else
BuildRequires: gtkmm30-devel >= 3.10.0 BuildRequires: gtkmm30-devel >= 3.10.0
%endif
BuildRequires: libtirpc-devel BuildRequires: libtirpc-devel
BuildRequires: rpcgen BuildRequires: rpcgen
BuildRequires: systemd-udev BuildRequires: systemd-udev
@ -183,6 +226,102 @@ machines.
%autosetup -p2 -n %{name}-%{version}-%{toolsbuild} %autosetup -p2 -n %{name}-%{version}-%{toolsbuild}
%build %build
%if 0%{?bundle_gtkmm3}
export PATH="%{_buildrootdir}/bin:$PATH"
# Cleanup buildroot for existing rpms
rm -rf %{_buildrootdir}/*
function install_rpms_to_current_dir() {
PACKAGE_RPM=$(eval echo $1)
PACKAGE_DIR=%{_rpmdir}
echo "install_rpms_to_current_dir() for $PACKAGE_DIR/$PACKAGE_RPM"
if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then
# Hack for tps tests
ARCH_STR=%{_arch}
%ifarch %{ix86}
ARCH_STR="i?86"
%endif
PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
fi
for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM)
do
echo "$package"
rpm2cpio "$package" | cpio -ivdu
done
}
export LDFLAGS="-L%{_buildrootdir}%{bundled_install_path}/%{_lib} $LDFLAGS"
export LDFLAGS="-Wl,-rpath,%{bundled_install_path}/%{_lib} $LDFLAGS"
export LDFLAGS="-Wl,-rpath-link,%{_buildrootdir}%{bundled_install_path}/%{_lib} $LDFLAGS"
export PKG_CONFIG_PATH=%{_buildrootdir}%{bundled_install_path}/%{_lib}/pkgconfig
export PATH="%{_buildrootdir}%{bundled_install_path}/bin:$PATH"
# libsigc++20
rpm -ivh %{SOURCE101}
rpmbuild --nodeps --define '_prefix %{bundled_install_path}' -ba %{_specdir}/libsigc++20.spec
pushd %{_buildrootdir}
install_rpms_to_current_dir libsigc++20*.rpm
popd
sed -i 's@prefix=%{bundled_install_path}@prefix=%{_buildrootdir}%{bundled_install_path}@g' \
%{_buildrootdir}%{bundled_install_path}/%{_lib}/pkgconfig/*.pc
# glibmm2.4
rpm -ivh %{SOURCE102}
rpmbuild --nodeps --define '_prefix %{bundled_install_path}' -ba %{_specdir}/glibmm2.4.spec
pushd %{_buildrootdir}
install_rpms_to_current_dir glibmm2.4*.rpm
popd
sed -i 's@prefix=%{bundled_install_path}@prefix=%{_buildrootdir}%{bundled_install_path}@g' \
%{_buildrootdir}%{bundled_install_path}/%{_lib}/pkgconfig/*.pc
# atkmm
rpm -ivh %{SOURCE103}
rpmbuild --nodeps --define '_prefix %{bundled_install_path}' -ba %{_specdir}/atkmm.spec
pushd %{_buildrootdir}
install_rpms_to_current_dir atkmm*.rpm
popd
sed -i 's@prefix=%{bundled_install_path}@prefix=%{_buildrootdir}%{bundled_install_path}@g' \
%{_buildrootdir}%{bundled_install_path}/%{_lib}/pkgconfig/*.pc
# cairomm
rpm -ivh %{SOURCE104}
rpmbuild --nodeps --define '_prefix %{bundled_install_path}' --without=doc_pdf -ba %{_specdir}/cairomm.spec
pushd %{_buildrootdir}
install_rpms_to_current_dir cairomm*.rpm
popd
sed -i 's@prefix=%{bundled_install_path}@prefix=%{_buildrootdir}%{bundled_install_path}@g' \
%{_buildrootdir}%{bundled_install_path}/%{_lib}/pkgconfig/*.pc
# pangomm
rpm -ivh %{SOURCE105}
rpmbuild --nodeps --define '_prefix %{bundled_install_path}' -ba %{_specdir}/pangomm.spec
pushd %{_buildrootdir}
install_rpms_to_current_dir pangomm*.rpm
popd
sed -i 's@prefix=%{bundled_install_path}@prefix=%{_buildrootdir}%{bundled_install_path}@g' \
%{_buildrootdir}%{bundled_install_path}/%{_lib}/pkgconfig/*.pc
# gtkmm3.0
rpm -ivh %{SOURCE106}
rpmbuild --nodeps --define '_prefix %{bundled_install_path}' -ba %{_specdir}/gtkmm3.0.spec
pushd %{_buildrootdir}
install_rpms_to_current_dir gtkmm*.rpm
popd
sed -i 's@prefix=%{bundled_install_path}@prefix=%{_buildrootdir}%{bundled_install_path}@g' \
%{_buildrootdir}%{bundled_install_path}/%{_lib}/pkgconfig/*.pc
# Remove the doc subpackages as we don't need them
find %{_rpmdir} -name "*doc*.rpm" -delete
%endif
autoreconf -vif autoreconf -vif
%configure \ %configure \
@ -197,6 +336,9 @@ autoreconf -vif
--with-tirpc \ --with-tirpc \
--without-gtk2 \ --without-gtk2 \
--without-gtkmm \ --without-gtkmm \
%if 0%{?bundle_gtk3mm}
--without-gtkmm3 \
%endif
%else %else
--without-tirpc \ --without-tirpc \
--without-gtk3 \ --without-gtk3 \
@ -209,6 +351,55 @@ sed -i -e 's! -shared ! -Wl,--as-needed\0!g' libtool
%install %install
export DONT_STRIP=1 export DONT_STRIP=1
%if 0%{?bundle_gtkmm3}
set -e
function install_rpms_to_current_dir() {
PACKAGE_RPM=$(eval echo $1)
PACKAGE_DIR=%{_rpmdir}
echo "install_rpms_to_current_dir() for $PACKAGE_DIR/$PACKAGE_RPM"
if [ ! -f $PACKAGE_DIR/$PACKAGE_RPM ]; then
# Hack for tps tests
ARCH_STR=%{_arch}
%ifarch %{ix86}
ARCH_STR="i?86"
%endif
PACKAGE_DIR="$PACKAGE_DIR/$ARCH_STR"
fi
for package in $(ls $PACKAGE_DIR/$PACKAGE_RPM)
do
echo "$package"
rpm2cpio "$package" | cpio -ivdu
done
}
pushd %{buildroot}
# Install only what we need in runtime
install_rpms_to_current_dir atkmm-2.28.4-*.rpm
install_rpms_to_current_dir cairomm-1.14.5-*.rpm
install_rpms_to_current_dir glibmm2.4-2.66*.rpm
install_rpms_to_current_dir gtkmm3.0-3.24.8*.rpm
install_rpms_to_current_dir libsigc++20-2.12.1*.rpm
install_rpms_to_current_dir pangomm-2.46.4*.rpm
popd
# clean the created bundled rpms if there are any
rm -rf %{_srcrpmdir}/libsigc++20*.src.rpm
find %{_rpmdir} -name "libsigc++20*.rpm" -delete
rm -rf %{_srcrpmdir}/glibmm2.4*.src.rpm
find %{_rpmdir} -name "glibmm2.4*.rpm" -delete
rm -rf %{_srcrpmdir}/atkmm*.src.rpm
find %{_rpmdir} -name "atkmm*.rpm" -delete
rm -rf %{_srcrpmdir}/cairomm*.src.rpm
find %{_rpmdir} -name "cairomm*.rpm" -delete
rm -rf %{_srcrpmdir}/pangomm*.src.rpm
find %{_rpmdir} -name "pangomm*.rpm" -delete
rm -rf %{_srcrpmdir}/gtkmm*.src.rpm
find %{_rpmdir} -name "gtkmm*.rpm" -delete
%endif
%make_install %make_install
# Remove exec bit from config files # Remove exec bit from config files
@ -392,6 +583,19 @@ fi
%{_libdir}/%{name}/plugins/vmusr/ %{_libdir}/%{name}/plugins/vmusr/
%{_unitdir}/run-vmblock\x2dfuse.mount %{_unitdir}/run-vmblock\x2dfuse.mount
%if 0%{?bundle_gtkmm3}
%{bundled_install_path}/share/doc/
%{bundled_install_path}/share/licenses/
%{bundled_install_path}/%{_lib}/libatkmm*
%{bundled_install_path}/%{_lib}/libcairomm*
%{bundled_install_path}/%{_lib}/libgdkmm*
%{bundled_install_path}/%{_lib}/libgiomm*
%{bundled_install_path}/%{_lib}/libglibmm*
%{bundled_install_path}/%{_lib}/libgtkmm*
%{bundled_install_path}/%{_lib}/libpangomm*
%{bundled_install_path}/%{_lib}/libsigc*
%endif
%files sdmp %files sdmp
%{_libdir}/%{name}/plugins/vmsvc/libserviceDiscovery.so %{_libdir}/%{name}/plugins/vmsvc/libserviceDiscovery.so
%{_libdir}/%{name}/serviceDiscovery %{_libdir}/%{name}/serviceDiscovery
@ -419,6 +623,9 @@ fi
%{_bindir}/vmware-vgauth-smoketest %{_bindir}/vmware-vgauth-smoketest
%changelog %changelog
* Thu Aug 22 2024 Tomas Popela <tpopela@redhat.com> - 12.4.0-5
- Bundle gtkmm3.0 stack on RHEL 10 to allow its removal
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 12.4.0-4 * Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 12.4.0-4
- Bump release for June 2024 mass rebuild - Bump release for June 2024 mass rebuild

View File

@ -1 +1,7 @@
SHA512 (open-vm-tools-12.4.0-23259341.tar.gz) = 11ea43c64ec534922145f83e2b7ef9254437f80656ad03b596340a78c3698adcc7d84adade9c5d8e1c83b5ebc3bd086601b1d104e0f070274dc2b6bc1f64fb17 SHA512 (open-vm-tools-12.4.0-23259341.tar.gz) = 11ea43c64ec534922145f83e2b7ef9254437f80656ad03b596340a78c3698adcc7d84adade9c5d8e1c83b5ebc3bd086601b1d104e0f070274dc2b6bc1f64fb17
SHA512 (atkmm-2.28.4-2.el10.src.rpm) = 55953c3221c228433e720b28517c1d23faba1091eb5d81be6522c096b7cf42828eaefe1c330aa2ca0b058188cf4ddd8549463d5817949a5a31efead72097d04e
SHA512 (cairomm-1.14.5-5.el10.src.rpm) = 2d036e83c63dd29a1933542de2274d74b4e63100d90dfd559eabdd00333ac4dd1ca25d810f5180c1c1afd71cd985376e7700beaff4f385132200c75633bfc980
SHA512 (glibmm2.4-2.66.6-5.el10.src.rpm) = 78cd5d54f1ef9faf2be75f22550b5ec60b55f6c4345df91db95889762f606a0649905077934527b98ba325212bb460a19deadef9eea15bb0c50915e560621d4c
SHA512 (gtkmm3.0-3.24.8-6.el10.src.rpm) = e0e4c3c57cf384928c39b22ae81276ff9f2f34e7aa6914f7d9a3ce65b5e170d7d2edaa61678b8f2ac2e5b16072d796af74ca51ad560b6fc539c7796f318fa6eb
SHA512 (libsigc++20-2.12.1-4.el9.src.rpm) = cdb1800b2413794e83623871b2ca2cade0b444e0a90f6948e1f3f449cd92e10beb3dd76471023f95e4f795693b3ded09bc83f551a54dab065fdee5dbf67e9a40
SHA512 (pangomm-2.46.4-2.el10.src.rpm) = ab9a723b4a90504101d544335333d9a2ec3c7558101c7005cc69aa05c115f4639d7e4110fb5a856f48e35ea062a5450adddca05f6866263fa8f20b8cecd12e6e