X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2FMakefile.am;h=844e0a4d0eefe569c6cacca3fb3ee4be248d4026;hb=94a8bf0d6c869b1e6bde637dd25666d2f4cb7052;hp=bc35a787ae5b1006c21aeb782ce7d24f55843e63;hpb=c7bfa8812b79c41b826793862373809950ddb2d9;p=liboping.git diff --git a/src/Makefile.am b/src/Makefile.am index bc35a78..844e0a4 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -46,8 +46,21 @@ bin_PROGRAMS += noping noping_SOURCES = oping.c noping_CPPFLAGS = $(AM_CPPFLAGS) -DUSE_NCURSES=1 -noping_LDADD = liboping.la -lm -lncurses +noping_LDADD = liboping.la -lm $(NCURSES_LIB) if BUILD_WITH_LIBRT noping_LDADD += -lrt endif endif # BUILD_WITH_LIBNCURSES + +install-exec-hook: + @if test "x0" = "x$$UID"; then \ + if test "xLinux" = "x`uname -s`"; then \ + echo "Setting CAP_NET_RAW capability on binaries."; \ + setcap cap_net_raw=ep $(DESTDIR)$(bindir)/oping || true; \ + setcap cap_net_raw=ep $(DESTDIR)$(bindir)/noping || true; \ + else \ + echo "Setting set-UID bit on binaries."; \ + chmod u+s $(DESTDIR)$(bindir)/oping || true; \ + chmod u+s $(DESTDIR)$(bindir)/noping || true; \ + fi; \ + fi