mirror of https://github.com/containers/podman.git
Makefile: remove some duplication from install.systemd
Use a single loop for both the user and system service so we do not have to duplicate the full paths every time. In particular we can use `$^` to list all dependecies and then add the not generated files to the loop as well to simplify this. And to make things clear rename PODMAN_UNIT_FILES to PODMAN_GENERATED_UNIT_FILES so readers immediately know they are generated and are safe to delete in contrast to the .socket/.timer unit that are not and part of the git history. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
parent
21d0711a02
commit
1462b52090
28
Makefile
28
Makefile
|
|
@ -982,7 +982,7 @@ install.docker-full: install.docker install.docker-docs
|
||||||
|
|
||||||
.PHONY: install.systemd
|
.PHONY: install.systemd
|
||||||
ifneq (,$(findstring systemd,$(BUILDTAGS)))
|
ifneq (,$(findstring systemd,$(BUILDTAGS)))
|
||||||
PODMAN_UNIT_FILES = contrib/systemd/system/podman-auto-update.service \
|
PODMAN_GENERATED_UNIT_FILES = contrib/systemd/system/podman-auto-update.service \
|
||||||
contrib/systemd/system/podman.service \
|
contrib/systemd/system/podman.service \
|
||||||
contrib/systemd/system/podman-restart.service \
|
contrib/systemd/system/podman-restart.service \
|
||||||
contrib/systemd/system/podman-kube@.service \
|
contrib/systemd/system/podman-kube@.service \
|
||||||
|
|
@ -992,25 +992,15 @@ PODMAN_UNIT_FILES = contrib/systemd/system/podman-auto-update.service \
|
||||||
sed -e 's;@@PODMAN@@;$(BINDIR)/podman;g' $< >$@.tmp.$$ \
|
sed -e 's;@@PODMAN@@;$(BINDIR)/podman;g' $< >$@.tmp.$$ \
|
||||||
&& mv -f $@.tmp.$$ $@
|
&& mv -f $@.tmp.$$ $@
|
||||||
|
|
||||||
install.systemd: $(PODMAN_UNIT_FILES)
|
install.systemd: $(PODMAN_GENERATED_UNIT_FILES)
|
||||||
install ${SELINUXOPT} -m 755 -d $(DESTDIR)${SYSTEMDDIR} $(DESTDIR)${USERSYSTEMDDIR}
|
install ${SELINUXOPT} -m 755 -d $(DESTDIR)${SYSTEMDDIR} $(DESTDIR)${USERSYSTEMDDIR}
|
||||||
# User services
|
for unit in $^ \
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-auto-update.service $(DESTDIR)${USERSYSTEMDDIR}/podman-auto-update.service
|
contrib/systemd/system/podman-auto-update.timer \
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-auto-update.timer $(DESTDIR)${USERSYSTEMDDIR}/podman-auto-update.timer
|
contrib/systemd/system/podman.socket; do \
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.socket $(DESTDIR)${USERSYSTEMDDIR}/podman.socket
|
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${USERSYSTEMDDIR}/$$(basename $$unit); \
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.service $(DESTDIR)${USERSYSTEMDDIR}/podman.service
|
install ${SELINUXOPT} -m 644 $$unit $(DESTDIR)${SYSTEMDDIR}/$$(basename $$unit); \
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-restart.service $(DESTDIR)${USERSYSTEMDDIR}/podman-restart.service
|
done
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-kube@.service $(DESTDIR)${USERSYSTEMDDIR}/podman-kube@.service
|
rm -f $^
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-clean-transient.service $(DESTDIR)${USERSYSTEMDDIR}/podman-clean-transient.service
|
|
||||||
# System services
|
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-auto-update.service $(DESTDIR)${SYSTEMDDIR}/podman-auto-update.service
|
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-auto-update.timer $(DESTDIR)${SYSTEMDDIR}/podman-auto-update.timer
|
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.socket $(DESTDIR)${SYSTEMDDIR}/podman.socket
|
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman.service $(DESTDIR)${SYSTEMDDIR}/podman.service
|
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-restart.service $(DESTDIR)${SYSTEMDDIR}/podman-restart.service
|
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-kube@.service $(DESTDIR)${SYSTEMDDIR}/podman-kube@.service
|
|
||||||
install ${SELINUXOPT} -m 644 contrib/systemd/system/podman-clean-transient.service $(DESTDIR)${SYSTEMDDIR}/podman-clean-transient.service
|
|
||||||
rm -f $(PODMAN_UNIT_FILES)
|
|
||||||
else
|
else
|
||||||
install.systemd:
|
install.systemd:
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue