-
Notifications
You must be signed in to change notification settings - Fork 15
refactor: switch to standard Go vendoring for cross-distro packaging #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ go-fdo-server | |
| go-fdo-server-*.tar.gz | ||
| rpmbuild | ||
| test/workdir | ||
| vendor/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,19 +14,16 @@ Version: 0 | |
| Release: %autorelease -p | ||
| 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 | ||
| Source2: go-vendor-tools.toml | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Although we are not going to use the |
||
| Source3: go-fdo-server-group.conf | ||
| Source4: go-fdo-server-manufacturer-user.conf | ||
| Source5: go-fdo-server-rendezvous-user.conf | ||
| Source6: go-fdo-server-owner-user.conf | ||
| 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-vendor-tools | ||
| BuildRequires: golang >= 1.25 | ||
| # Systemd units | ||
| BuildRequires: systemd-rpm-macros | ||
| # Sysusers | ||
|
|
@@ -43,24 +40,20 @@ devices when they are first powered on in their final location. | |
| %setup -q -T -D -a1 %{forgesetupargs} | ||
| #%%autopatch -p1 | ||
|
|
||
| %generate_buildrequires | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't we replace this with |
||
| %go_vendor_license_buildrequires -c %{S:2} | ||
|
|
||
| %build | ||
| %global gomodulesmode GO111MODULE=on | ||
| %gobuild -o %{gobuilddir}/bin/go-fdo-server %{goipath} | ||
|
|
||
| %install | ||
| %go_vendor_license_install -c %{S:2} | ||
| 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 %{SOURCE3} %{buildroot}/%{_sysusersdir}/go-fdo-server.conf | ||
| install -m 0644 -vp -D %{SOURCE4} %{buildroot}/%{_sysusersdir}/go-fdo-server-manufacturer.conf | ||
| install -m 0644 -vp -D %{SOURCE5} %{buildroot}/%{_sysusersdir}/go-fdo-server-rendezvous.conf | ||
| install -m 0644 -vp -D %{SOURCE6} %{buildroot}/%{_sysusersdir}/go-fdo-server-owner.conf | ||
| 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/ | ||
|
|
@@ -72,12 +65,12 @@ install -m 0755 -vd %{buildroot}%{_datadir}/%{name} | |
| install -m 0755 -vp -D scripts/* %{buildroot}%{_datadir}/%{name} | ||
|
|
||
| %check | ||
| %go_vendor_license_check -c %{S:2} | ||
| %if %{with check} | ||
| %gotest ./... | ||
| %endif | ||
| %files -f %{go_vendor_license_filelist} | ||
| %license vendor/modules.txt | ||
|
|
||
| %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} | ||
|
|
@@ -90,7 +83,7 @@ install -m 0755 -vp -D scripts/* %{buildroot}%{_datadir}/%{name} | |
| %{_datadir}/%{name}/generate-owner-certs.sh | ||
|
|
||
| %pre | ||
| %sysusers_create_compat %{SOURCE3} | ||
| %sysusers_create_compat %{SOURCE2} | ||
|
|
||
| %package manufacturer | ||
| Requires: go-fdo-server | ||
|
|
@@ -110,7 +103,7 @@ preparing devices for the on-boarding process during the manufacturing phase. | |
| # Sysuser | ||
| %{_sysusersdir}/go-fdo-server-manufacturer.conf | ||
| %pre manufacturer | ||
| %sysusers_create_compat %{SOURCE4} | ||
| %sysusers_create_compat %{SOURCE3} | ||
|
|
||
| %post manufacturer | ||
| %systemd_post go-fdo-server-manufacturer.service | ||
|
|
@@ -139,7 +132,7 @@ voucher. | |
| # Sysuser | ||
| %{_sysusersdir}/go-fdo-server-rendezvous.conf | ||
| %pre rendezvous | ||
| %sysusers_create_compat %{SOURCE5} | ||
| %sysusers_create_compat %{SOURCE4} | ||
|
|
||
| %post rendezvous | ||
| %systemd_post go-fdo-server-rendezvous.service | ||
|
|
@@ -168,7 +161,7 @@ necessary credentials and configuration for operation. | |
| # Sysuser | ||
| %{_sysusersdir}/go-fdo-server-owner.conf | ||
| %pre owner | ||
| %sysusers_create_compat %{SOURCE6} | ||
| %sysusers_create_compat %{SOURCE5} | ||
|
|
||
| %post owner | ||
| %systemd_post go-fdo-server-owner.service | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is the spec file depending on
go-vendor-tools, not its use in the Makefile. We can keep the current vendor tarball generation I believe