From f3fb4969509ae44e879e84c9e132b5f48230cb0a Mon Sep 17 00:00:00 2001 From: LRN Date: Mon, 30 Jul 2012 10:59:26 +0000 Subject: [PATCH] Do not run install commands from makefiles directly --- src/dns/Makefile.am | 6 +----- src/dns/install-dns-helper.sh | 9 +++++++++ src/exit/Makefile.am | 3 +-- src/exit/install-exit-helper.sh | 5 +++++ src/gns/nss/Makefile.am | 12 +++++++++--- src/gns/nss/install-nss-plugin.sh | 7 +++++++ src/nat/Makefile.am | 3 +-- src/nat/install-nat-helper.sh | 6 ++++++ src/transport/Makefile.am | 3 +-- src/transport/install-wlan-helper.sh | 5 +++++ src/vpn/Makefile.am | 3 +-- src/vpn/install-vpn-helper.sh | 5 +++++ 12 files changed, 51 insertions(+), 16 deletions(-) create mode 100644 src/dns/install-dns-helper.sh create mode 100644 src/exit/install-exit-helper.sh create mode 100644 src/gns/nss/install-nss-plugin.sh create mode 100644 src/nat/install-nat-helper.sh create mode 100644 src/transport/install-wlan-helper.sh create mode 100644 src/vpn/install-vpn-helper.sh diff --git a/src/dns/Makefile.am b/src/dns/Makefile.am index ed000aa19..59395700a 100644 --- a/src/dns/Makefile.am +++ b/src/dns/Makefile.am @@ -18,11 +18,7 @@ pkgcfg_DATA = \ if LINUX HIJACKBIN = gnunet-helper-dns install-exec-hook: - $(SUDO_BINARY) chown root $(bindir)/gnunet-helper-dns || true - $(SUDO_BINARY) chgrp $(GNUNETDNS_GROUP) $(bindir)/gnunet-helper-dns || true - $(SUDO_BINARY) chmod 4750 $(bindir)/gnunet-helper-dns || true - $(SUDO_BINARY) chown gnunet:$(GNUNETDNS_GROUP) $(bindir)/gnunet-service-dns || true - $(SUDO_BINARY) chmod 2750 $(bindir)/gnunet-service-dns || true + $(top_srcdir)/src/dns/install-dns-helper.sh $(SUDO_BINARY) $(bindir) $(GNUNETDNS_GROUP) || true else install-exec-hook: endif diff --git a/src/dns/install-dns-helper.sh b/src/dns/install-dns-helper.sh new file mode 100644 index 000000000..ac42e1f29 --- /dev/null +++ b/src/dns/install-dns-helper.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# $1 - sudo binary +# $2 - bindir +# $3 - gnunetdns group +$1 chown root $2/gnunet-helper-dns || true +$1 chgrp $3 $2/gnunet-helper-dns || true +$1 chmod 4750 $2/gnunet-helper-dns || true +$1 chown gnunet:$3 $2/gnunet-service-dns || true +$1 chmod 2750 $2/gnunet-service-dns || true diff --git a/src/exit/Makefile.am b/src/exit/Makefile.am index 5a047a13a..b0b36c661 100644 --- a/src/exit/Makefile.am +++ b/src/exit/Makefile.am @@ -18,8 +18,7 @@ dist_pkgcfg_DATA = \ if LINUX EXITBIN = gnunet-helper-exit install-exec-hook: - $(SUDO_BINARY) chown root:root $(bindir)/gnunet-helper-exit || true - $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-helper-exit || true + $(top_srcdir)/src/exit/install-exit-helper.sh $(SUDO_BINARY) $(bindir) || true else install-exec-hook: endif diff --git a/src/exit/install-exit-helper.sh b/src/exit/install-exit-helper.sh new file mode 100644 index 000000000..afe37ec5e --- /dev/null +++ b/src/exit/install-exit-helper.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# $1 - sudo binary +# $2 - bindir +$1 chown root:root $2/gnunet-helper-exit || true +$1 chmod u+s $2/gnunet-helper-exit || true diff --git a/src/gns/nss/Makefile.am b/src/gns/nss/Makefile.am index 5e8ab5a2e..7caeaa971 100644 --- a/src/gns/nss/Makefile.am +++ b/src/gns/nss/Makefile.am @@ -51,9 +51,15 @@ libnss_gns6_la_SOURCES=$(libnss_gns_la_SOURCES) libnss_gns6_la_CFLAGS=$(libnss_gns_la_CFLAGS) -DNSS_IPV6_ONLY=1 libnss_gns6_la_LDFLAGS=$(libnss_gns_la_LDFLAGS) +if !MINGW install-data-hook: - $(SUDO_BINARY) $(SHELL) $(top_builddir)/libtool --finish $(nssdir) - $(SUDO_BINARY) rm -f $(nssdir)/libnss_gns.la $(nssdir)/libnss_gns4.la $(nssdir)/libnss_gns6.la + $(top_srcdir)/src/gns/nss/install-nss-plugin.sh $(SUDO_BINARY) $(SHELL) $(top_builddir) $(nssdir) uninstall-hook: - $(SUDO_BINARY) rm -f $(nssdir)/libnss_gns.so.2 $(nssdir)/libnss_gns4.so.2 $(nssdir)/libnss_gns6.so.2 + $(top_srcdir)/src/gns/nss/uninstall-nss-plugin.sh $(SUDO_BINARY) $(nssdir) +else +install-data-hook: + +uninstall-hook: + +endif diff --git a/src/gns/nss/install-nss-plugin.sh b/src/gns/nss/install-nss-plugin.sh new file mode 100644 index 000000000..978a3bc67 --- /dev/null +++ b/src/gns/nss/install-nss-plugin.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# $1 - sudo binary +# $2 - shell +# $3 - top_builddir +# $4 - nssdir +$1 $2 $3/libtool --finish $4 +$1 rm -f $4/libnss_gns.la $4/libnss_gns4.la $4/libnss_gns6.la diff --git a/src/nat/Makefile.am b/src/nat/Makefile.am index ed3a1545a..e706a3a00 100644 --- a/src/nat/Makefile.am +++ b/src/nat/Makefile.am @@ -23,8 +23,7 @@ NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client NATSERVER = gnunet-helper-nat-server.c NATCLIENT = gnunet-helper-nat-client.c install-exec-hook: - $(SUDO_BINARY) chown root:root $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true - $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true + $(top_srcdir)/src/nat/install-nat-helper.sh $(SUDO_BINARY) $(bindir) $(nattest) || true else install-exec-hook: endif diff --git a/src/nat/install-nat-helper.sh b/src/nat/install-nat-helper.sh new file mode 100644 index 000000000..158c9fb15 --- /dev/null +++ b/src/nat/install-nat-helper.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# $1 - sudo binary +# $2 - bindir +# $3 - nattest +$1 chown root:root $2/gnunet-helper-nat-server $2/gnunet-helper-nat-client $3 || true +$1 chmod u+s $2/gnunet-helper-nat-server $2/gnunet-helper-nat-client $3 || true diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 7fc679b20..afbd10932 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -47,8 +47,7 @@ endif if LINUX install-exec-hook: - $(SUDO_BINARY) chown root:root $(bindir)/gnunet-helper-transport-wlan || true - $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-helper-transport-wlan || true + $(top_srcdir)/src/transport/install-wlan-helper.sh $(SUDO_BINARY) $(bindir) || true else install-exec-hook: endif diff --git a/src/transport/install-wlan-helper.sh b/src/transport/install-wlan-helper.sh new file mode 100644 index 000000000..30258b8ce --- /dev/null +++ b/src/transport/install-wlan-helper.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# $1 - sudo binary +# $2 - bindir +$1 chown root:root $2/gnunet-helper-transport-wlan || true +$1 chmod u+s $2/gnunet-helper-transport-wlan || true diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am index efd61d775..2826028e8 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am @@ -18,8 +18,7 @@ pkgcfg_DATA = \ if LINUX VPNBIN = gnunet-helper-vpn install-exec-hook: - $(SUDO_BINARY) chown root:root $(bindir)/gnunet-helper-vpn || true - $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-helper-vpn || true + $(top_srcdir)/src/nat/install-vpn-helper.sh $(SUDO_BINARY) $(bindir) || true else install-exec-hook: endif diff --git a/src/vpn/install-vpn-helper.sh b/src/vpn/install-vpn-helper.sh new file mode 100644 index 000000000..fbef41c7e --- /dev/null +++ b/src/vpn/install-vpn-helper.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# $1 - sudo binary +# $2 - bindir +$1 chown root:root $2/gnunet-helper-vpn || true +$1 chmod u+s $2/gnunet-helper-vpn || true -- 2.25.1