From patchwork Thu Apr 30 11:08:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 11519853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B997981 for ; Thu, 30 Apr 2020 11:08:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E92C20774 for ; Thu, 30 Apr 2020 11:08:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OhIL3w5j" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726511AbgD3LIy (ORCPT ); Thu, 30 Apr 2020 07:08:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:50440 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725280AbgD3LIy (ORCPT ); Thu, 30 Apr 2020 07:08:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588244933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KAObJN9z1K+j9lDUpqQHrmmHc+cXp4cnPTyO5W+ullk=; b=OhIL3w5jkqGs5gqXrgrdgDLhWzjIu0Htz+cNE7cnoJfkYUV0OSy/13UU6DdRZW1Ad5ZOTK oC+SI81P/O6Vzdq4N5XtDBTrcE14CdT9fAGSooqSGp+UiKRAPU2OXNOwKNyav8tSlwDDZG bmBskp+1ZxSjiMXqD9p5lsM4CKBfS1g= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-247-JX0TytxWNxCpn3eVw5pUNQ-1; Thu, 30 Apr 2020 07:08:51 -0400 X-MC-Unique: JX0TytxWNxCpn3eVw5pUNQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 602BD100CD40; Thu, 30 Apr 2020 11:08:50 +0000 (UTC) Received: from workstation.redhat.com (unknown [10.40.195.149]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1F9111001920; Thu, 30 Apr 2020 11:08:48 +0000 (UTC) From: Petr Lautrbach To: selinux@vger.kernel.org Cc: Petr Lautrbach , Laurent Bigonville Subject: [PATCH 2/2] restorecond: Use pkg-config to get locations for systemd units Date: Thu, 30 Apr 2020 13:08:35 +0200 Message-Id: <20200430110835.138643-2-plautrba@redhat.com> In-Reply-To: <20200430110835.138643-1-plautrba@redhat.com> References: <20200430110835.138643-1-plautrba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org The user systemd service file could be installed in an other location than the system ones. In debian for example, the system files are installed /lib/systemd/system and the user ones in /usr/lib/systemd/user. Suggested-by: Laurent Bigonville Signed-off-by: Petr Lautrbach Acked-by: Nicolas Iooss --- restorecond/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/restorecond/Makefile b/restorecond/Makefile index 4de9642b0f6a..8e9a5ef1cfa1 100644 --- a/restorecond/Makefile +++ b/restorecond/Makefile @@ -7,7 +7,8 @@ SBINDIR ?= $(PREFIX)/sbin MANDIR = $(PREFIX)/share/man AUTOSTARTDIR = /etc/xdg/autostart DBUSSERVICEDIR = $(PREFIX)/share/dbus-1/services -SYSTEMDDIR ?= $(PREFIX)/lib/systemd +SYSTEMDSYSTEMUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemdsystemunitdir systemd) +SYSTEMDUSERUNITDIR ?= $(shell $(PKG_CONFIG) --variable=systemduserunitdir systemd) autostart_DATA = sealertauto.desktop INITDIR ?= /etc/rc.d/init.d @@ -48,10 +49,10 @@ install: all install -m 644 restorecond.desktop $(DESTDIR)$(AUTOSTARTDIR)/restorecond.desktop -mkdir -p $(DESTDIR)$(DBUSSERVICEDIR) install -m 644 org.selinux.Restorecond.service $(DESTDIR)$(DBUSSERVICEDIR)/org.selinux.Restorecond.service - -mkdir -p $(DESTDIR)$(SYSTEMDDIR)/system - install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDDIR)/system/ - -mkdir -p $(DESTDIR)$(SYSTEMDDIR)/user - install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDDIR)/user/ + -mkdir -p $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) + install -m 644 restorecond.service $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR) + -mkdir -p $(DESTDIR)$(SYSTEMDUSERUNITDIR) + install -m 644 restorecond_user.service $(DESTDIR)$(SYSTEMDUSERUNITDIR) relabel: install /sbin/restorecon $(DESTDIR)$(SBINDIR)/restorecond