GNUmakefile.in 4.05 KB
Newer Older
1
#
2
# Copyright (c) 2000-2015 University of Utah and the Flux Group.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# 
# {{{EMULAB-LICENSE
# 
# This file is part of the Emulab network testbed software.
# 
# This file is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at
# your option) any later version.
# 
# This file is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public
# License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this file.  If not, see <http://www.gnu.org/licenses/>.
# 
# }}}
#

#
# XXX ONLY RUN THIS INSTALL ON AN UBUNTO LINUX TESTBED NODE!
#
# Trivial. These things just need to be installed into the right place
# on a testbed node before cutting an image.
#
#
SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= @top_builddir@
SUBDIR		= $(subst $(TESTBED_SRCDIR)/,,$(SRCDIR))

include $(OBJDIR)/Makeconf

SCRIPTS		= 

#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
all:	supfile ifcfgs

include $(TESTBED_SRCDIR)/GNUmakerules

SYSETCDIR	= $(DESTDIR)/etc
ETCDIR		= $(DESTDIR)$(CLIENT_ETCDIR)
BINDIR		= $(DESTDIR)$(CLIENT_BINDIR)
VARDIR		= $(DESTDIR)$(CLIENT_VARDIR)
RCDIR		= $(SYSETCDIR)
RRCDIR		= /etc
INSTALL		= /usr/bin/install -c 
COMMON		= $(SRCDIR)/../common
DEFRUNLVLDIR   ?= $(SYSETCDIR)/rc3.d

install client-install:	common-install etc-install \
			script-install bin-install sysetc-fixup
	@echo "Remember to install the PEM files if necessary"

simple-install:	common-install script-install bin-install

dir-install:
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/dhcp
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/dhcp/dhclient-exit-hooks.d
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/init
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/network
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/rsyslog.d
	$(INSTALL) -m 755 -o root -g root -d $(SYSETCDIR)/sudoers.d

common-install:	dir-install
	(cd ../common; $(MAKE) DESTDIR=$(DESTDIR) local-install)

bin-install:	dir-install
	(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) bin-install)
	$(INSTALL) -m 755 $(SRCDIR)/findcnet $(BINDIR)/findcnet

etc-install:	dir-install common-sysetc-install
	$(INSTALL) -m 644 $(SRCDIR)/group $(ETCDIR)/group
	$(INSTALL) -m 644 $(SRCDIR)/passwd $(ETCDIR)/passwd
	$(INSTALL) -m 600 $(SRCDIR)/shadow $(ETCDIR)/shadow
	$(INSTALL) -m 600 $(SRCDIR)/gshadow $(ETCDIR)/gshadow
	$(INSTALL) -m 644 $(SRCDIR)/hosts $(ETCDIR)/hosts

common-sysetc-install:	dir-install
	(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) RRCDIR=$(RRCDIR) sysetc-install)

sysetc-fixup:
	rm -rf $(SYSETCDIR)/modules.conf $(SYSETCDIR)/cron.pend $(SYSETCDIR)/sysconfig $(SYSETCDIR)/init.d/ntpd
	rm -f $(SYSETCDIR)/dhclient-enter-hooks \
		$(SYSETCDIR)/dhclient-exit-hooks
	$(INSTALL) -m 755 $(SRCDIR)/dhclient-exit-hook \
			$(SYSETCDIR)/dhcp/dhclient-exit-hooks.d/emulab
	rm -f $(SYSETCDIR)/rc.local
	$(INSTALL) -m 644 $(SRCDIR)/rc-sysinit.conf $(SYSETCDIR)/init/rc-sysinit.conf
	$(INSTALL) -m 644 $(SRCDIR)/rsyslog-emulab.conf $(SYSETCDIR)/rsyslog.d/60-emulab.conf
	$(INSTALL) -m 755 $(SRCDIR)/rc.local $(SYSETCDIR)/rc.local
	$(INSTALL) -m 644 $(SRCDIR)/interfaces $(SYSETCDIR)/network/interfaces
	$(INSTALL) -m 644 $(SRCDIR)/sudoers $(SYSETCDIR)/sudoers.d/99-emulab
101
	$(INSTALL) -m 755 $(SRCDIR)/ntp $(SYSETCDIR)/init.d/ntp
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122

script-install:	dir-install $(SCRIPTS)
	(cd ../linux; $(MAKE) DESTDIR=$(DESTDIR) RCDIR=$(RCDIR) script-install)

destdircheck:
	@if [ -z "$(DESTDIR)" ]; then \
	    echo "You must define DESTDIR for this target!"; \
	    false; \
	fi
	@if [ "$(DESTDIR)" = "/" ]; then \
	    echo "DESTDIR is '/', really really bad idea!"; \
	    false; \
	fi

#
# The frisbee MFS is more like the BSD version, all shell all the time.
# We also build static binaries for now.
#
frisbee-mfs: destdircheck

sfs-install: