Skip to contentSkip to conversation

multipath-tools: enable libdmmp installation in alternative directory

PATCH In review Martin Wilck 3 participants 3 messages May 15, 2017 – Jun 21, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 multipath-tools: enable libdmmp installation in alternative directory

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.

---
 Makefile.inc     |  4 +++-
 libdmmp/Makefile | 11 ++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)
Makefile.inc +3 -1
index ad55aa10..ad08f307 100644
@@ -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
libdmmp/Makefile +6 -5
index 1c5329aa..908e294b 100644
@@ -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
Signature · 1 line
2.12.2
#1 lore raw

On Mon, May 15, 2017 at 10:33:25PM +0200, Martin Wilck wrote:

Fine by me.

-Ben

Quoted 89 lines

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.

---
 Makefile.inc     |  4 +++-
 libdmmp/Makefile | 11 ++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)
Makefile.inc +3 -1
index ad55aa10..ad08f307 100644
@@ -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
libdmmp/Makefile +6 -5
index 1c5329aa..908e294b 100644
@@ -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
Signature · 1 line
2.12.2
#2 lore raw

Merged,
Thanks.

Quoted 96 lines · Benjamin Marzinski

On Mon, May 15, 2017 at 10:33:25PM +0200, Martin Wilck wrote:

Fine by me.

-Ben

Quoted 89 lines

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.

---
 Makefile.inc     |  4 +++-
 libdmmp/Makefile | 11 ++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)
Makefile.inc +3 -1
index ad55aa10..ad08f307 100644
@@ -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
libdmmp/Makefile +6 -6
index 1c5329aa..908e294b 100644
@@ -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
--

2.12.2