[DVDnav-discuss] [PATCH] fix destdir usage

Dominik 'Rathann' Mierzejewski dominik at greysector.net
Wed Nov 21 20:11:18 CET 2007


Using destdir is only relevant upon installation, so let's move it to make
install* targets. Otherwise the buildroot ends up in dvdnav-config, for
example, since prefix includes $(DESTDIR) thanks to config.mak, we end up
with something like:

prefix=/var/tmp/libdvdnav-4.1.1-1.fc8.1-root-kojibuilder/usr

after

make install DESTDIR=/var/tmp/libdvdnav-4.1.1-1.fc8.1-root-kojibuilder

Patch attached. It's supposed to be applied after the external dvdread one.

Regards,
R.

-- 
Fedora contributor http://fedoraproject.org/wiki/DominikMierzejewski
Livna contributor http://rpm.livna.org MPlayer developer http://mplayerhq.hu
"Faith manages."
        -- Delenn to Lennier in Babylon 5:"Confessions and Lamentations"
-------------- next part --------------
diff -up libdvdnav-4.1.1/Makefile.destdir libdvdnav-4.1.1/Makefile
--- libdvdnav-4.1.1/Makefile.destdir	2007-11-21 19:18:49.000000000 +0100
+++ libdvdnav-4.1.1/Makefile	2007-11-21 19:19:10.000000000 +0100
@@ -115,45 +115,45 @@ endif
 # Install targets
 
 install-headers:
-	install -d $(incdir)
-	install -m 644 $(HEADERS) $(incdir)
+	install -d $(DESTDIR)$(incdir)
+	install -m 644 $(HEADERS) $(DESTDIR)$(incdir)
 ifeq ($(DVDREAD),internal)
-	install -d $(dvdread_incdir)
-	install -m 644 $(DVDREAD_HEADERS) $(dvdread_incdir)
+	install -d $(DESTDIR)$(dvdread_incdir)
+	install -m 644 $(DVDREAD_HEADERS) $(DESTDIR)$(dvdread_incdir)
 endif
 
 install-shared: $(SHLIB)
-	install -d $(shlibdir)
+	install -d $(DESTDIR)$(shlibdir)
 
 	install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(SHLIB) \
-		$(shlibdir)/$(SHLIB).$(SHLIB_VERSION)
+		$(DESTDIR)$(shlibdir)/$(SHLIB).$(SHLIB_VERSION)
 	install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(MINI_SHLIB) \
-		$(shlibdir)/$(MINI_SHLIB).$(SHLIB_VERSION)
+		$(DESTDIR)$(shlibdir)/$(MINI_SHLIB).$(SHLIB_VERSION)
 
-	cd $(shlibdir) && \
+	cd $(DESTDIR)$(shlibdir) && \
 		ln -sf $(SHLIB).$(SHLIB_VERSION) $(SHLIB).$(SHLIB_MAJOR)
-	cd $(shlibdir) && \
+	cd $(DESTDIR)$(shlibdir) && \
 		ln -sf $(MINI_SHLIB).$(SHLIB_VERSION) $(MINI_SHLIB).$(SHLIB_MAJOR)
-	cd $(shlibdir) && \
+	cd $(DESTDIR)$(shlibdir) && \
 		ln -sf $(SHLIB).$(SHLIB_MAJOR) $(SHLIB)
-	cd $(shlibdir) && \
+	cd $(DESTDIR)$(shlibdir) && \
 		ln -sf $(MINI_SHLIB).$(SHLIB_MAJOR) $(MINI_SHLIB)
 
 ifeq ($(DVDREAD),internal)
 	install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(DVDREAD_SHLIB) \
-		$(shlibdir)/$(DVDREAD_SHLIB).$(SHLIB_VERSION)
-	cd $(shlibdir) && \
+		$(DESTDIR)$(shlibdir)/$(DVDREAD_SHLIB).$(SHLIB_VERSION)
+	cd $(DESTDIR)$(shlibdir) && \
 		ln -sf $(DVDREAD_SHLIB).$(SHLIB_VERSION) $(DVDREAD_SHLIB).$(SHLIB_MAJOR)
-	cd $(shlibdir) && \
+	cd $(DESTDIR)$(shlibdir) && \
 		ln -sf $(DVDREAD_SHLIB).$(SHLIB_MAJOR) $(DVDREAD_SHLIB)
 endif
 
 install-static: $(LIB)
-	install -d $(libdir)
+	install -d $(DESTDIR)$(libdir)
 
-	install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(LIB) $(libdir)/$(LIB)
+	install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(LIB) $(DESTDIR)$(libdir)/$(LIB)
 ifeq ($(DVDREAD),internal)
-	install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(DVDREAD_LIB) $(libdir)/$(DVDREAD_LIB)
+	install $(INSTALLSTRIP) -m 755 $(.OBJDIR)/$(DVDREAD_LIB) $(DESTDIR)$(libdir)/$(DVDREAD_LIB)
 endif
 
 
@@ -178,8 +178,8 @@ dvdnav-config: $(.OBJDIR)
 	chmod 0755 $(SRC_PATH_BARE)/$(.OBJDIR)/dvdnav-config
 
 install-dvdnav-config: dvdnav-config
-	install -d $(PREFIX)/bin
-	install -m 0755 $(.OBJDIR)/dvdnav-config $(PREFIX)/bin/dvdnav-config
+	install -d $(DESTDIR)$(PREFIX)/bin
+	install -m 0755 $(.OBJDIR)/dvdnav-config $(DESTDIR)$(PREFIX)/bin/dvdnav-config
 
 
 vpath %.so ${.OBJDIR}
diff -up libdvdnav-4.1.1/configure2.destdir libdvdnav-4.1.1/configure2
--- libdvdnav-4.1.1/configure2.destdir	2007-11-21 19:18:49.000000000 +0100
+++ libdvdnav-4.1.1/configure2	2007-11-21 19:18:49.000000000 +0100
@@ -127,11 +127,11 @@ esac
 cat > config.mak << EOF 
 # Automatically generated by configure, do not edit
 DESTDIR =
-PREFIX=\$(DESTDIR)$PREFIX
-libdir=\$(DESTDIR)$libdir
-shlibdir=\$(DESTDIR)$shlibdir
-incdir=\$(DESTDIR)$incdir
-dvdread_incdir=\$(DESTDIR)$dvdread_incdir
+PREFIX=$PREFIX
+libdir=$libdir
+shlibdir=$shlibdir
+incdir=$incdir
+dvdread_incdir=$dvdread_incdir
 THREADLIB=$threadlib
 BUILD_SHARED=$SHARED
 BUILD_STATIC=$STATIC


More information about the DVDnav-discuss mailing list