## START: Set by rpmautospec ## (rpmautospec version 0.3.0) %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # The latest version of Citrix Hypervisor %global upstream_major 8 %global upstream_minor 2 %global upstream_micro 0 %global buildnum 2 %global upstream_name xe-guest-utilities %global service_name xe-linux-distribution Summary: XAPI Virtual Machine Monitoring Scripts Name: %{upstream_name}-latest Version: 7.33.0 Release: %autorelease License: BSD URL: https://github.com/xenserver/%{upstream_name} Source0: %{url}/archive/v%{version}.tar.gz#/%{upstream_name}-%{version}.tar.gz # Follow upstream to enable net.ipv4.conf.all.arp_notify Patch0: enable_net.ipv4.conf.all.arp_notify.patch # XAPI project only supports ix86 and x86_64 virtual machine ExclusiveArch: %{ix86} x86_64 BuildRequires: make BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} BuildRequires: golang(golang.org/x/sys/unix) BuildRequires: systemd # the only version that has been built in Fedora Obsoletes: %{upstream_name} = 7.12.0 %{?systemd_requires} %description Scripts for monitoring XAPI project virtual machine. Writes distribution version information and IP address to XenStore. This package follows the latest version of %{upstream_name} upstream. %prep %autosetup -p1 -n %{upstream_name}-%{version} mkdir -p src/github.com/xenserver ln -s $PWD src/github.com/xenserver/xe-guest-utilities sed -i -e 's:/usr/share/oem/xs:%{_sbindir}:' mk/%{service_name}.service # move xenstore utilities provided by this package to a private directory # to prevent conflict with xen-runtime sed -i -e 's:/usr/bin/xenstore-exists:%{_libexecdir}/%{upstream_name}/xenstore-exists:' mk/xen-vcpu-hotplug.rules # Mimic the latest Citrix Hypervisor sed -i -e "s/@PRODUCT_MAJOR_VERSION@/%{upstream_major}/g" \ -e "s/@PRODUCT_MINOR_VERSION@/%{upstream_minor}/g" \ -e "s/@PRODUCT_MICRO_VERSION@/%{upstream_micro}/g" \ -e "s/@NUMERIC_BUILD_NUMBER@/%{buildnum}/g" \ guestmetric/guestmetric_linux.go %build GOPATH=$PWD:%{gopath} %{gomodulesmode} make \ GO_FLAGS='-a -ldflags "${LDFLAGS:-}%{?currentgoldflags} -B 0x$$(head -c20 /dev/urandom|od -An -tx1|tr -d '"'"' \n'"'"') -extldflags '"'"'%__global_ldflags %{?__golang_extldflags}'"'"' -compressdwarf=false" -v -x' %install mkdir -p %{buildroot}%{_sbindir} mv -v build/stage/usr/sbin/* %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_libexecdir}/%{upstream_name} mv -v build/stage/usr/bin/* %{buildroot}%{_libexecdir}/%{upstream_name} mkdir -p %{buildroot}%{_unitdir} cp -p mk/%{service_name}.service %{buildroot}%{_unitdir} mkdir -p %{buildroot}%{_udevrulesdir} cp -p mk/xen-vcpu-hotplug.rules %{buildroot}%{_udevrulesdir}/z10-xen-vcpu-hotplug.rules mkdir -p %{buildroot}%{_localstatedir}/cache touch %{buildroot}%{_localstatedir}/cache/%{service_name} %check mk/xe-linux-distribution %post %systemd_post %{service_name}.service %preun %systemd_preun %{service_name}.service %postun %systemd_postun_with_restart %{service_name}.service %triggerun -- %{upstream_name} if /bin/ls /etc/rc3.d/S*%{service_name} >/dev/null 2>&1; then # Re-enable the service if it was enabled in sysv mode /usr/bin/systemctl enable %{service_name} >dev/null 2>&1||: /bin/rm /etc/rc3.d/S*%{service_name} >/dev/null 2>&1||: /usr/bin/systemctl try-restart %{service_name} >dev/null 2>&1||: fi %files %doc README.md %license LICENSE %{_sbindir}/%{service_name} %{_sbindir}/xe-daemon %{_unitdir}/%{service_name}.service %{_udevrulesdir}/z10-xen-vcpu-hotplug.rules %{_libexecdir}/%{upstream_name} %ghost %{_localstatedir}/cache/%{service_name} %changelog * Sat Jan 14 2023 Robin Lee 7.33.0-1 - Update to 7.33.0 (RHBZ#2154812) * Sat Dec 10 2022 Robin Lee 7.31.0-1 - Update to 7.31.0 (RHBZ#2141882) * Sat Jul 23 2022 Fedora Release Engineering 7.30.0-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Tue Jul 19 2022 Maxwell G 7.30.0-6 - Rebuild for CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang * Tue Jul 19 2022 Li Rui Bin 7.30.0-5 - Backport a patch to fix RHBZ#2106909 * Sat Jun 18 2022 Robert-André Mauchin 7.30.0-4 - Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327, CVE-2022-27191, CVE-2022-29526, CVE-2022-30629 * Sat Jan 22 2022 Fedora Release Engineering 7.30.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Thu Jan 06 2022 Robin Lee 7.30.0-2 - Properly override version info (RHBZ#2037556) * Sat Dec 25 2021 Robin Lee 7.30.0-1 - New upstream release 7.30.0 (RHBZ#1914199) * Fri Jul 23 2021 Fedora Release Engineering - 7.21.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 7.21.0-3 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583. * Sat Jan 30 2021 Robin Lee - 7.21.0-2 - Fix build with golang 1.16 * Wed Jan 27 2021 Fedora Release Engineering - 7.21.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Fri Dec 11 2020 Robin Lee - 7.21.0-1 - Update to 7.21.0, supports CentOS 8.3 - Apply to patch to support CentOS Stream 8 - Update Citrix Hypervisor to the latest one * Wed Jul 29 2020 Fedora Release Engineering - 7.17.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Fri Jan 31 2020 Fedora Release Engineering - 7.17.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Wed Dec 18 2019 Robin Lee - 7.17.0-2 - Fix debugsource generation on EL7/EL8 * Wed Dec 11 2019 Robin Lee - 7.17.0-1 - Release 7.17.0 - Update GO_FLAGS * Mon Dec 9 2019 Robin Lee - 7.16.0-1 - Rename to xe-guest-utilities-latest to not conflict with the xe-guest-utilities package provided in Citrix Hypervisor - Release 7.16.0 - Separate %%{buildnum} and %%{release} * Wed Aug 14 2019 Robin Lee - 7.12.0-2 - Re-enable the service if it was enabled in sysv mode - Follow upstream to enable net.ipv4.conf.all.arp_notify * Sat Jul 27 2019 Fedora Release Engineering - 7.12.0-1.1 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Thu Jun 6 2019 Robin Lee - 7.12.0-1 - Update to 7.12.0 - Remove upstreamed patches - Don't require removed subpackage - use %%{_localstatedir} instead of %%{_var} * Wed May 8 2019 Robin Lee - 7.11.0-1 - Massively modified for Fedora review based on mk/xe-guest-utilities.spec.in