# Generated by go2rpm 1.8.0 %bcond_without check # Upstream dependencies change often and specific versions are needed that aren't # always available in Fedora. %bcond vendor 1 # https://github.com/GoogleCloudPlatform/osconfig %global goipath github.com/GoogleCloudPlatform/osconfig Version: 20250320.00 %global tag %{version} %gometa -f %global common_description %{expand: Google OS Config Agent} Name: google-osconfig-agent Release: %autorelease Summary: Google OS Config Agent License: Apache-2.0 URL: %{gourl} Source0: %{gosource} # Bundled dependencies made with mkvendor.sh Source1: osconfig-%{version}-vendor.tar.gz # https://git.sr.ht/~gotmax23/fedora-scripts/tree/main/item/retired/go_vendor_licenses.py Source2: LICENSES.dependencies BuildRequires: systemd BuildRequires: systemd-rpm-macros # Google Cloud only offers Arm and x86 instances. ExcludeArch: ppc64le s390x %description %{common_description} %gopkg %prep %autosetup -p1 %{forgesetupargs} %{?with_vendor:-b1} %goprep -e %{?with_vendor:-k} cp %{SOURCE2} . # Examples directory isn't needed. rm -rf examples # e2e_tests require connectivity to Google's APIs and extra packages. rm -rf e2e_tests %generate_buildrequires %if %{without vendor} %go_generate_buildrequires %endif %build %gobuild -o %{gobuilddir}/bin/google_osconfig_agent %{goipath} %install install -m0755 -vd %{buildroot}%{_bindir} install -m0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -m0644 -Dp %{name}.service %{buildroot}%{_unitdir}/%{name}.service %if %{with check} %check # Skip some tests that require network access when they run. %gocheck -d config -d policies %endif %files %license LICENSE %{?with_vendor:vendor/modules.txt LICENSES.dependencies} %doc CONTRIBUTING.md README.md %{_bindir}/google_osconfig_agent %{_unitdir}/%{name}.service %post %systemd_post %{name} %preun %systemd_preun %{name} %postun %systemd_postun_with_restart %{name} %changelog %autochangelog