From patchwork Mon May 15 20:33:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Wilck X-Patchwork-Id: 9727857 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E2B1A60386 for ; Mon, 15 May 2017 20:34:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BEDE32897F for ; Mon, 15 May 2017 20:34:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1AC128987; Mon, 15 May 2017 20:34:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0D2262897F for ; Mon, 15 May 2017 20:34:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B88CFC04B94B; Mon, 15 May 2017 20:34:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B88CFC04B94B Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com B88CFC04B94B Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F6F95DD6D; Mon, 15 May 2017 20:34:30 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E8D1B1800C8C; Mon, 15 May 2017 20:34:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v4FKYKaA009726 for ; Mon, 15 May 2017 16:34:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7C0AFB56A2; Mon, 15 May 2017 20:34:19 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mx1.redhat.com (ext-mx02.extmail.prod.ext.phx2.redhat.com [10.5.110.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7EE21B56A6; Mon, 15 May 2017 20:34:17 +0000 (UTC) Received: from prv3-mh.provo.novell.com (prv3-mh.provo.novell.com [137.65.250.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A9EDA80C0D; Mon, 15 May 2017 20:33:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A9EDA80C0D Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=mwilck@suse.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com A9EDA80C0D Received: from apollon.suse.de.de (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by prv3-mh.provo.novell.com with ESMTP (TLS encrypted); Mon, 15 May 2017 14:33:49 -0600 From: Martin Wilck To: Christophe Varoqui , Hannes Reinecke , Benjamin Marzinski Date: Mon, 15 May 2017 22:33:25 +0200 Message-Id: <20170515203325.22170-1-mwilck@suse.com> X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 203 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 15 May 2017 20:34:00 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Mon, 15 May 2017 20:34:00 +0000 (UTC) for IP:'137.65.250.26' DOMAIN:'prv3-mh.provo.novell.com' HELO:'prv3-mh.provo.novell.com' FROM:'mwilck@suse.com' RCPT:'' X-RedHat-Spam-Score: -1.501 (BAYES_50, RCVD_IN_DNSWL_MED, SPF_PASS) 137.65.250.26 prv3-mh.provo.novell.com 137.65.250.26 prv3-mh.provo.novell.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.26 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: dm-devel@redhat.com Cc: dm-devel@redhat.com Subject: [dm-devel] [PATCH] multipath-tools: enable libdmmp installation in alternative directory X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 15 May 2017 20:34:44 +0000 (UTC) X-Virus-Scanned: ClamAV using ClamSMTP Introduce a new Makefile variable, usr_prefix, to be used for libdmmp and the associated pkgconfig file. Some distributions install those libraries which are necessary for booting (and mounting /usr) in a different location (/lib or /lib64) than other libraries (/usr/lib or /usr/lib64). On such distributions, installation to the different paths can be achieved by setting "usr_prefix=/usr". This will affect only libdmmp at this time, as all other libaries in the multipath-tools package may be relevant for booting. For distributions on which /lib and /lib64 are just symlinks to their /usr counterparts, nothing changes. Comments are welcome. Signed-off-by: Martin Wilck --- Makefile.inc | 4 +++- libdmmp/Makefile | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index ad55aa10..ad08f307 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -47,6 +47,7 @@ endif prefix = exec_prefix = $(prefix) +usr_prefix = $(prefix) bindir = $(exec_prefix)/sbin libudevdir = $(prefix)/$(SYSTEMDPATH)/udev udevrulesdir = $(libudevdir)/rules.d @@ -55,6 +56,7 @@ man8dir = $(prefix)/usr/share/man/man8 man5dir = $(prefix)/usr/share/man/man5 man3dir = $(prefix)/usr/share/man/man3 syslibdir = $(prefix)/$(LIB) +usrlibdir = $(usr_prefix)/$(LIB) libdir = $(prefix)/$(LIB)/multipath unitdir = $(prefix)/$(SYSTEMDPATH)/systemd/system mpathpersistdir = $(TOPDIR)/libmpathpersist @@ -62,7 +64,7 @@ mpathcmddir = $(TOPDIR)/libmpathcmd thirdpartydir = $(TOPDIR)/third-party libdmmpdir = $(TOPDIR)/libdmmp includedir = $(prefix)/usr/include -pkgconfdir = $(prefix)/$(LIB)/pkgconfig +pkgconfdir = $(usrlibdir)/pkgconfig GZIP = gzip -9 -c RM = rm -f diff --git a/libdmmp/Makefile b/libdmmp/Makefile index 1c5329aa..908e294b 100644 --- a/libdmmp/Makefile +++ b/libdmmp/Makefile @@ -27,15 +27,16 @@ $(LIBS): $(OBJS) $(LN) $@ $(DEVLIB) install: - $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS) + mkdir -p $(DESTDIR)$(usrlibdir) + $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(usrlibdir)/$(LIBS) $(INSTALL_PROGRAM) -m 644 -D \ $(HEADERS) $(DESTDIR)$(includedir)/$(HEADERS) - $(LN) $(LIBS) $(DESTDIR)$(syslibdir)/$(DEVLIB) + $(LN) $(LIBS) $(DESTDIR)$(usrlibdir)/$(DEVLIB) $(INSTALL_PROGRAM) -m 644 -D \ $(PKGFILE).in $(DESTDIR)$(pkgconfdir)/$(PKGFILE) perl -i -pe 's|__VERSION__|$(LIBDMMP_VERSION)|g' \ $(DESTDIR)$(pkgconfdir)/$(PKGFILE) - perl -i -pe 's|__LIBDIR__|$(syslibdir)|g' \ + perl -i -pe 's|__LIBDIR__|$(usrlibdir)|g' \ $(DESTDIR)$(pkgconfdir)/$(PKGFILE) perl -i -pe 's|__INCLUDEDIR__|$(includedir)|g' \ $(DESTDIR)$(pkgconfdir)/$(PKGFILE) @@ -46,9 +47,9 @@ install: done uninstall: - $(RM) $(DESTDIR)$(syslibdir)/$(LIBS) + $(RM) $(DESTDIR)$(usrlibdir)/$(LIBS) $(RM) $(DESTDIR)$(includedir)/$(HEADERS) - $(RM) $(DESTDIR)$(syslibdir)/$(DEVLIB) + $(RM) $(DESTDIR)$(usrlibdir)/$(DEVLIB) @for file in $(DESTDIR)$(man3dir)/dmmp_*; do \ $(RM) $$file; \ done