Re: change make install to be really useful

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Dienstag, 14. August 2007, Artur Skawina wrote:
> Udo Richter wrote:
> > Matthias Schwarzott wrote:
> >> makefile-destdir.diff:
> >> It add variable DESTDIR to makefile to install under $(DESTDIR) instead
> >> of /
> >
> > I would prefer something like DESTDIR=/usr/local that can be redirected
> > to /usr or /tmp/newpackage/usr or similar, just as many configure
> > scripts do it. On the downside, this wouldn't work for
> > $(DESTDIR)$(VIDEODIR).
>
> the usual convention is PREFIX, which defaults to '/usr/local' and can be
> changed to eg '/usr/' or '/sw/vdr-1.6.0' etc.
> DESTDIR is completely independent -- it adds _another_ prefix; this is used
> eg when building packages.
> So "make install DESTDIR=/tmp/BLD-38746 PREFIX=/sw/vdr-1.6.0"
> means to assume the program will be installed in /sw/vdr-1.6.0 (and look
> for config files in /sw/vdr-1.6.0/etc/, binaries in /sw/vdr-1.6.0/bin/
> etc), but to copy all the files to /tmp/BLD-38746/sw/vdr-1.6.0. This way
> you can build a package w/o disturbing the /sw/ tree and install using a
> package manager later.

I updated the patch to use DESTDIR and PREFIX.

Comments on installing header files and Make.config?
Should Make.config go to $PREFIX/share/vdr ?

Matthias

-- 
Matthias Schwarzott (zzam)
Index: vdr-1.5.7/Makefile
===================================================================
--- vdr-1.5.7.orig/Makefile
+++ vdr-1.5.7/Makefile
@@ -15,9 +15,11 @@ CXX      ?= g++
 CXXFLAGS ?= -g -O2 -Wall -Woverloaded-virtual
 
 LSIDIR   = ./libsi
-MANDIR   = /usr/local/man
-BINDIR   = /usr/local/bin
-LOCDIR   = /usr/share/vdr/locale
+DESTDIR ?=
+PREFIX  ?= /usr/local
+MANDIR   = $(PREFIX)/share/man
+BINDIR   = $(PREFIX)/bin
+LOCDIR   = $(PREFIX)/share/vdr/locale
 LIBS     = -ljpeg -lpthread -ldl -lcap -lfreetype -lfontconfig
 INCLUDES = -I/usr/include/freetype2
 
@@ -25,6 +27,7 @@ PLUGINDIR= ./PLUGINS
 PLUGINLIBDIR= $(PLUGINDIR)/lib
 
 VIDEODIR = /video
+CONFDIR ?= $(VIDEODIR)
 
 DOXYGEN  = /usr/bin/doxygen
 DOXYFILE = Doxyfile
@@ -123,8 +126,8 @@ i18n: $(I18Nmo)
 	    done
 
 install-i18n:
-	@mkdir -p $(LOCDIR)
-	@(cd $(LOCALEDIR); cp -r --parents * $(LOCDIR))
+	@mkdir -p $(DESTDIR)$(LOCDIR)
+	@(cd $(LOCALEDIR); cp -r --parents * $(DESTDIR)$(LOCDIR))
 
 # The 'include' directory (for plugins):
 
@@ -162,30 +165,31 @@ install: install-bin install-i18n instal
 # VDR binary:
 
 install-bin: vdr
-	@mkdir -p $(BINDIR)
-	@cp --remove-destination vdr runvdr $(BINDIR)
+	@mkdir -p $(DESTDIR)$(BINDIR)
+	@cp --remove-destination vdr runvdr svdrpsend.pl $(DESTDIR)$(BINDIR)
 
 # Configuration files:
 
 install-conf:
-	@if [ ! -d $(VIDEODIR) ]; then\
-	    mkdir -p $(VIDEODIR);\
-	    cp *.conf $(VIDEODIR);\
+	@mkdir -p $(DESTDIR)$(VIDEODIR)
+	@if [ ! -d $(DESTDIR)$(CONFDIR) ]; then\
+	    mkdir -p $(DESTDIR)$(CONFDIR);\
+	    cp *.conf $(DESTDIR)$(CONFDIR);\
 	    fi
 
 # Documentation:
 
 install-doc:
-	@mkdir -p $(MANDIR)/man1
-	@mkdir -p $(MANDIR)/man5
-	@gzip -c vdr.1 > $(MANDIR)/man1/vdr.1.gz
-	@gzip -c vdr.5 > $(MANDIR)/man5/vdr.5.gz
+	@mkdir -p $(DESTDIR)$(MANDIR)/man1
+	@mkdir -p $(DESTDIR)$(MANDIR)/man5
+	@gzip -c vdr.1 > $(DESTDIR)$(MANDIR)/man1/vdr.1.gz
+	@gzip -c vdr.5 > $(DESTDIR)$(MANDIR)/man5/vdr.5.gz
 
 # Plugins:
 
 install-plugins: plugins
-	@mkdir -p $(PLUGINLIBDIR)
-	@cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(PLUGINLIBDIR)
+	@mkdir -p $(DESTDIR)$(PLUGINLIBDIR)
+	@cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(DESTDIR)$(PLUGINLIBDIR)
 
 # Source documentation:
 
Index: vdr-1.5.7/Makefile
===================================================================
--- vdr-1.5.7.orig/Makefile
+++ vdr-1.5.7/Makefile
@@ -20,6 +20,7 @@ PREFIX  ?= /usr/local
 MANDIR   = $(PREFIX)/man
 BINDIR   = $(PREFIX)/bin
 LOCDIR   = $(PREFIX)/share/vdr/locale
+INCDIR   = $(PREFIX)/include
 LIBS     = -ljpeg -lpthread -ldl -lcap -lfreetype -lfontconfig
 INCLUDES = -I/usr/include/freetype2
 
@@ -160,7 +161,7 @@ clean-plugins:
 
 # Install the files:
 
-install: install-bin install-i18n install-conf install-doc install-plugins
+install: install-bin install-i18n install-conf install-doc install-plugins install-header
 
 # VDR binary:
 
@@ -191,6 +192,13 @@ install-plugins: plugins
 	@mkdir -p $(DESTDIR)$(PLUGINLIBDIR)
 	@cp --remove-destination $(PLUGINDIR)/lib/lib*-*.so.$(APIVERSION) $(DESTDIR)$(PLUGINLIBDIR)
 
+# Header files:
+
+install-header:
+	@mkdir -p $(DESTDIR)$(INCDIR)/vdr $(DESTDIR)$(INCDIR)/vdr/libsi
+	@cp *.h Make.config $(DESTDIR)$(INCDIR)/vdr
+	@cp libsi/*.h $(DESTDIR)$(INCDIR)/vdr/libsi
+
 # Source documentation:
 
 srcdoc:
_______________________________________________
vdr mailing list
vdr@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux