blob: 51abd9e0d1639dbefc3db5015d62180efef4e63a [file] [log] [blame]
jeraldabraham5d4d7352014-03-28 02:49:04 -07001#!/usr/bin/python2
2import os
3import sys
4import inspect
5from sets import Set
6
7def usage():
8 print "\nUSAGE:"
9 print " ./install_apps.py [OPTIONS]\n"
10 print " Install NDN applications"
Eric Newberryfe0d0142017-11-29 13:22:48 -070011 print " By default, the latest version of each package will be downloaded from the NDN GitHub"
12 print " repositories (https://github.com/named-data). To obtain the packages locally or from"
13 print " a specific branch or Gerrit change, use the repos.conf file (see repos.conf.sample for"
14 print " more information)."
jeraldabraham5d4d7352014-03-28 02:49:04 -070015 print "\nOPTIONS:"
jeraldabraham5fdeecd2014-04-25 15:56:03 -070016 print " install_ndncxx - install ndn-cxx (named-data/ndn-cxx)"
Eric Newberryfe0d0142017-11-29 13:22:48 -070017 print " setup_security - create an identity using ndnsec (/tmp/nfd_integration_tests)"
jeraldabraham5d4d7352014-03-28 02:49:04 -070018 print " install_NFD - install NFD (named-data/NFD)"
19 print " install_ndntraffic - install ndn-traffic-generator (named-data/ndn-traffic-generator)"
Eric Newberry86b00b92015-06-07 15:23:51 -070020 print " install_ndntools - install ndn-tools (named-data/ndn-tools)"
Eric Newberryfe0d0142017-11-29 13:22:48 -070021 print " install_repong - install repo-ng (named-data/repo-ng)"
Yanbiao Lia8a7d272015-07-20 17:28:45 -070022 print " install_infoedit - install infoedit"
Eric Newberryfe0d0142017-11-29 13:22:48 -070023 print " install_tools - install test tools"
jeraldabraham5d4d7352014-03-28 02:49:04 -070024 print " install_all - do all of the above"
25 print " help - print this message and exit\n"
26
27
28def main():
29 cmd_subfolder = os.path.realpath(
30 os.path.abspath(os.path.join(os.path.split(
31 inspect.getfile(inspect.currentframe()))[0], "install_helpers")))
32 if cmd_subfolder not in sys.path:
33 sys.path.insert(0, cmd_subfolder)
jeraldabraham5fdeecd2014-04-25 15:56:03 -070034 validOptions = [ "install_ndncxx",
jeraldabraham5d4d7352014-03-28 02:49:04 -070035 "setup_security",
36 "install_NFD",
37 "install_ndntraffic",
Eric Newberry86b00b92015-06-07 15:23:51 -070038 "install_ndntools",
Eric Newberryfe0d0142017-11-29 13:22:48 -070039 "install_repong",
Yanbiao Lia8a7d272015-07-20 17:28:45 -070040 "install_infoedit",
Hila Ben Abrahame8c22e92016-10-20 14:30:32 -050041 "install_tools",
jeraldabraham5d4d7352014-03-28 02:49:04 -070042 "install_all",
43 "help" ]
44
45 if len(sys.argv) > 1:
46 actionList = Set(sys.argv[1:])
47 optionsStatus = 0
48 for option in actionList:
49 if option not in validOptions:
50 print "Invalid option provided - " + option
51 optionsStatus = -1
52 break
53 if optionsStatus == 0 and "help" not in actionList:
54 if "install_all" in actionList:
jeraldabraham5fdeecd2014-04-25 15:56:03 -070055 actionList.add("install_ndncxx")
jeraldabraham5d4d7352014-03-28 02:49:04 -070056 actionList.add("setup_security")
57 actionList.add("install_NFD")
58 actionList.add("install_ndntraffic")
Eric Newberry86b00b92015-06-07 15:23:51 -070059 actionList.add("install_ndntools")
Eric Newberryfe0d0142017-11-29 13:22:48 -070060 actionList.add("install_repong")
Yanbiao Lia8a7d272015-07-20 17:28:45 -070061 actionList.add("install_infoedit")
Hila Ben Abrahame8c22e92016-10-20 14:30:32 -050062 actionList.add("install_tools")
Eric Newberryfe0d0142017-11-29 13:22:48 -070063 os.system("./install_helpers/setup_preparation_folder.sh")
64 os.system("./install_helpers/install_dependencies.sh")
jeraldabraham5fdeecd2014-04-25 15:56:03 -070065 if "install_ndncxx" in actionList:
Eric Newberryfe0d0142017-11-29 13:22:48 -070066 os.system("./install_helpers/install_ndncxx.sh")
jeraldabraham5d4d7352014-03-28 02:49:04 -070067 if "setup_security" in actionList:
Eric Newberryfe0d0142017-11-29 13:22:48 -070068 os.system("./install_helpers/setup_security.sh")
jeraldabraham5d4d7352014-03-28 02:49:04 -070069 if "install_NFD" in actionList:
Eric Newberryfe0d0142017-11-29 13:22:48 -070070 os.system("./install_helpers/install_NFD.sh")
jeraldabraham5d4d7352014-03-28 02:49:04 -070071 if "install_ndntraffic" in actionList:
Eric Newberryfe0d0142017-11-29 13:22:48 -070072 os.system("./install_helpers/install_ndntraffic.sh")
Eric Newberry86b00b92015-06-07 15:23:51 -070073 if "install_ndntools" in actionList:
Eric Newberryfe0d0142017-11-29 13:22:48 -070074 os.system("./install_helpers/install_ndntools.sh")
75 if "install_repong" in actionList:
76 os.system("./install_helpers/install_repong.sh")
Yanbiao Lia8a7d272015-07-20 17:28:45 -070077 if "install_infoedit" in actionList:
Eric Newberryfe0d0142017-11-29 13:22:48 -070078 os.system("./install_helpers/install_infoedit.sh")
Hila Ben Abrahame8c22e92016-10-20 14:30:32 -050079 if "install_tools" in actionList:
80 module = __import__("install_tools")
81 module.run()
jeraldabraham5d4d7352014-03-28 02:49:04 -070082 print ""
83 else:
84 usage()
85 else:
86 usage()
87
88
89if __name__ == "__main__":
90 main()