Projects
home:lele
strata-agent
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 2
View file
strata-agent.spec
Added
@@ -0,0 +1,76 @@ +# +# spec file for package strata-agent +# +Name: strata-agent +Version: 0.5.3 +Release: 0 +Summary: Reports the OS packages of a host to Strata +License: LicenseRef-Proprietary +URL: https://strata.example.com +Source0: %{name}-%{version}.tar.gz +BuildRequires: golang(API) >= 1.27 +BuildRequires: systemd-rpm-macros +Requires: trivy +%{?systemd_ordering} + +%description +strata-agent lists the OS packages of this host with Trivy and uploads them to Strata as a +CycloneDX SBOM, daily, from strata-agent.timer, and its pending patches (zypper list-patches) +from strata-agent-updates.timer. Enroll the host once with `strata-agent enroll`; the package +does not enable the timers by itself. + +%prep +%autosetup + +%build +# Sources include vendor/; never download dependencies or a toolchain on OBS. +export GOTOOLCHAIN=local GOPROXY=off +go build \ + -mod=vendor \ + -buildmode=pie \ + -trimpath \ + -ldflags "-X strata/strata-agent/cmd.Version=%{version}" \ + -o strata-agent . + +%check +export GOTOOLCHAIN=local GOPROXY=off +# sbom and cmd read a fixture from back-end/, which is not in the tarball. +go test -mod=vendor \ + ./internal/client/... ./internal/config/... ./internal/hostinfo/... \ + ./internal/safe/... ./internal/state/... ./internal/trivy/... ./internal/updates/... \ + ./internal/privilege/... + +%install +install -D -m 0755 strata-agent %{buildroot}%{_bindir}/strata-agent +install -D -m 0644 dist/strata-agent.service %{buildroot}%{_unitdir}/strata-agent.service +install -D -m 0644 dist/strata-agent.timer %{buildroot}%{_unitdir}/strata-agent.timer +install -D -m 0644 dist/strata-agent-updates.service %{buildroot}%{_unitdir}/strata-agent-updates.service +install -D -m 0644 dist/strata-agent-updates.timer %{buildroot}%{_unitdir}/strata-agent-updates.timer +install -D -m 0644 dist/config %{buildroot}%{_sysconfdir}/strata-agent/config +install -d -m 0700 %{buildroot}%{_sharedstatedir}/strata-agent + +%pre +%service_add_pre strata-agent.service strata-agent.timer strata-agent-updates.service strata-agent-updates.timer + +%post +%service_add_post strata-agent.service strata-agent.timer strata-agent-updates.service strata-agent-updates.timer + +%preun +%service_del_preun strata-agent.service strata-agent.timer strata-agent-updates.service strata-agent-updates.timer + +%postun +%service_del_postun strata-agent.service strata-agent.timer strata-agent-updates.service strata-agent-updates.timer + +%files +%doc README.md +%{_bindir}/strata-agent +%{_unitdir}/strata-agent.service +%{_unitdir}/strata-agent.timer +%{_unitdir}/strata-agent-updates.service +%{_unitdir}/strata-agent-updates.timer +# The credential and host id written by enroll belong to the host, not the package. +%dir %attr(0700,root,root) %{_sysconfdir}/strata-agent +%config(noreplace) %{_sysconfdir}/strata-agent/config +%dir %attr(0700,root,root) %{_sharedstatedir}/strata-agent + +%changelog
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.