makefile problem

Faheem Mitha faheem at email.unc.edu
Fri Sep 22 07:42:07 CEST 2000



Dear Love etc.,

I have taken the liberty of making some modifications in the script. My
version now reads as follows. Please let me know what you think. Whether I
am off base or not. For people on the list who I have not posted
everything to, the makefile below was breaking when I tried to run it to
build an rpm.

                        Best regards, Faheem Mitha.

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

INIT_BIN='$(INIT_BIN)'; for x in $$INIT_BIN; do \
          f=`echo $$x | sed '$(transform)'`; \
          if test -d $(DESTDIR)/etc/rc.d/init.d -o -d /etc/rc.d/init.d
;then \
            DIR=$(DESTDIR)/etc/rc.d/init.d ; \
          elif test -d $(DESTDIR)/etc/init.d -o -d /etc/init.d ;then \
            DIR=$(DESTDIR)/etc/init.d ; \
          else \
            DIR=$(DESTDIR)/$(sysconfdir) ;\
          fi; \
          if test ! -d $$DIR ; then \
            $(MKINSTALLDIRS) $$DIR ; \
          else \
            echo "$$DIR already exists"; \
          fi; \
          if test ! -f $$DIR/$$f; then \
             $(INSTALL_PROGRAM) $$x $$DIR/$$f; \
          fi ; \
          $(INSTALL_PROGRAM) $$x $$DIR/$$f.default; \
      
           done

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

On Thu, 21 Sep 2000, Faheem Mitha wrote:

> Dear Love,
> 
> I took a closer look at the makefile, and it is not so incomprehensible,
> after all , though I have no idea what 
> 
> f=`echo $$x | sed '$(transform)'`;
> 
> is for. In any case, the relevant section of the script is clearly
> 
> ***************************************************************************
> 
> INIT_BIN='$(INIT_BIN)'; for x in $$INIT_BIN; do \
>           f=`echo $$x | sed '$(transform)'`; \
>           if test -d $(DESTDIR)/etc/rc.d/init.d -o -d /etc/rc.d/init.d
> ;then \
>             DIR=$(DESTDIR)/etc/rc.d/init.d ; \
>           elif test -d $(DESTDIR)/etc/init.d -o -d /etc/init.d ;then \
>             DIR=$(DESTDIR)/etc/init.d ; \
>           else \
>             DIR=$(DESTDIR)/$(sysconfdir) ;\
>             $(MKINSTALLDIRS) $$DIR ; \
>           fi ; \
>           if test ! -f $$DIR/$$f; then \
>              $(INSTALL_PROGRAM) $$x $$DIR/$$f; \
>           fi ; \
>           $(INSTALL_PROGRAM) $$x $$DIR/$$f.default; \
>         done
> 
> **************************************************************************
> 
> Now, the good news is that SuSE keeps its init scripts in /sbin/init.d,
> but they are intelligent enough to realise that not everyone does, so they
> have two links, /etc/rc.d and /etc/rc.d/init.d, which both point to
> /sbin/init.d. Now, your script did the following. It looked to see if
> /etc/rc.d/init/d existed. It did (or rather the link did). So it took
> DIR=$(DESTDIR)/etc/rc.d/init.d and finished. Otherwise it would have
> looked for /etc/init.d, I suppose. I am not sure of the point of that (are
> there other distributions that have it in this place). 
> 
> It then checks to see if the file $(DESTDIR)/etc/rc.d/init.d/arla exists,
> and if it has not, installs it. This is OK, but it has not bothered to
> create this directory first, so naturally the script exits with an error!
> 
> The $(MKINSTALLDIRS) $$DIR ; which is the only directory create
> instruction around, is before the fi, so it was naturally skipped. I think
> you want to put this after the fi, and then (maybe) things will be OK.
> 
> In any case, forget about giving SuSE any special treatment, since because
> of their directory links, they can cope with init scripts being put in
> /etc/rc.d/init.d.
> 
> Let me know if the above seems correct.
> 
>                         Best regards, Faheem Mitha.
> 
> 







More information about the Arla-drinkers mailing list