-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathelemental-register.spec
More file actions
124 lines (99 loc) · 3.01 KB
/
Copy pathelemental-register.spec
File metadata and controls
124 lines (99 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#
# spec file for package elemental-register
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define commit _replaceme_
%define c_date _replaceme_
Name: elemental-register
Version: 0
Release: 0
Summary: The Elemental Operator registration client
License: Apache-2.0
Group: System/Management
URL: https://github.com/rancher/elemental-operator
Source: %{name}.tar.xz
# go-tpm-tools aren't _that_ portable :-(
ExclusiveArch: x86_64 aarch64
BuildRequires: gcc-c++
BuildRequires: glibc-devel
BuildRequires: openssl-devel
BuildRequires: make
BuildRequires: grep
%if 0%{?suse_version}
BuildRequires: golang(API) >= 1.22
BuildRequires: golang-packaging
%{go_provides}
%else
%global goipath google.golang.org/api
%global forgeurl https://github.com/rancher/elemental-operator
%global commit 25abcdc57b9409d4c5b2009cf0a2f9aa6ff647ad
%gometa
%if (0%{?centos_version} == 800) || (0%{?rhel_version} == 800)
BuildRequires: go1.22
%else
BuildRequires: compiler(go-compiler) >= 1.22
%endif
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
The elemental-register command is responsible of the node registration
against an elemental-operator instance running under Rancher.
%package -n elemental-support
Summary: Collect important logs for support
%description -n elemental-support
This collects essential configuration files and logs to improve issue
resolution.
%prep
%setup -q -n %{name}
%build
%if 0%{?suse_version}
%goprep .
%endif
mkdir -p bin
if [ "$(uname)" = "Linux" ]; then
OTHER_LINKFLAGS="-extldflags -static -s"
fi
if [ "%{commit}" = "_replaceme_" ]; then
echo "No commit hash provided"
exit 1
fi
if [ "%{c_date}" = "_replaceme_" ]; then
echo "No commit date provided"
exit 1
fi
export GIT_TAG=$(echo "%{version}" | cut -d "+" -f 1)
GIT_COMMIT=$(echo "%{commit}")
export GIT_COMMIT=${GIT_COMMIT:0:8}
export COMMITDATE="%{c_date}"
# build binaries
CGO_ENABLED=1 make register
make support
%install
%if 0%{?suse_version}
%goinstall
%endif
# /usr/sbin
%{__install} -d -m 755 %{buildroot}/%{_sbindir}
# binary
%{__install} -m 755 build/elemental-register %{buildroot}%{_sbindir}
%{__install} -m 755 build/elemental-support %{buildroot}%{_sbindir}
%files
%defattr(-,root,root,-)
%license LICENSE
%{_sbindir}/elemental-register
%files -n elemental-support
%defattr(-,root,root,-)
%license LICENSE
%{_sbindir}/elemental-support
%changelog