Skip to contentSkip to conversation

Some more dmraid patches

PATCH In review [email protected] 3 participants 6 messages Feb 2, 2010 – Mar 16, 2010

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

cover Some more dmraid patches

Hi,
following are a few patches for dmraid that I made while packaging -rc16 for openSUSE.

The first two I sent previously as just one patch but it didn't get applied. So I broke it into two in the hope that at least the first (which is a clear bug) will be applied.

Thanks,
NeilBrown

#1 lore raw

PATCH 1/3 Remove incorrect quoting from pattern in lib/Makefile.in

The
[[ string =~ pattern ]]
command in bash only treats unquoted characters in 'pattern' as being pattern characters. If they are quoted, they much match literally.

So we need to remove the quota for this match to work correctly.

This removes the need to explicitly install in dmraid.spec.

---
 dmraid.spec     |    8 --------
 lib/Makefile.in |    2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)
dmraid.spec +0 -8
@@ -87,14 +87,6 @@ ln -s dmraid $RPM_BUILD_ROOT/sbin/dmraid
 
 install -m 644 include/dmraid/*.h $RPM_BUILD_ROOT%{_includedir}/dmraid/
 
-# If requested, install the libdmraid and libdmraid-events (for dmeventd) DSO
-install -m 755 lib/libdmraid.so \
-	$RPM_BUILD_ROOT%{_libdir}/libdmraid.so.%{version}
-(cd $RPM_BUILD_ROOT/%{_libdir} ; ln -sf libdmraid.so.%{version} libdmraid.so)
-install -m 755 lib/libdmraid-events-isw.so \
-	$RPM_BUILD_ROOT%{_libdir}/libdmraid-events-isw.so.%{version}
-(cd $RPM_BUILD_ROOT/%{_libdir} ; ln -sf libdmraid-events-isw.so.%{version} libdmraid-events-isw.so)
-
 # Install logwatch config file and script for dmeventd
 install -m 644 logwatch/dmeventd.conf $RPM_BUILD_ROOT/etc/logwatch/conf/services/dmeventd.conf
 install -m 755 logwatch/dmeventd $RPM_BUILD_ROOT/etc/logwatch/scripts/services/dmeventd
lib/Makefile.in +1 -1
@@ -82,7 +82,7 @@ install_dmraid_libs: $(INSTALL_TARGETS)
 	for f in $(INSTALL_TARGETS); \
 	do \
 		n=$$(basename $${f}) ; \
-		if [[ "$$n" =~ '.so$$' ]]; then \
+		if [[ "$$n" =~ .so$$ ]]; then \
 			$(INSTALL) -m 555 $(STRIP) \
 				$$f $(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
 			$(LN_S) -f $${n}.@DMRAID_LIB_VERSION@ $(libdir)/$${n}; \
#2 lore raw

Re: [dmraid 1/3] Remove incorrect quoting from pattern in lib/Makefile.in

Quoted 6 lines · On Tue, Feb 02, 2010 at 06:25:45PM +1100, [email protected] wrote:

The
[[ string =~ pattern ]]
command in bash only treats unquoted characters in 'pattern' as being pattern characters. If they are quoted, they much match literally.

why all this bashism?

lib/Makefile.in install_dmraid_libs: $(INSTALL_TARGETS) · line 85

Quoted 1 line
lib/Makefile.in +0 -1
-		if [[ "$$n" =~ '.so$$' ]]; then \

posix would make it

        if [ -z "$${n##*.so}" ] ; then \
Signature · 6 lines
Luca Berra -- [email protected]
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \
#3 lore raw

PATCH 2/3 Dont install libdmraid-event-* with verison number.

In reply to [email protected]

The libdmraid-event-* library is not a shared library in the regular sense. i.e. programs are not linked against it and so do not have the library version number encoded in them.
Rather, this is a shared-object that is explicitly loaded by dmeventd on request from dmraid. dmraid asks for "libdmraid-event-ism.so", so that is the only name that the shared object should be stored under. Providing a name with a trailing version number just makes it look like something that it is not.

---
 lib/Makefile.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Makefile.in +1 -1
@@ -82,7 +82,7 @@ install_dmraid_libs: $(INSTALL_TARGETS)
 	for f in $(INSTALL_TARGETS); \
 	do \
 		n=$$(basename $${f}) ; \
-		if [[ "$$n" =~ .so$$ ]]; then \
+		if [[ "$$n" =~ .so$$ && ! "$$n" =~ libdmraid-events-.* ]]; then \
 			$(INSTALL) -m 555 $(STRIP) \
 				$$f $(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
 			$(LN_S) -f $${n}.@DMRAID_LIB_VERSION@ $(libdir)/$${n}; \
#4 lore raw

PATCH 3/3 Fix DESTDIR usage in Makefiles

In reply to [email protected]

The current practice of prefixing $DESTDIR to %prefix% does not work well with the default values of various directories as set by ./configure.

If you
./configure
make
make install DESTDIR=/tmp/root

then the man page are installed in the system man pages, not in /tmp/root at all, so library files are install in /tmp/root/tmp/root/lib.

This patch changes all the Makefiles to mention $DESTDIR explicitly when installing, and removes the prepending of $DESTDIR in make.tmpl.

It also modifies the configure command in dmraid.spec to not prefix all directories with RPM_BUILD_ROOT.

---
 dmraid.spec         |    4 ++--
 include/Makefile.in |   10 +++++-----
 lib/Makefile.in     |   16 +++++++++-------
 make.tmpl.in        |   10 +++++-----
 man/Makefile.in     |   12 ++++++------
 tools/Makefile.in   |   10 +++++-----
 6 files changed, 32 insertions(+), 30 deletions(-)
dmraid.spec +2 -2
@@ -72,8 +72,8 @@ Device failure reporting has to be activ
 %build
 %define _libdir /%{_lib}
 
-%configure --prefix=${RPM_BUILD_ROOT}/usr --sbindir=${RPM_BUILD_ROOT}/sbin --libdir=${RPM_BUILD_ROOT}/%{_libdir} --mandir=${RPM_BUILD_ROOT}/%{_mandir} --includedir=${RPM_BUILD_ROOT}/%{_includedir} --enable-debug --enable-libselinux --enable-libsepol --disable-static_link --enable-led --enable-intel_led
-make DESTDIR=$RPM_BUILD_ROOT
+%configure --prefix=/usr --sbindir=/sbin --libdir=%{_libdir} --mandir=%{_mandir} --includedir=%{_includedir} --enable-debug --enable-libselinux --enable-libsepol --disable-static_link --enable-led --enable-intel_led
+make
 
 %install
 rm -rf $RPM_BUILD_ROOT
include/Makefile.in +5 -5
@@ -16,15 +16,15 @@ include $(top_srcdir)/make.tmpl
 .PHONY: install_dmraid_headers remove_dmraid_headers
 
 install_dmraid_headers: $(HEADERS)
-	@echo "Installing $(HEADERS) in $(includedir)/dmraid"
-	mkdir -p $(includedir)/dmraid
-	$(INSTALL) $(STRIP) $(HEADERS) $(includedir)/dmraid
+	@echo "Installing $(HEADERS) in $(DESTDIR)$(includedir)/dmraid"
+	mkdir -p $(DESTDIR)$(includedir)/dmraid
+	$(INSTALL) $(STRIP) $(HEADERS) $(DESTDIR)$(includedir)/dmraid
 
 install: install_dmraid_headers
 
 remove_dmraid_headers:
-	@echo "Removing $(HEADERS) from $(includedir)/dmraid"
-	rm -f $(includedir)/dmraid
+	@echo "Removing $(HEADERS) from $(DESTDIR)$(includedir)/dmraid"
+	rm -f $(DESTDIR)$(includedir)/dmraid
 
 remove:        remove_dmraid_headers
 
lib/Makefile.in +9 -7
@@ -77,17 +77,17 @@ $(LIB_EVENTS_SHARED):
 .PHONY: install_dmraid_libs remove_dmraid_libs
 
 install_dmraid_libs: $(INSTALL_TARGETS)
-	@echo "Installing $(INSTALL_TARGETS) in $(libdir)"; \
-	mkdir -p $(libdir); \
+	@echo "Installing $(INSTALL_TARGETS) in $(DESTDIR)$(libdir)"; \
+	mkdir -p $(DESTDIR)$(libdir); \
 	for f in $(INSTALL_TARGETS); \
 	do \
 		n=$$(basename $${f}) ; \
 		if [[ "$$n" =~ .so$$ && ! "$$n" =~ libdmraid-events-.* ]]; then \
 			$(INSTALL) -m 555 $(STRIP) \
-				$$f $(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
-			$(LN_S) -f $${n}.@DMRAID_LIB_VERSION@ $(libdir)/$${n}; \
+				$$f $(DESTDIR)$(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
+			$(LN_S) -f $${n}.@DMRAID_LIB_VERSION@ $(DESTDIR)$(libdir)/$${n}; \
 		else \
-			$(INSTALL) -m 555 $(STRIP) $$f $(libdir)/$${n}; \
+			$(INSTALL) -m 555 $(STRIP) $$f $(DESTDIR)$(libdir)/$${n}; \
 		fi \
 	done
 
@@ -98,8 +98,10 @@ remove_dmraid_libs:
 	for f in $(INSTALL_TARGETS); \
 	do \
 		n=$$(basename $${f}) ; \
-		rm -f $(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
-		rm -f $(libdir)/$${n}; \
+		rm -f $(DESTDIR)$(libdir)/$${n}.@DMRAID_LIB_VERSION@; \
+		rm -f $(DESTDIR)$(libdir)/$${n}; \
 	done
 
+
+
 remove:	remove_dmraid_libs
make.tmpl.in +5 -5
@@ -21,8 +21,8 @@ LD_DEPS += @LD_DEPS@
 SOFLAG += @SOFLAG@
 
 # Setup directory variables
-prefix = $(DESTDIR)@prefix@
-exec_prefix = $(DESTDIR)@exec_prefix@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
 bindir = @bindir@
 ifeq ("@KLIBC@", "no")
   libdir = @libdir@
@@ -31,9 +31,9 @@ ifeq ("@KLIBC@", "no")
   infodir = @infodir@
   mandir = @mandir@
 else
-  libdir = $(DESTDIR)@KLIBC_LIB_DIR@
-  sbindir = $(DESTDIR)@KLIBC_SBIN_DIR@
-  includedir = $(DESTDIR)@KLIBC_INCLUDE_DIR@
+  libdir = @KLIBC_LIB_DIR@
+  sbindir = @KLIBC_SBIN_DIR@
+  includedir = @KLIBC_INCLUDE_DIR@
   infodir = @infodir@
   mandir = @mandir@
 endif
man/Makefile.in +6 -6
@@ -16,21 +16,21 @@ include $(top_srcdir)/make.tmpl
 .PHONY:	install_dmraid_man remove_dmraid_man
 
 install_dmraid_man:
-	@echo "Installing $(MAN8) in $(MAN8DIR)"; \
-	mkdir -p $(MAN8DIR); \
+	@echo "Installing $(MAN8) in $(DESTDIR)$(MAN8DIR)"; \
+	mkdir -p $(DESTDIR)$(MAN8DIR); \
 	for f in $(MAN8); \
 	do \
-	   $(RM) $(MAN8DIR)/$$f; \
-	   @INSTALL@ -D -m 444 $$f $(MAN8DIR)/$$f; \
+	   $(RM) $(DESTDIR)$(MAN8DIR)/$$f; \
+	   @INSTALL@ -D -m 444 $$f $(DESTDIR)$(MAN8DIR)/$$f; \
 	done
 
 install:	install_dmraid_man
 
 remove_dmraid_man:
-	@echo "Removing $(MAN8) in $(MAN8DIR)"; \
+	@echo "Removing $(MAN8) in $(DESTDIR)$(MAN8DIR)"; \
 	for f in $(MAN8); \
 	do \
-	   $(RM) $(MAN8DIR)/$$f; \
+	   $(RM) $(DESTDIR)$(MAN8DIR)/$$f; \
 	done
 
 remove:	remove_dmraid_man
tools/Makefile.in +5 -5
@@ -79,17 +79,17 @@ dmevent_tool: $(top_srcdir)/lib/libdmrai
 	      -L$(DESTDIR)$(libdir) $(DMRAIDLIBS) $(DMEVENTTOOLLIBS) $(DMRAIDLIBS) $(LIBS) 
 
 install_dmraid_tools: $(TARGETS)
-	@echo "Installing $(TARGETS) in $(sbindir)"; \
-	mkdir -p $(sbindir); \
-	$(INSTALL) $(STRIP) $(TARGETS) $(sbindir)
+	@echo "Installing $(TARGETS) in $(DESTDIR)$(sbindir)"; \
+	mkdir -p $(DESTDIR)$(sbindir); \
+	$(INSTALL) $(STRIP) $(TARGETS) $(DESTDIR)$(sbindir)
 
 install: install_dmraid_tools
 
 remove_dmraid_tools:
-	@echo "Removing $(TARGETS) from $(sbindir)"; \
+	@echo "Removing $(TARGETS) from $(DESTDIR)$(sbindir)"; \
 	for f in $(TARGETS); \
 	do \
-		rm -f $(sbindir)/$$f; \
+		rm -f $(DESTDIR)$(sbindir)/$$f; \
 	done
 
 remove:	remove_dmraid_tools
#5 lore raw
In reply to [email protected]

Neil,

finally got around to work through your patches and apply them to the sources repository.

Regards,
Heinz

Quoted 15 lines · On Tue, 2010-02-02 at 18:25 +1100, [email protected] wrote:

Hi,
following are a few patches for dmraid that I made while packaging -rc16 for openSUSE.

The first two I sent previously as just one patch but it didn't get applied. So I broke it into two in the hope that at least the first (which is a clear bug) will be applied.

Thanks,
NeilBrown

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel