3 # this is the feisty meow host preparation script. it installs all the packages required to run and build feisty meow scripts and applications.
4 # this script may still be a bit incomplete; we definitely use a lot of unix and linux tools in different scripts.
6 # preconditions and dependencies--this script itself depends on:
13 # something borrowed...
14 function exit_on_error() {
16 echo -e "\n\nan important action failed and this script will stop:\n\n$*\n\n*** Exiting script..."
24 function apt_cyg_finder()
26 if whichable apt-cyg; then
28 #hmmm: is that the right syntax for bash?
31 The apt-cyg tool does not seem to be available for cygwin.
32 Please follow the install instructions at:
33 https://github.com/transcode-open/apt-cyg
35 return 13 # not found.
41 # load feisty meow environment here, but first test that we *can* load it.
43 #hmmm: currently, this script needs the system to have already been configured?
44 # that's the implication of calling launch_feisty...
45 # can we find that same bootstrapping code that will reconfigure first?
47 # hmmm: we need clean starty type approach! must not expect feisty to already be configured for use!
48 # e.g.?? $ bash /opt/feistymeow.org/feisty_meow/scripts/core/reconfigure_feisty_meow.sh
49 # hmmm: above ALSO ESSENTIAL TO GET RIGHT!
51 PHASE_MESSAGE="Checking integrity of Feisty Meow subsystem"
52 if [ -z $FEISTY_MEOW_APEX ]; then
53 false; exit_on_error $PHASE_MESSAGE
56 # simple brute force check. can we go there?
57 pushd $FEISTY_MEOW_APEX &> /dev/null
58 exit_on_error locating feisty meow top-level folder
61 # now ask feisty if it's there; should work as long as our scripts are in place.
62 bash $FEISTY_MEOW_APEX/scripts/core/is_feisty_up.sh
63 exit_on_error $PHASE_MESSAGE
66 #hmmm: this will currently fail if reconfigure has never been called.
67 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
71 #hmmm: why two phases?
73 # first the crucial bits for scripts to work...
75 PHASE_MESSAGE="installing perl file and diff modules"
77 if whichable apt; then
78 # ubuntu or debian or other apt-based OSes...
79 sudo apt install libfile-which-perl libtext-diff-perl
80 exit_on_error $PHASE_MESSAGE
81 elif whichable yum; then
82 # rpm based with yum available...
83 sudo yum install perl-File-Which perl-Text-Diff
84 exit_on_error $PHASE_MESSAGE
85 elif [ ! -z "$IS_DARWIN" ]; then
87 brew install dos2unix openssl
88 exit_on_error $PHASE_MESSAGE
89 elif [ "$OS" == "Windows_NT" ]; then
90 # windows-based with cygwin (or we'll fail out currently).
91 if apt_cyg_finder; then
92 apt-cyg install perl-File-Which perl-Text-Diff
93 exit_on_error $PHASE_MESSAGE
99 # then the builder packages...
101 PHASE_MESSAGE="installing code builder packages"
103 if whichable apt; then
104 # ubuntu or debian or other apt-based OSes...
105 sudo apt install mawk build-essential librtmp-dev libcurl4-gnutls-dev libssl-dev
106 exit_on_error $PHASE_MESSAGE
107 elif whichable yum; then
108 # rpm based with yum available...
109 sudo yum install mawk gcc gcc-c++ openssl-devel.x86_64 curl-devel
110 exit_on_error $PHASE_MESSAGE
111 elif [ ! -z "$IS_DARWIN" ]; then
113 #hmmm: still working on these...
114 brew install mawk gpg meld openjdk
115 exit_on_error $PHASE_MESSAGE
116 elif [ "$OS" == "Windows_NT" ]; then
117 # windows-based with cygwin (or we'll fail out).
119 if apt_cyg_finder; then
120 echo need to fix apt cyg install list somewhat.
121 #hmmm: list is in our docs as a separate file for cygwin.
122 # plug those packages into here please.
123 apt-cyg install mawk openssl-devel libz-devel curl-devel
124 exit_on_error $PHASE_MESSAGE
130 # install other external packages and whatnot.
132 #hmmm: anything else to get installed?
140 # get ready to finish up.
142 #...finishing steps... if any.
150 #############################
152 #############################
154 The "kona" collection depends on Java version 8 or better.
156 | Set up the java PPA archive as described here:
157 | https://launchpad.net/~webupd8team/+archive/ubuntu/java
159 #not needed at the moment.
160 #echo "bailing because script is immature. farts!"