Re: [PATCH] Re: make install wants to install haproxy-systemd-wrapper

2016-08-04 Thread Willy Tarreau
On Fri, Jul 29, 2016 at 08:48:38PM +0200, Vincent Bernat wrote:
>  ??? 29 juillet 2016 20:40 CEST, Shawn Heisey  :
> 
> > fi; \
> > done
> > install -d "$(DESTDIR)$(SBINDIR)"
> > -   install haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
> > +   install haproxy $(wildcard haproxy-systemd-wrapper) \
> > +  $(EXTRA) "$(DESTDIR)$(SBINDIR)"
> >  
> 
> You can just use the shell for that. That would be less mysterious than
> the use of wildcard make function without a wildcard.
> 
> install haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
> [ ! -x haproxy-systemd-wrapper ] || install haproxy-systemd-wrapper 
> "$(DESTDIR)$(SBINDIR)"

It's not even needed, what is needed in fact is to specify the same
TARGET at install time so that it keeps the same EXTRA value :

 make install TARGET=linux2628

Note that for people doing :

 make TARGET=linux2628 all install

It should work without any issues.

Willy



Re: [PATCH] Re: make install wants to install haproxy-systemd-wrapper

2016-07-29 Thread Vincent Bernat
 ❦ 29 juillet 2016 20:40 CEST, Shawn Heisey  :

>   fi; \
>   done
>   install -d "$(DESTDIR)$(SBINDIR)"
> - install haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
> + install haproxy $(wildcard haproxy-systemd-wrapper) \
> +$(EXTRA) "$(DESTDIR)$(SBINDIR)"
>  

You can just use the shell for that. That would be less mysterious than
the use of wildcard make function without a wildcard.

install haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
[ ! -x haproxy-systemd-wrapper ] || install haproxy-systemd-wrapper 
"$(DESTDIR)$(SBINDIR)"
-- 
There is no distinctly native American criminal class except Congress.
-- Mark Twain



[PATCH] Re: make install wants to install haproxy-systemd-wrapper

2016-07-29 Thread Shawn Heisey
On 7/27/2016 2:03 PM, Shawn Heisey wrote:
> I'm building some new load balancer machines and I need to install into
> systemd on them.  I've compiled and installed haproxy 1.5.18, and found
> that a fix for the problem Tim outlined has made it into this version,
> and now even when the target is linux2628, which *builds* the systemd
> wrapper, the wrapper is not *installed*.

With a little research, I discovered one way to control make's behavior
depending on whether a file exists or not.

The attached patch causes the systemd wrapper to be installed if it got
built, but I don't know whether this is the right fix.  Trying to use
"wildcard" in a conditional didn't work, and I couldn't figure out why.
It does work if it's one of the arguments on the "install" command.  The
patch is against the master branch cloned in the last couple of days.

Thanks,
Shawn

diff --git a/Makefile b/Makefile
index 4d6ab1a..df7d65e 100644
--- a/Makefile
+++ b/Makefile
@@ -832,7 +832,8 @@ install-bin:
fi; \
done
install -d "$(DESTDIR)$(SBINDIR)"
-   install haproxy $(EXTRA) "$(DESTDIR)$(SBINDIR)"
+   install haproxy $(wildcard haproxy-systemd-wrapper) \
+  $(EXTRA) "$(DESTDIR)$(SBINDIR)"
 
 install: install-bin install-man install-doc