forked from warewulf/warewulf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
warewulf.spec.in
259 lines (211 loc) · 6.63 KB
/
warewulf.spec.in
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
%global debug_package %{nil}
%global api 1
%if 0%{?rhel} && 0%{?rhel} <= 7
%global api 0
%endif
%if 0%{?suse_version}
%global tftpdir /srv/tftpboot
%else
# Assume Fedora-based OS if not SUSE-based
%global tftpdir /var/lib/tftpboot
%endif
%global srvdir %{_sharedstatedir}
%global wwgroup warewulf
%if 0%{?fedora}
%define _build_id_links none
%endif
Name: warewulf
Summary: A provisioning system for large clusters of bare metal and/or virtual systems
Version: @VERSION@
Release: @RELEASE@%{?dist}
License: BSD-3-Clause
URL: https://github.com/warewulf/warewulf
Source: https://github.com/warewulf/warewulf/releases/download/v%{version}/warewulf-%{version}.tar.gz
ExclusiveOS: linux
Conflicts: warewulf < 4
Conflicts: warewulf-common
Conflicts: warewulf-cluster
Conflicts: warewulf-vnfs
Conflicts: warewulf-provision
Conflicts: warewulf-ipmi
%if 0%{?suse_version} || 0%{?sle_version}
BuildRequires: distribution-release
BuildRequires: systemd-rpm-macros
BuildRequires: go >= 1.16
BuildRequires: firewall-macros
BuildRequires: firewalld
BuildRequires: tftp
BuildRequires: yq
Requires: tftp
Requires: nfs-kernel-server
Requires: firewalld
Requires: ipxe-bootimgs
%else
# Assume Red Hat/Fedora build
BuildRequires: system-release
BuildRequires: systemd
BuildRequires: golang >= 1.16
BuildRequires: firewalld-filesystem
Requires: tftp-server
Requires: nfs-utils
%if 0%{?rhel} < 8
Requires: ipxe-bootimgs
%else
Requires: ipxe-bootimgs-x86
Requires: ipxe-bootimgs-aarch64
%endif
%endif
%if 0%{?rhel} >= 8 || 0%{?suse_version} || 0%{?fedora}
Requires: dhcp-server
%else
# rhel < 8
Requires: dhcp
%endif
BuildRequires: git
BuildRequires: make
%if %{api}
BuildRequires: libassuan-devel gpgme-devel
%endif
%description
Warewulf is a stateless and diskless container operating system provisioning
system for large clusters of bare metal and/or virtual systems.
%package dracut
Summary: dracut module for loading a Warewulf container image
BuildArch: noarch
Requires: dracut
%if 0%{?suse_version}
%else
Requires: dracut-network
%endif
%description dracut
Warewulf is a stateless and diskless container operating system provisioning
system for large clusters of bare metal and/or virtual systems.
This subpackage contains a dracut module that can be used to generate
an initramfs that can fetch and boot a Warewulf container image from a
Warewulf server.
%prep
%setup -q -n %{name}-%{version} -b0 %if %{?with_offline:-a2}
%build
export OFFLINE_BUILD=1
make defaults \
PREFIX=%{_prefix} \
BINDIR=%{_bindir} \
SYSCONFDIR=%{_sysconfdir} \
DATADIR=%{_datadir} \
LOCALSTATEDIR=%{_sharedstatedir} \
SHAREDSTATEDIR=%{_sharedstatedir} \
MANDIR=%{_mandir} \
INFODIR=%{_infodir} \
DOCDIR=%{_docdir} \
SRVDIR=%{srvdir} \
TFTPDIR=%{tftpdir} \
SYSTEMDDIR=%{_unitdir} \
BASHCOMPDIR=/etc/bash_completion.d/ \
FIREWALLDDIR=/usr/lib/firewalld/services \
WWCLIENTDIR=/warewulf \
IPXESOURCE=/usr/share/ipxe \
DRACUTMODDIR=/usr/lib/dracut/modules.d
make
%if %{api}
make api
%endif
%install
export OFFLINE_BUILD=1
export NO_BRP_STALE_LINK_ERROR=yes
make install \
DESTDIR=%{buildroot}
%if %{api}
make installapi \
DESTDIR=%{buildroot}
%endif
%if 0%{?suse_version} || 0%{?sle_version}
yq e '
.tftp.ipxe."00:00" = "undionly.kpxe" |
.tftp.ipxe."00:07" = "ipxe-x86_64.efi" |
.tftp.ipxe."00:09" = "ipxe-x86_64.efi" |
.tftp.ipxe."00:0B" = "snp-arm64.efi" ' \
-i %{buildroot}%{_sysconfdir}/warewulf/warewulf.conf
%endif
%pre
getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup}
# use ipxe images from the distribution
%post
%systemd_post warewulfd.service
%firewalld_reload
%preun
%systemd_preun warewulfd.service
%postun
%systemd_postun_with_restart warewulfd.service
%firewalld_reload
%files
%defattr(-, root, %{wwgroup})
%dir %{_sysconfdir}/warewulf
%config(noreplace) %{_sysconfdir}/warewulf/warewulf.conf
%config(noreplace) %{_sysconfdir}/warewulf/examples
%config(noreplace) %{_sysconfdir}/warewulf/ipxe
%config(noreplace) %{_sysconfdir}/warewulf/grub
%config(noreplace) %attr(0640,-,-) %{_sysconfdir}/warewulf/nodes.conf
%{_sysconfdir}/bash_completion.d/wwctl
%dir %{_sharedstatedir}/warewulf
%{_sharedstatedir}/warewulf/chroots
%dir %{_sharedstatedir}/warewulf/overlays
%dir %{_sharedstatedir}/warewulf/overlays/debug
%dir %{_sharedstatedir}/warewulf/overlays/generic
%dir %{_sharedstatedir}/warewulf/overlays/host
%dir %{_sharedstatedir}/warewulf/overlays/wwinit
%attr(-, root, root) %{_sharedstatedir}/warewulf/overlays/*/rootfs
%attr(-, root, root) %{_bindir}/wwctl
%attr(-, root, root) %{_prefix}/lib/firewalld/services/warewulf.xml
%attr(-, root, root) %{_unitdir}/warewulfd.service
%attr(-, root, root) %{_mandir}/man1/wwctl*
%attr(-, root, root) %{_mandir}/man5/*.5*
%attr(-, root, root) %{_datadir}/warewulf
%dir %{_docdir}/warewulf
%license %{_docdir}/warewulf/LICENSE.md
%if %{api}
%attr(-, root, root) %{_bindir}/wwapi*
%config(noreplace) %{_sysconfdir}/warewulf/wwapi*.conf
%endif
%files dracut
%defattr(-, root, root)
%dir %{_prefix}/lib/dracut/modules.d/90wwinit
%{_prefix}/lib/dracut/modules.d/90wwinit/*.sh
%changelog
* Thu Apr 18 2024 Jonathon Anderson <[email protected]>
- New warewulf-dracut subpackage
* Wed Apr 17 2024 Jonathon Anderson <[email protected]>
- Don't build the API on EL7
* Sat Mar 9 2024 Jonathon Anderson <[email protected]> - 4.5.0-1
- Update source to github.com/warewulf
- Fix ownership of overlay files
- Add packaging for new grub support
- Add dependencies on distribution ipxe packages
- Fix offline builds
- Accommodate new Makefile behavior
- Designate config files in /etc/warewulf/ as "noreplace"
- Updated path to shell completions
* Mon Oct 17 2022 Jeremy Siadal <[email protected]> - 4.4.0-1
- Add offline build support -- prepping for bcond
- Add more BuildRequires for new golang vendor modules
* Wed Jan 26 2022 Jeremy Siadal <[email protected]> - 4.2.0-1
- Add license install
- Updates for RH and SUSE RPM guidelines
* Sat Jan 15 2022 Gregory Kurtzer <[email protected]> - 4.2.0-1
- Integrated genconfig Make options
- Cleaned up SPEC to use default RPM macros
* Tue Jan 11 2022 Jeremy Siadal <[email protected]> - 4.2.0-1
- Merge overlay subdirectories
- Add configuration options to make
- Relocate tftpboot for OpenSUSE
- Remove libexecdir macro; changing in OpenSUSE 15.4
* Mon Nov 1 2021 Jeremy Siadal <[email protected]> - 4.2.0-1
- Add support for OpenSUSE
- Update file attribs
- Update license string
- Make shared store relocatable
* Fri Sep 24 2021 Michael L. Young <[email protected]> - 4.2.0-1
- Update spec file to use systemd macros
- Use macros to refer to system paths
- Update syntax
* Tue Jan 26 2021 14:46:24 JST Brian Clemens <[email protected]> - 4.0.0
- Initial release