# Generated by go2rpm 1.3 %bcond_without check # Upstream dependencies change often and specific versions are needed that aren't # always available in Fedora. %bcond vendor 1 %global services google-guest-agent.service google-startup-scripts.service google-shutdown-scripts.service # https://github.com/GoogleCloudPlatform/guest-agent %global goipath github.com/GoogleCloudPlatform/guest-agent Version: 20250414.00 %global tag %{version} %gometa -f %global golicenses LICENSE %global godocs CONTRIBUTING.md README.md Name: google-guest-agent Release: %{autorelease} Summary: Google Compute Engine guest environment License: Apache-2.0 URL: %{gourl} Source0: %{gosource} # Bundled dependencies made with mkvendor.sh Source1: guest-agent-%{version}-vendor.tar.gz # https://git.sr.ht/~gotmax23/fedora-scripts/tree/main/item/retired/go_vendor_licenses.py Source2: LICENSES.dependencies # Google Cloud only offers Arm and x86 instances. ExcludeArch: ppc64le s390x BuildRequires: systemd-rpm-macros Requires: systemd %description This package contains scripts, configuration, and init files for features specific to the Google Compute Engine cloud environment. %gopkg %prep %autosetup -p1 %{forgesetupargs} %{?with_vendor:-b1} %goprep -e %{?with_vendor:-k} cp %{SOURCE2} . # Skip wsfc_test.go: It's specific for Windows, and it assumes that network is available, # so it fails in a network-jailed build environment. rm google_guest_agent/wsfc_test.go %generate_buildrequires %if %{without vendor} %go_generate_buildrequires %endif %build for cmd in google_guest_agent google_metadata_script_runner; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done %install install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vd %{buildroot}%{_sysconfdir}/default install -m 0755 -vd %{buildroot}%{_unitdir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir} install -m 0644 -vp instance_configs.cfg %{buildroot}%{_sysconfdir}/default install -m 0644 -vp google-guest-agent.service %{buildroot}%{_unitdir} install -m 0644 -vp google-startup-scripts.service %{buildroot}%{_unitdir} install -m 0644 -vp google-shutdown-scripts.service %{buildroot}%{_unitdir} %if %{with check} %check # Skip tests that depend on networking or time out. %gocheck -d google_guest_agent/network/manager -d google_guest_agent/events %endif %files %license LICENSE %{?with_vendor:vendor/modules.txt LICENSES.dependencies} %doc CONTRIBUTING.md README.md %config(noreplace) %{_sysconfdir}/default/instance_configs.cfg %{_bindir}/google_guest_agent %{_bindir}/google_metadata_script_runner %{_unitdir}/google-guest-agent.service %{_unitdir}/google-startup-scripts.service %{_unitdir}/google-shutdown-scripts.service %post %systemd_post %{services} %preun %systemd_preun %{services} %postun %systemd_postun_with_restart %{services} %changelog %autochangelog