Re: [dev] [sbase][PATCH] install

From: Dimitris Papastamos <sin_AT_2f30.org>
Date: Fri, 12 Feb 2016 10:10:12 +0000

On Thu, Feb 11, 2016 at 12:06:14PM +0100, Mattias Andrée wrote:
> diff --git a/Makefile b/Makefile
> index 1c09cac..b34800d 100644
> --- a/Makefile
> +++ b/Makefile
> _AT_@ -103,6 +103,7 @@ BIN =\
> getconf\
> grep\
> head\
> + install.out\
> join\
> hostname\
> kill\
> _AT_@ -177,6 +178,9 @@ $(OBJ): $(HDR) config.mk
> .o:
> $(CC) $(LDFLAGS) -o $_AT_ $< $(LIB)
>
> +install.out: install.o
> + $(CC) $(LDFLAGS) -o $_AT_ $^ $(LIB)
> +
> .c.o:
> $(CC) $(CFLAGS) $(CPPFLAGS) -o $_AT_ -c $<
>
> _AT_@ -196,13 +200,14 @@ confstr_l.h limits_l.h sysconf_l.h pathconf_l.h: getconf.sh
> install: all
> mkdir -p $(DESTDIR)$(PREFIX)/bin
> cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
> - cd $(DESTDIR)$(PREFIX)/bin && ln -f test [ && chmod 755 $(BIN)
> + mv -f $(DESTDIR)$(PREFIX)/bin/install.out $(DESTDIR)$(PREFIX)/bin/install
> + cd $(DESTDIR)$(PREFIX)/bin && ln -f test [ && chmod 755 $(BIN:.out=)
> mkdir -p $(DESTDIR)$(MANPREFIX)/man1
> for m in $(MAN); do sed "s/^\.Os sbase/.Os sbase $(VERSION)/g" < "$$m" > $(DESTDIR)$(MANPREFIX)/man1/"$$m"; done
> cd $(DESTDIR)$(MANPREFIX)/man1 && chmod 644 $(MAN)
>
> uninstall:
> - cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN)
> + cd $(DESTDIR)$(PREFIX)/bin && rm -f $(BIN:.out=)
> cd $(DESTDIR)$(MANPREFIX)/man1 && rm -f $(MAN)

I tried applying this series but found some problems with the Makefile.

a) you will have to update the sbase-box target, make sbase-box doesn't
   currently work.

b) sbase typically builds with OpenBSD make (and others) as well but
   not with this patch. make install.out on OpenBSD throws:

   make: don't know how to make install.out.c (prerequisite of: install.out.o)
Received on Fri Feb 12 2016 - 11:10:12 CET

This archive was generated by hypermail 2.3.0 : Fri Feb 12 2016 - 11:12:09 CET