diff --git a/CHANGELOG.md b/CHANGELOG.md index d0ba95bc..a320e9c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Bump github.com/opencontainers/runc to 1.1.12 - Dynamically calculate version and release from Git. #1162 - Update quickstarts to configure firewalld for dhcp. #1133 +- Omit building the API on EL7. #1171 ### Fixed diff --git a/Makefile b/Makefile index 3bec429f..3d8cf23a 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,10 @@ include Variables.mk include Tools.mk .PHONY: build -build: wwctl wwclient wwapid wwapic wwapird etc/defaults.conf etc/bash_completion.d/wwctl +build: wwctl wwclient etc/defaults.conf etc/bash_completion.d/wwctl + +.PHONY: api +api: wwapid wwapic wwapird .PHONY: docs docs: man_pages reference @@ -21,15 +24,18 @@ tidy: fmt: go fmt ./... -config = etc/wwapic.conf \ - etc/wwapid.conf \ - etc/wwapird.conf \ - include/systemd/warewulfd.service \ +config = include/systemd/warewulfd.service \ internal/pkg/config/buildconfig.go \ warewulf.spec .PHONY: config config: $(config) +apiconfig = etc/wwapic.conf \ + etc/wwapid.conf \ + etc/wwapird.conf +.PHONY: apiconfig +apiconfig: $(apiconfig) + %: %.in sed -ne "$(foreach V,$(VARLIST),s,@$V@,$(strip $($V)),g;)p" $@.in >$@ @@ -43,13 +49,13 @@ update_configuration: $(config) $(call godeps,cmd/update_configuration/update_co go build -X 'github.com/warewulf/warewulf/internal/pkg/node.ConfigFile=./etc/nodes.conf'" \ -mod vendor -tags "$(WW_GO_BUILD_TAGS)" -o update_configuration cmd/update_configuration/update_configuration.go -wwapid: $(config) $(call godeps,internal/app/api/wwapid/wwapid.go) +wwapid: $(config) $(apiconfig) $(call godeps,internal/app/api/wwapid/wwapid.go) go build -o ./wwapid internal/app/api/wwapid/wwapid.go -wwapic: $(config) $(call godeps,internal/app/api/wwapic/wwapic.go) +wwapic: $(config) $(apiconfig) $(call godeps,internal/app/api/wwapic/wwapic.go) go build -o ./wwapic internal/app/api/wwapic/wwapic.go -wwapird: $(config) $(call godeps,internal/app/api/wwapird/wwapird.go) +wwapird: $(config) $(apiconfig) $(call godeps,internal/app/api/wwapird/wwapird.go) go build -o ./wwapird internal/app/api/wwapird/wwapird.go .PHONY: man_pages @@ -109,9 +115,6 @@ install: build docs # wwctl genconfig to get the compiled in paths to warewulf.conf test -f $(DESTDIR)$(WWCONFIGDIR)/warewulf.conf || ./wwctl --warewulfconf etc/warewulf.conf genconfig warewulfconf print> $(DESTDIR)$(WWCONFIGDIR)/warewulf.conf test -f $(DESTDIR)$(WWCONFIGDIR)/nodes.conf || install -m 0644 etc/nodes.conf $(DESTDIR)$(WWCONFIGDIR) - test -f $(DESTDIR)$(WWCONFIGDIR)/wwapic.conf || install -m 0644 etc/wwapic.conf $(DESTDIR)$(WWCONFIGDIR) - test -f $(DESTDIR)$(WWCONFIGDIR)/wwapid.conf || install -m 0644 etc/wwapid.conf $(DESTDIR)$(WWCONFIGDIR) - test -f $(DESTDIR)$(WWCONFIGDIR)/wwapird.conf || install -m 0644 etc/wwapird.conf $(DESTDIR)$(WWCONFIGDIR) test -f $(DESTDIR)$(DATADIR)/warewulf/defaults.conf || install -m 0644 etc/defaults.conf $(DESTDIR)$(DATADIR)/warewulf/defaults.conf for f in etc/examples/*.ww; do install -m 0644 $$f $(DESTDIR)$(WWCONFIGDIR)/examples/; done for f in etc/ipxe/*.ipxe; do install -m 0644 $$f $(DESTDIR)$(WWCONFIGDIR)/ipxe/; done @@ -129,9 +132,6 @@ install: build docs chmod 0750 $(DESTDIR)$(WWOVERLAYDIR)/host/rootfs install -m 0755 wwctl $(DESTDIR)$(BINDIR) install -m 0755 wwclient $(DESTDIR)$(WWOVERLAYDIR)/wwinit/rootfs/$(WWCLIENTDIR)/wwclient - install -m 0755 wwapic $(DESTDIR)$(BINDIR) - install -m 0755 wwapid $(DESTDIR)$(BINDIR) - install -m 0755 wwapird $(DESTDIR)$(BINDIR) install -m 0644 include/firewalld/warewulf.xml $(DESTDIR)$(FIREWALLDDIR) install -m 0644 include/systemd/warewulfd.service $(DESTDIR)$(SYSTEMDDIR) install -m 0644 LICENSE.md $(DESTDIR)$(WWDOCDIR) @@ -139,6 +139,15 @@ install: build docs for f in docs/man/man1/*.1.gz; do install -m 0644 $$f $(DESTDIR)$(MANDIR)/man1/; done for f in docs/man/man5/*.5.gz; do install -m 0644 $$f $(DESTDIR)$(MANDIR)/man5/; done +.PHONY: installapi +installapi: + install -m 0755 wwapic $(DESTDIR)$(BINDIR) + install -m 0755 wwapid $(DESTDIR)$(BINDIR) + install -m 0755 wwapird $(DESTDIR)$(BINDIR) + test -f $(DESTDIR)$(WWCONFIGDIR)/wwapic.conf || install -m 0644 etc/wwapic.conf $(DESTDIR)$(WWCONFIGDIR) + test -f $(DESTDIR)$(WWCONFIGDIR)/wwapid.conf || install -m 0644 etc/wwapid.conf $(DESTDIR)$(WWCONFIGDIR) + test -f $(DESTDIR)$(WWCONFIGDIR)/wwapird.conf || install -m 0644 etc/wwapird.conf $(DESTDIR)$(WWCONFIGDIR) + .PHONY: init init: systemctl daemon-reload diff --git a/warewulf.spec.in b/warewulf.spec.in index e1c252b7..71e6bbf2 100644 --- a/warewulf.spec.in +++ b/warewulf.spec.in @@ -1,5 +1,10 @@ %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 @@ -69,7 +74,9 @@ Requires: dhcp BuildRequires: git BuildRequires: make +%if %{api} BuildRequires: libassuan-devel gpgme-devel +%endif %description Warewulf is a stateless and diskless container operating system provisioning @@ -100,6 +107,9 @@ make defaults \ WWCLIENTDIR=/warewulf \ IPXESOURCE=/usr/share/ipxe make +%if %{api} +make api +%endif %install @@ -107,6 +117,10 @@ 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 ' @@ -140,7 +154,6 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} %defattr(-, root, %{wwgroup}) %dir %{_sysconfdir}/warewulf %config(noreplace) %{_sysconfdir}/warewulf/warewulf.conf -%config(noreplace) %{_sysconfdir}/warewulf/wwapi*.conf %config(noreplace) %{_sysconfdir}/warewulf/examples %config(noreplace) %{_sysconfdir}/warewulf/ipxe %config(noreplace) %{_sysconfdir}/warewulf/grub @@ -157,7 +170,6 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} %attr(-, root, root) %{_sharedstatedir}/warewulf/overlays/*/rootfs %attr(-, root, root) %{_bindir}/wwctl -%attr(-, root, root) %{_bindir}/wwapi* %attr(-, root, root) %{_prefix}/lib/firewalld/services/warewulf.xml %attr(-, root, root) %{_unitdir}/warewulfd.service %attr(-, root, root) %{_mandir}/man1/wwctl* @@ -167,8 +179,16 @@ getent group %{wwgroup} >/dev/null || groupadd -r %{wwgroup} %dir %{_docdir}/warewulf %license %{_docdir}/warewulf/LICENSE.md +%if %{api} +%attr(-, root, root) %{_bindir}/wwapi* +%config(noreplace) %{_sysconfdir}/warewulf/wwapi*.conf +%endif + %changelog +* Wed Apr 17 2024 Jonathon Anderson +- Don't build the API on EL7 + * Sat Mar 9 2024 Jonathon Anderson - 4.5.0-1 - Update source to github.com/warewulf - Fix ownership of overlay files