GNUmakefile.in 3.25 KB
Newer Older
1
#
2
# Copyright (c) 2000-2011, 2014 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
# 
# {{{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/>.
# 
# }}}
22 23 24 25 26 27 28 29 30 31
#

SRCDIR		= @srcdir@
TESTBED_SRCDIR	= @top_srcdir@
OBJDIR		= ..
SUBDIR		= account
UNIFIED         = @UNIFIED_BOSS_AND_OPS@

include $(OBJDIR)/Makeconf

32
SBIN_STUFF	= tbacct addsfskey addpubkey mkusercert quotamail genpubkeys \
33 34
		  newuser newproj mksyscert spewcert dumpuser dumpproject \
		  manageremote
35
LIBEXEC_STUFF	= webtbacct webaddsfskey webaddpubkey webmkusercert \
36
		  webnewuser webnewproj webspewcert webmanageremote
37
CTRLSBIN_STUFF  = adduserhook accountsetup
38

39 40
# These scripts installed setuid, with sudo. 
SETUID_BIN_SCRIPTS   = 
41
SETUID_SBIN_SCRIPTS  = tbacct addpubkey mkusercert mksyscert
42 43
SETUID_LIBX_SCRIPTS  =

44 45 46 47 48
ifeq ($(PROTOGENI_SUPPORT),1)
SBIN_STUFF += manageremote
SETUID_SBIN_SCRIPTS += manageremote
endif

49 50 51 52 53 54 55 56 57 58
#
# Targets
#
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
TARGETS	= $(SBIN_STUFF) $(LIBEXEC_STUFF) $(CTRLSBIN_STUFF)
else
TARGETS = mksyscert
SETUID_SBIN_SCRIPTS  = mksyscert
endif

59 60 61 62
#
# Force dependencies on the scripts so that they will be rerun through
# configure if the .in file is changed.
# 
63
all:	$(TARGETS)
64 65 66

include $(TESTBED_SRCDIR)/GNUmakerules

67 68 69 70 71 72 73
ifeq ($(STANDALONE_CLEARINGHOUSE),0)
install: boss-install
else
install: clrhouse-install
endif

boss-install: all script-install
74 75 76
	@echo "Don't forget to do a post-install as root"

script-install:	$(addprefix $(INSTALL_SBINDIR)/, $(SBIN_STUFF)) \
77 78
	 $(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_STUFF)) \
	$(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_STUFF))
79 80 81 82 83 84 85 86 87 88

post-install: 
	chmod 775 $(INSTALL_BINDIR)
	chmod 775 $(INSTALL_SBINDIR)
	chmod 775 $(INSTALL_LIBDIR)
	chmod 775 $(INSTALL_LIBEXECDIR)
	chown root $(INSTALL_SBINDIR)/tbacct
	chmod u+s $(INSTALL_SBINDIR)/tbacct
	chown root $(INSTALL_SBINDIR)/addpubkey
	chmod u+s $(INSTALL_SBINDIR)/addpubkey
89 90
	chown root $(INSTALL_SBINDIR)/mkusercert
	chmod u+s $(INSTALL_SBINDIR)/mkusercert
91

Leigh Stoller's avatar
Leigh Stoller committed
92
control-install:
93

94 95
hook-install: $(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_STUFF))

96 97 98
# Clearinghouse install.
clrhouse-install: $(INSTALL_SBINDIR)/mksyscert

99 100 101 102 103
# This rule says what web* script depends on which installed binary directory.
$(LIBEXEC_STUFF): $(INSTALL_SBINDIR)

# Just in case the dirs are not yet created,
$(INSTALL_SBINDIR):
104 105

# And then how to turn the template into the actual script. 
106
$(LIBEXEC_STUFF): $(TESTBED_SRCDIR)/WEBtemplate.in
107
	@echo "Generating $@"
108
	cat $< | sed -e 's,@PROGTOINVOKE@,$(word 2,$^)/$(subst web,,$@),' > $@
109

110 111 112
clean:
	rm -f *.o core

113 114 115 116
$(INSTALL_DIR)/opsdir/sbin/%: %
	@echo "Installing $<"
	-mkdir -p $(INSTALL_DIR)/opsdir/sbin
	$(INSTALL) $< $@