From patchwork Tue Feb 2 07:25:47 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 76248 Received: from mx01.util.phx2.redhat.com (mx1-phx2.redhat.com [209.132.183.26]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o127VtjB028271 for ; Tue, 2 Feb 2010 07:32:33 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.util.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o127U2SJ007836; Tue, 2 Feb 2010 02:30:02 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o127SOOK011138 for ; Tue, 2 Feb 2010 02:28:24 -0500 Received: from mx1.redhat.com (ext-mx07.extmail.prod.ext.phx2.redhat.com [10.5.110.11]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o127SJRh030844 for ; Tue, 2 Feb 2010 02:28:19 -0500 Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o127S6rh016580 for ; Tue, 2 Feb 2010 02:28:07 -0500 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 6929D8D893 for ; Tue, 2 Feb 2010 08:28:06 +0100 (CET) From: neilb@suse.de To: dm-devel@redhat.com Date: Tue, 02 Feb 2010 18:25:47 +1100 Message-Id: <20100202072801.604968735@suse.de> User-Agent: quilt/0.48-1 References: <20100202072544.305994749@suse.de> Content-Disposition: inline; filename=DESTDIR.fix X-RedHat-Spam-Score: -6.162 (AWL,RCVD_IN_DNSWL_HI) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-Scanned-By: MIMEDefang 2.67 on 10.5.110.11 X-loop: dm-devel@redhat.com Subject: [dm-devel] [dmraid 3/3] Fix DESTDIR usage in Makefiles X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development 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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 02 Feb 2010 07:32:33 +0000 (UTC) --- dmraid.orig/dmraid.spec +++ dmraid/dmraid.spec @@ -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 --- dmraid.orig/include/Makefile.in +++ dmraid/include/Makefile.in @@ -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 --- dmraid.orig/lib/Makefile.in +++ dmraid/lib/Makefile.in @@ -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 --- dmraid.orig/make.tmpl.in +++ dmraid/make.tmpl.in @@ -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 --- dmraid.orig/man/Makefile.in +++ dmraid/man/Makefile.in @@ -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 --- dmraid.orig/tools/Makefile.in +++ dmraid/tools/Makefile.in @@ -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