go-fdo-server/go-fdo-server.spec
Paul Whalen 851eb56424 Initial commit on c10s
Resolves: RHEL-133122

Signed-off-by: Paul Whalen <pwhalen@fedoraproject.org>
2026-01-20 15:01:38 -05:00

181 lines
5.7 KiB
RPMSpec

# Generated by go2rpm 1.18.0
%bcond check 1
# https://github.com/fido-device-onboard/go-fdo-server
%global goipath github.com/fido-device-onboard/go-fdo-server
%global debug_package %{nil}
Version: 0.0.4
%gometa -L -f
Name: go-fdo-server
Release: %autorelease
Summary: A Go implementation of the FIDO Device Onboard Specification
# Generated by go-vendor-tools
License: Apache-2.0 AND BSD-3-Clause AND MIT
URL: %{gourl}
Source0: %{gosource}
# Generated by go-vendor-tools
Source1: %{archivename}-vendor.tar.bz2
# Per packaging guidelines, sysusers.d files must be included as sources
# and cannot be installed directly in the install section.
Source2: go-fdo-server-group.conf
Source3: go-fdo-server-manufacturer-user.conf
Source4: go-fdo-server-rendezvous-user.conf
Source5: go-fdo-server-owner-user.conf
BuildRequires: go-rpm-macros
# Systemd units
BuildRequires: systemd-rpm-macros
# Sysusers
%{?sysusers_requires_compat}
%description
This package provides a server-side implementation of the FIDO Device Onboard
(FDO) specification, written in Go. FDO is an open standard for the late
binding of device credentials, allowing for automated and secure on-boarding of
devices when they are first powered on in their final location.
%prep
%goprep -A
%setup -q -T -D -a1 %{forgesetupargs}
#%%autopatch -p1
%build
%global gomodulesmode GO111MODULE=on
export LDFLAGS="-X %{goipath}/internal/version.VERSION=%{version}"
%gobuild -o %{gobuilddir}/bin/go-fdo-server %{goipath}
%install
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp -s %{gobuilddir}/bin/* %{buildroot}%{_bindir}
# Configuration dir
install -m 0755 -vd %{buildroot}%{_sysconfdir}/%{name}
# Sysusers
install -m 0644 -vp -D %{SOURCE2} %{buildroot}/%{_sysusersdir}/go-fdo-server.conf
install -m 0644 -vp -D %{SOURCE3} %{buildroot}/%{_sysusersdir}/go-fdo-server-manufacturer.conf
install -m 0644 -vp -D %{SOURCE4} %{buildroot}/%{_sysusersdir}/go-fdo-server-rendezvous.conf
install -m 0644 -vp -D %{SOURCE5} %{buildroot}/%{_sysusersdir}/go-fdo-server-owner.conf
# Sysconfig files
install -m 0755 -vd %{buildroot}%{_sysconfdir}/sysconfig
install -m 0644 -vp -D configs/sysconfig/* %{buildroot}%{_sysconfdir}/sysconfig/
# Systemd units
install -m 0755 -vd %{buildroot}%{_unitdir}
install -m 0644 -vp -D init/systemd/* %{buildroot}%{_unitdir}
# Helpers
install -m 0755 -vd %{buildroot}%{_datadir}/%{name}
install -m 0755 -vp -D scripts/* %{buildroot}%{_datadir}/%{name}
%check
%if %{with check}
%gotest ./...
%endif
%files
%license LICENSE vendor/modules.txt
%doc DOCKERFILE_USAGE.md FSIM_USAGE.md README.md SECURITY.md
%{_bindir}/go-fdo-server
%config(noreplace) %attr(770, root, go-fdo-server) %{_sysconfdir}/%{name}
%{_sysusersdir}/%{name}.conf
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/fdo-utils.sh
%{_datadir}/%{name}/cert-utils.sh
%{_datadir}/%{name}/generate-manufacturer-certs.sh
%{_datadir}/%{name}/generate-device-ca-certs.sh
%{_datadir}/%{name}/generate-owner-certs.sh
%pre
%sysusers_create_compat %{SOURCE2}
%package manufacturer
Requires: go-fdo-server
Requires: group(go-fdo-server)
Requires: openssl
Summary: A Go implementation of the FDO manufacturer server
BuildArch: noarch
%description manufacturer
This package provides the manufacturer server component of the FDO stack.
The manufacturer server is responsible for creating ownership vouchers and
preparing devices for the on-boarding process during the manufacturing phase.
%files manufacturer
# Systemd unit
%{_unitdir}/go-fdo-server-manufacturer.service
%config(noreplace) %{_sysconfdir}/sysconfig/go-fdo-server-manufacturer
# Sysuser
%{_sysusersdir}/go-fdo-server-manufacturer.conf
%pre manufacturer
%sysusers_create_compat %{SOURCE3}
%post manufacturer
%systemd_post go-fdo-server-manufacturer.service
%preun manufacturer
%systemd_preun go-fdo-server-manufacturer.service
%postun manufacturer
%systemd_postun_with_restart go-fdo-server-manufacturer.service
%package rendezvous
Requires: go-fdo-server
Requires: group(go-fdo-server)
Summary: A Go implementation of the FDO rendezvous server
BuildArch: noarch
%description rendezvous
This package provides the rendezvous server component of the FDO stack.
The rendezvous server acts as a trusted intermediary, redirecting devices
to their designated owner's on-boarding service based on their ownership
voucher.
%files rendezvous
# Systemd unit
%{_unitdir}/go-fdo-server-rendezvous.service
%config(noreplace) %{_sysconfdir}/sysconfig/go-fdo-server-rendezvous
# Sysuser
%{_sysusersdir}/go-fdo-server-rendezvous.conf
%pre rendezvous
%sysusers_create_compat %{SOURCE4}
%post rendezvous
%systemd_post go-fdo-server-rendezvous.service
%preun rendezvous
%systemd_preun go-fdo-server-rendezvous.service
%postun rendezvous
%systemd_postun_with_restart go-fdo-server-rendezvous.service
%package owner
Requires: go-fdo-server
Requires: group(go-fdo-server)
Summary: A Go implementation of the FDO owner server
BuildArch: noarch
%description owner
This package provides the owner server component of the FDO stack. The owner
server is the final destination for a device during on-boarding. It verifies
the device's authenticity, establishes ownership, and provisions it with the
necessary credentials and configuration for operation.
%files owner
# Systemd unit
%{_unitdir}/go-fdo-server-owner.service
%config(noreplace) %{_sysconfdir}/sysconfig/go-fdo-server-owner
# Sysuser
%{_sysusersdir}/go-fdo-server-owner.conf
%pre owner
%sysusers_create_compat %{SOURCE5}
%post owner
%systemd_post go-fdo-server-owner.service
%preun owner
%systemd_preun go-fdo-server-owner.service
%postun owner
%systemd_postun_with_restart go-fdo-server-owner.service
%changelog
%autochangelog