# # Copyright (c) 2000-2018 University of Utah and the Flux Group. # # {{{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 . # # }}} # SRCDIR = @srcdir@ TESTBED_SRCDIR = @top_srcdir@ OBJDIR = .. SUBDIR = utils UNIFIED = @UNIFIED_BOSS_AND_OPS@ include $(OBJDIR)/Makeconf SUBDIRS = nsgen BIN_SCRIPTS = delay_config sshtb create_image node_admin link_config \ setdest loghole webcopy linkmon_ctl snmp-if-deref.sh \ template_record spewevents \ wbts_dump mkblob rmblob \ showlease createlease deletelease modlease approvelease \ extendlease createdataset grantlease SBIN_SCRIPTS = vlandiff vlansync withadminprivs export_tables cvsupd.pl \ eventping grantnodetype import_commitlog daemon_wrapper \ opsreboot deletenode node_statewait grabwebcams \ grabswitchconfig backupswitches cvsinit checkquota \ spewconlog opsdb_control newnode suchown archive_list \ spewimage \ anonsendmail epmodeset fixexpinfo node_traffic switch_traffic \ dumpdescriptor subboss_tftpboot_sync testbed-control \ archive-expinfo grantfeature emulabfeature addblob readblob \ prereserve grantimage getimages localize_mfs \ addmanagementiface sharevlan check-shared-bw \ addspecialdevice addspecialiface addvpubaddr ctrladdr \ imagehash clone_image imageinfo imagevalidate image_import \ image_import-new imagetodir imagecompress \ prereserve_check tcppd addexternalnetwork \ update_sitevars delete_image sitecheckin sitecheckin_client \ mktestbedtest fixrootcert addservers poolmonitor \ node_exclude managetaint shutdown-shared imagerelease \ runsonxen pxelinux_makeconf attend atten \ addrfdevice addrfpath reserve announce createimagealias \ predict test-reserve notify-reservations \ deprecate_image pushrootkey addinterface addwire cnetwatch \ addswitch addtypetoimages resutil WEB_SBIN_SCRIPTS= webnewnode webdeletenode webspewconlog webarchive_list \ webspewimage webdumpdescriptor webemulabfeature \ webdelete_image websitecheckin webclone_image webgrantimage \ webreserve WEB_BIN_SCRIPTS = webcreate_image websetdest weblinkmon_ctl webspewevents \ webdelay_config webcreatedataset webdeletelease \ webapprovelease webextendlease webmodlease webgrantlease LIBEXEC_SCRIPTS = spewleds webcopy spewsource webcvsweb xlogin webviewvc \ $(WEB_BIN_SCRIPTS) $(WEB_SBIN_SCRIPTS) CTRLSBIN_SCRIPTS= opsdb_control.proxy daemon_wrapper ec2import.proxy \ ec2import-image.pl GrubConf.rb export-template-remote.rb \ setzfsquotas pruneexpdirs SBSBIN_SCRIPTS= daemon_wrapper subboss_cacheclean # These scripts installed setuid, with sudo. SETUID_BIN_SCRIPTS = create_image SETUID_SBIN_SCRIPTS = grabwebcams checkquota spewconlog opsdb_control suchown \ anonsendmail readblob image_import delete_image \ pxelinux_makeconf imageinfo image_import-new pushrootkey SETUID_SUEXEC_SCRIPTS = xlogin # # Force dependencies on the scripts so that they will be rerun through # configure if the .in file is changed. # all: $(BIN_SCRIPTS) $(SBIN_SCRIPTS) $(LIBEXEC_SCRIPTS) $(CTRLSBIN_SCRIPTS) \ $(SBSBIN_SCRIPTS) $(SETUID_BIN_SCRIPTS) $(SETUID_SBIN_SCRIPTS) \ $(SUBDIRS) firstuser setbuildinfo cnetwatch subboss: $(SBSBIN_SCRIPTS) include $(TESTBED_SRCDIR)/GNUmakerules install: $(addprefix $(INSTALL_BINDIR)/, $(BIN_SCRIPTS)) \ $(addprefix $(INSTALL_SBINDIR)/, $(SBIN_SCRIPTS)) \ $(addprefix $(INSTALL_LIBEXECDIR)/, $(LIBEXEC_SCRIPTS)) \ $(addprefix $(INSTALL_DIR)/opsdir/sbin/, $(CTRLSBIN_SCRIPTS)) \ subdir-install $(INSTALL_PROGRAM) template_record \ $(INSTALL_DIR)/opsdir/bin/template_record $(INSTALL_PROGRAM) loghole $(INSTALL_DIR)/opsdir/bin/loghole -mkdir -p $(INSTALL_DIR)/opsdir/man/man1 $(INSTALL) -m 0644 $(SRCDIR)/loghole.1 \ $(INSTALL_DIR)/opsdir/man/man1/loghole.1 rm -f $(INSTALL_SBINDIR)/wap ln -s withadminprivs $(INSTALL_SBINDIR)/wap @echo "Don't forget to do a post-install as root" boss-install: install subboss-install: $(addprefix $(INSTALL_SBINDIR)/, $(SBSBIN_SCRIPTS)) post-install: chown root $(INSTALL_SBINDIR)/grabwebcams chmod u+s $(INSTALL_SBINDIR)/grabwebcams chown root $(INSTALL_SBINDIR)/checkquota chmod u+s $(INSTALL_SBINDIR)/checkquota chown root $(INSTALL_SBINDIR)/spewconlog chmod u+s $(INSTALL_SBINDIR)/spewconlog chown root $(INSTALL_SBINDIR)/opsdb_control chmod u+s $(INSTALL_SBINDIR)/opsdb_control chown root $(INSTALL_LIBEXECDIR)/xlogin chmod u+s $(INSTALL_LIBEXECDIR)/xlogin # # Control node installation (aka, ops) # control-install: # This rule says what web* script depends on which installed binary directory. $(WEB_SBIN_SCRIPTS): $(INSTALL_SBINDIR) $(WEB_BIN_SCRIPTS): $(INSTALL_BINDIR) # Just in case the dirs are not yet created, $(INSTALL_SBINDIR) $(INSTALL_BINDIR): # And then how to turn the template into the actual script. $(WEB_SBIN_SCRIPTS) $(WEB_BIN_SCRIPTS): $(TESTBED_SRCDIR)/WEBtemplate.in @echo "Generating $@" cat $< | sed -e 's,@PROGTOINVOKE@,$(word 2,$^)/$(subst web,,$@),' > $@ # # Automate this part at some point. # subdir-install: @$(MAKE) -C nsgen install clean: subdir-clean subdir-clean: @$(MAKE) -C nsgen clean $(INSTALL_DIR)/opsdir/sbin/%: % @echo "Installing $<" -mkdir -p $(INSTALL_DIR)/opsdir/sbin $(INSTALL) $< $@