Filesystem hierachy standard patch needs review.

Message ID 504A0161.2000808@tvdr.de
State New
Headers

Commit Message

Klaus Schmidinger Sept. 7, 2012, 2:14 p.m. UTC
  On 07.09.2012 13:26, Klaus Schmidinger wrote:
> On 07.09.2012 13:04, Christopher Reimer wrote:
>> Am 07.09.2012 12:33, schrieb Klaus Schmidinger:
>>> On 06.09.2012 21:09, Manuel Reimer wrote:
>>>> Klaus Schmidinger wrote:
>>>>> Attached is a revised version of the patch, as I intend to adopt
>>>>> it in version 1.7.30.
>>>>
>>>> Didn't try it, so far, but I had a look at it and maybe, I've found a
>>>> small problem:
>>>>
>>>> +# By default VDR requires only one single directory to operate:
>>>>   VIDEODIR = /video
>>>> -CONFDIR  = $(VIDEODIR)
>>>> +# See Make.config.template if you want to build VDR according to the
>>>> FHS ("File system Hierarchy Standard")
>>>>
>>>> [...]
>>>>
>>>> +
>>>> +install-conf:
>>>> +    @cp *.conf $(DESTDIR)$(CONFDIR)
>>>>
>>>>
>>>> For me this seems like "install-conf" does not longer work if FHS is
>>>> *not* used, as "CONFDIR" is not defined without the FHS mode enabled?
>>>
>>> Mabe this would help:
>>>
>>> --- Makefile    2012/09/01 13:22:33     2.28
>>> +++ Makefile    2012/09/07 10:31:35
>>> @@ -76,6 +76,10 @@
>>>   DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\"
>>>   DEFINES += -DLOCDIR=\"$(LOCDIR)\"
>>>
>>> +CONFDIR  ?= $(VIDEODIR)
>>> +CACHEDIR ?= $(VIDEODIR)
>>> +RESDIR   ?= $(CONFDIR)
>>> +
>>>   # The version numbers of VDR and the plugin API (taken from VDR's
>>> "config.h"):
>>>
>>>   VDRVERSION = $(shell sed -ne '/define
>>> VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
>>>
>>>
>>> Please let me know if this should be added.
>>>
>> Hmm, CONFDIR ist already defined in the Makefile.
>
> Not after vdr-1.7.29-fhs.diff has been applied.
> The above addition is meant to be made after applying that patch.

Well, my above suggestion doesn't work as expected because of the recursive
variable expansion done by 'make'.

The following appears to work, though:

-------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------

Klaus
  

Patch

--- Makefile    2012/09/01 13:22:33     2.28
+++ Makefile    2012/09/07 14:11:37
@@ -76,6 +76,12 @@ 
  DEFINES += -DPLUGINDIR=\"$(PLUGINLIBDIR)\"
  DEFINES += -DLOCDIR=\"$(LOCDIR)\"

+# Default values for directories:
+
+CONFDIRDEF  = $(firstword $(CONFDIR)  $(VIDEODIR))
+CACHEDIRDEF = $(firstword $(CACHEDIR) $(VIDEODIR))
+RESDIRDEF   = $(firstword $(RESDIR)   $(CONFDIRDEF))
+
  # The version numbers of VDR and the plugin API (taken from VDR's "config.h"):

  VDRVERSION = $(shell sed -ne '/define VDRVERSION/s/^.*"\(.*\)".*$$/\1/p' config.h)
@@ -112,10 +118,10 @@ 
  vdr.pc: Makefile Make.global
         @echo "bindir=$(BINDIR)" > $@
         @echo "includedir=$(INCDIR)" >> $@
-       @echo "configdir=$(CONFDIR)" >> $@
+       @echo "configdir=$(CONFDIRDEF)" >> $@
         @echo "videodir=$(VIDEODIR)" >> $@
-       @echo "cachedir=$(CACHEDIR)" >> $@
-       @echo "resdir=$(RESDIR)" >> $@
+       @echo "cachedir=$(CACHEDIRDEF)" >> $@
+       @echo "resdir=$(RESDIRDEF)" >> $@
         @echo "plugindir=$(PLUGINLIBDIR)" >> $@
         @echo "localedir=$(LOCDIR)" >> $@
         @echo "apiversion=$(APIVERSION)" >> $@
@@ -200,12 +206,12 @@ 

  install-dirs:
         @mkdir -p $(DESTDIR)$(VIDEODIR)
-       @mkdir -p $(DESTDIR)$(CONFDIR)
-       @mkdir -p $(DESTDIR)$(CACHEDIR)
-       @mkdir -p $(DESTDIR)$(RESDIR)
+       @mkdir -p $(DESTDIR)$(CONFDIRDEF)
+       @mkdir -p $(DESTDIR)$(CACHEDIRDEF)
+       @mkdir -p $(DESTDIR)$(RESDIRDEF)

  install-conf:
-       @cp *.conf $(DESTDIR)$(CONFDIR)
+       @cp *.conf $(DESTDIR)$(CONFDIRDEF)


  # Documentation: