From cd17eaec8c1508f355958805b15df0fd2e668430 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 18 Apr 2017 10:26:48 +0200 Subject: [PATCH] try to get unitdir and tmpdir from pkg-config pkg-config is the most reliable and cross-distro way to get information about the systemd folders on a system. only rely on RPM macros when pkg-config is not installed or systemd.pc is not available. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index e499237..b766448 100644 --- a/Makefile +++ b/Makefile @@ -20,10 +20,10 @@ else RPM_VERSION = $(NAME)-$(VERSION)-1$(GIT_PSUFFIX) endif UNITDIR_FALLBACK = /usr/lib/systemd/system -UNITDIR_DETECT = $(shell rpm --eval '%{_unitdir}' 2>/dev/null || echo $(UNITDIR_FALLBACK)) +UNITDIR_DETECT = $(shell pkg-config systemd --variable systemdsystemunitdir || rpm --eval '%{_unitdir}' 2>/dev/null || echo $(UNITDIR_FALLBACK)) UNITDIR = $(UNITDIR_DETECT:%{_unitdir}=$(UNITDIR_FALLBACK)) TMPFILESDIR_FALLBACK = /usr/lib/tmpfiles.d -TMPFILESDIR_DETECT = $(shell rpm --eval '%{_tmpfilesdir}' 2>/dev/null || echo $(TMPFILESDIR_FALLBACK)) +TMPFILESDIR_DETECT = $(shell pkg-config systemd --variable tmpfilesdir || rpm --eval '%{_tmpfilesdir}' 2>/dev/null || echo $(TMPFILESDIR_FALLBACK)) TMPFILESDIR = $(TMPFILESDIR_DETECT:%{_tmpfilesdir}=$(TMPFILESDIR_FALLBACK)) VERSIONED_NAME = $(NAME)-$(VERSION)$(GIT_PSUFFIX)