From: LRN Date: Mon, 30 Jul 2012 10:59:26 +0000 (+0000) Subject: Do not run install commands from makefiles directly X-Git-Tag: initial-import-from-subversion-38251~12288 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f3fb4969509ae44e879e84c9e132b5f48230cb0a;p=oweals%2Fgnunet.git Do not run install commands from makefiles directly --- 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