Patch to Makefile so plugins are installed and man dirs are created

Message ID 42FEF9AE.3030309@syphir.sytes.net
State New
Headers

Commit Message

C.Y.M Aug. 14, 2005, 7:58 a.m. UTC
  Hello,

Attached is a patch so VDR does not error during the installation if the man
directories do not exist.  Also, this patch installs the plugins as well as the
vdr binary when "make install" is used.

Best Regards,
C.Y.M.
  

Comments

Udo Richter Aug. 14, 2005, 3:49 p.m. UTC | #1
C.Y.M wrote:
> Attached is a patch so VDR does not error during the installation if the man
> directories do not exist.  Also, this patch installs the plugins as well as the
> vdr binary when "make install" is used.

The PLUGINLIBDIR stuff doesnt work well in practice. First, changing
PLUGINLIBDIR to anything but $PLUGINDIR/lib wont work, because most
plugins compile into $PLUGINDIR/src/$PLUGIN/../../lib.

Second, the default plugin install location would be
/usr/local/bin/PLUGINS/lib - not very elegant. I use (and suggest)
/usr/local/lib/vdr, and thats not even a sub-folder of /usr/local/bin.

My suggestions:
- $PLUGINDIR/lib should be hard-coded as compile destination, because
plugin makefiles depend on it anyway.
- As a consequence, plugins-clean should not use $PLUGINLIBDIR, but
$PLUGINDIR/lib for cleaning.
- Install should copy from $PLUGINDIR/lib to $PLUGINLIBDIR, provide
they're not the same. (They are as default)
- Keep $PLUGINLIBDIR as default for -L as it is.

Its a matter of taste whether the default for $PLUGINLIBDIR should
continue to be ./PLUGINS/lib (compatibility!) or /usr/local/lib/vdr or
similar.

Cheers,

Udo
  
C.Y.M Aug. 15, 2005, 12:48 a.m. UTC | #2
Udo Richter wrote:
> C.Y.M wrote:
> 
>>Attached is a patch so VDR does not error during the installation if the man
>>directories do not exist.  Also, this patch installs the plugins as well as the
>>vdr binary when "make install" is used.
> 
> 
> The PLUGINLIBDIR stuff doesnt work well in practice. First, changing
> PLUGINLIBDIR to anything but $PLUGINDIR/lib wont work, because most
> plugins compile into $PLUGINDIR/src/$PLUGIN/../../lib.
> 
> Second, the default plugin install location would be
> /usr/local/bin/PLUGINS/lib - not very elegant. I use (and suggest)
> /usr/local/lib/vdr, and thats not even a sub-folder of /usr/local/bin.
> 
> My suggestions:
> - $PLUGINDIR/lib should be hard-coded as compile destination, because
> plugin makefiles depend on it anyway.
> - As a consequence, plugins-clean should not use $PLUGINLIBDIR, but
> $PLUGINDIR/lib for cleaning.
> - Install should copy from $PLUGINDIR/lib to $PLUGINLIBDIR, provide
> they're not the same. (They are as default)
> - Keep $PLUGINLIBDIR as default for -L as it is.
> 
> Its a matter of taste whether the default for $PLUGINLIBDIR should
> continue to be ./PLUGINS/lib (compatibility!) or /usr/local/lib/vdr or
> similar.
> 

How about we introduce LIBDIR and change the following line:

@cp $(PLUGINLIBDIR)/* $(BINDIR)/$(PLUGINLIBDIR)/

to

@cp $(PLUGINLIBDIR)/* $(LIBDIR)/
  
Udo Richter Aug. 15, 2005, 1:32 a.m. UTC | #3
C.Y.M wrote:
> How about we introduce LIBDIR and change the following line:
> 
> @cp $(PLUGINLIBDIR)/* $(BINDIR)/$(PLUGINLIBDIR)/
> 
> to
> 
> @cp $(PLUGINLIBDIR)/* $(LIBDIR)/

Too confusing. Plus, plugin makefiles do have a LIBDIR that can be
overruled by Make.config.

PLUGINLIBDIR is currently used only at two (!) places:
(1) make plugins-clean cleans that folder
(2) Via -DPLUGINDIR and #define DEFAULTPLUGINDIR, this is the default
for the -L parameter.

As explained, the use for plugins-clean is imho wrong, so this is
currently only a bad way to set the default path. Using this also as the
install destination sounds good to me.

Cheers,

Udo
  

Patch

--- vdr-1.3.28/Makefile.orig	2005-07-31 04:20:20.000000000 -0700
+++ vdr-1.3.28/Makefile	2005-08-13 18:43:19.000000000 -0700
@@ -183,11 +183,24 @@ 
 # Install the files:
 
 install:
+	@if [ ! -d $(BINDIR) ]; then\
+            mkdir -p $(BINDIR);\
+            fi
 	@cp vdr runvdr $(BINDIR)
+	@if [ ! -d $(BINDIR)/$(PLUGINLIBDIR) ]; then\
+            mkdir -p $(BINDIR)/$(PLUGINLIBDIR);\
+            fi
+	@cp $(PLUGINLIBDIR)/* $(BINDIR)/$(PLUGINLIBDIR)/
+	@if [ ! -d $(MANDIR)/man1 ]; then\
+            mkdir -p $(MANDIR)/man1;\
+            fi
+	@if [ ! -d $(MANDIR)/man5 ]; then\
+            mkdir -p $(MANDIR)/man5;\
+            fi
 	@gzip -c vdr.1 > $(MANDIR)/man1/vdr.1.gz
 	@gzip -c vdr.5 > $(MANDIR)/man5/vdr.5.gz
 	@if [ ! -d $(VIDEODIR) ]; then\
-            mkdir $(VIDEODIR);\
+            mkdir -p $(VIDEODIR);\
             cp *.conf $(VIDEODIR);\
             fi