build_hue_common.sh 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. #!/usr/bin/env bash
  2. function big_console_header() {
  3. set +x
  4. local text="$*"
  5. local spacing=$(( (75+${#text}) /2 ))
  6. printf "\n\n"
  7. echo "============================================================================"
  8. echo "============================================================================"
  9. printf "%*s\n" ${spacing} "${text}"
  10. echo "============================================================================"
  11. echo "============================================================================"
  12. printf "\n\n"
  13. set -x
  14. }
  15. function check_python38_path() {
  16. export python38_bin="$PYTHON38_PATH/bin/python3.8"
  17. if [ ! -e "$python38_bin" ]; then
  18. echo "Python38 bin does not exists at " $python38_bin
  19. exit 1
  20. fi
  21. export pip38_bin="$PYTHON38_PATH/bin/pip3.8"
  22. }
  23. function check_python39_path() {
  24. export python39_bin="$PYTHON39_PATH/bin/python3.9"
  25. if [ ! -e "$python39_bin" ]; then
  26. echo "Python39 bin does not exists at " $python39_bin
  27. exit 1
  28. fi
  29. export pip39_bin="$PYTHON39_PATH/bin/pip3.9"
  30. }
  31. function check_python310_path() {
  32. export python310_bin="$PYTHON310_PATH/bin/python3.10"
  33. if [ ! -e "$python310_bin" ]; then
  34. echo "Python310 bin does not exists at " $python310_bin
  35. exit 1
  36. fi
  37. export pip310_bin="$PYTHON310_PATH/bin/pip3.10"
  38. }
  39. function check_sqlite3() {
  40. export sqlit3_bin="$SQLITE3_PATH"
  41. if [ ! -e "$sqlit3_bin" ]; then
  42. echo "sqlit3 bin does not exists at " $sqlit3_bin
  43. exit 1
  44. fi
  45. }
  46. function redhat7_ppc_install() {
  47. if [[ $FORCEINSTALL -eq 1 ]]; then
  48. # pre-req install
  49. sudo -- sh -c 'yum install -y cyrus-sasl-gssapi \
  50. cyrus-sasl-plain \
  51. java-11-openjdk \
  52. java-11-openjdk-devel \
  53. java-11-openjdk-headless \
  54. krb5-workstation \
  55. libpcap \
  56. ncurses-devel \
  57. nmap-ncat \
  58. xmlsec1 \
  59. xmlsec1-openssl \
  60. unzip'
  61. # NODEJS 16 install
  62. # Upgrading to node-v16 because of the following CVE's in node-v14 "CVE-2021-3450, CVE-2021-44531, CVE-2023-32004, CVE-2023-32006"
  63. # Node-v20-LTS is not supported by old OS'es - Redhat7_ppc, Centos7, Ubuntu18, Sles12. So upgrading to node-v16
  64. sudo -- sh -c 'curl -fsSL https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-ppc64le.tar.gz -o node-v16.20.2-linux-ppc64le.tar.gz && \
  65. mkdir -p /usr/local/lib/nodejs && \
  66. tar -xzf node-v16.20.2-linux-ppc64le.tar.gz -C /usr/local/lib/nodejs'
  67. echo 'export PATH=/usr/local/lib/nodejs/node-v16.20.2-linux-ppc64le/bin:$PATH' >> ~/.bashrc
  68. source ~/.bashrc
  69. # sqlite3 install
  70. sudo TOOLS_HOME=${TOOLS_HOME} -- sh -c 'mkdir -p ${TOOLS_HOME} && \
  71. cd ${TOOLS_HOME} && \
  72. curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  73. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  74. cd sqlite-autoconf-3350500 && \
  75. ./configure --prefix=${TOOLS_HOME}/sqlite && make && make install'
  76. export LD_LIBRARY_PATH=${TOOLS_HOME}/sqlite/lib:/usr/local/lib:$LD_LIBRARY_PATH
  77. # python3.8 re install for sqlite3 3.35.5 or higher version
  78. sudo LD_LIBRARY_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_LIBRARY_PATH \
  79. LD_RUN_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_RUN_PATH \
  80. -- sh -c 'curl -o Python-3.8.13.tgz https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz && \
  81. tar zxvf Python-3.8.13.tgz && \
  82. cd Python-3.8.13 && \
  83. ./configure --enable-shared --prefix=/opt/cloudera/cm-agent && \
  84. make install'
  85. # Pip modules install
  86. sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}''
  87. sudo pip38_bin=${pip38_bin} -- sh -c 'ln -fs ${pip38_bin} $(dirname ${pip38_bin})/pip'
  88. fi
  89. }
  90. function redhat8_ppc_install() {
  91. if [[ $FORCEINSTALL -eq 1 ]]; then
  92. # pre-req install
  93. sudo -- sh -c 'yum install -y \
  94. python38 \
  95. python38-libs \
  96. python38-devel \
  97. python38-numpy \
  98. python38-PyMySQL \
  99. python38-cryptography \
  100. python38-cffi \
  101. python38-psycopg2 \
  102. python38-Cython \
  103. python38-lxml \
  104. java-11-openjdk-devel \
  105. java-11-openjdk-headless \
  106. krb5-workstation \
  107. nmap-ncat \
  108. xmlsec1 \
  109. xmlsec1-openssl \
  110. libss \
  111. ncurses-devel'
  112. # MySQLdb install
  113. sudo -- sh -c 'yum install -y python3-mysqlclient'
  114. # NODEJS install
  115. sudo sh -c 'curl -fsSL https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-ppc64le.tar.gz -o node-v20.11.0-linux-ppc64le.tar.gz && \
  116. mkdir -p /usr/local/lib/nodejs && \
  117. tar -xzf node-v20.11.0-linux-ppc64le.tar.gz -C /usr/local/lib/nodejs'
  118. echo 'export PATH=/usr/local/lib/nodejs/node-v20.11.0-linux-ppc64le/bin:$PATH' >> ~/.bashrc
  119. source ~/.bashrc
  120. # Pip modules install
  121. sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  122. sudo pip38_bin=${pip38_bin} -- sh -c 'ln -fs ${pip38_bin} $(dirname ${pip38_bin})/pip'
  123. # sqlite3 install
  124. sudo TOOLS_HOME=${TOOLS_HOME} -- sh -c 'mkdir -p ${TOOLS_HOME} && \
  125. cd ${TOOLS_HOME} && \
  126. curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  127. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  128. cd sqlite-autoconf-3350500 && \
  129. ./configure --prefix=${TOOLS_HOME}/sqlite && make && make install'
  130. export LD_LIBRARY_PATH=${TOOLS_HOME}/sqlite/lib:/usr/local/lib:$LD_LIBRARY_PATH
  131. fi
  132. }
  133. function redhat9_ppc_install() {
  134. if [[ $FORCEINSTALL -eq 1 ]]; then
  135. # pre-req install
  136. sudo -- sh -c 'yum install -y \
  137. java-11-openjdk-devel \
  138. java-11-openjdk-headless \
  139. krb5-workstation \
  140. nmap-ncat \
  141. xmlsec1 \
  142. xmlsec1-openssl \
  143. libss \
  144. ncurses-devel'
  145. # MySQLdb install
  146. sudo -- sh -c 'yum install -y python3-mysqlclient'
  147. # NODEJS install
  148. sudo sh -c 'curl -fsSL https://nodejs.org/dist/v20.11.0/node-v20.11.0-linux-ppc64le.tar.gz -o node-v20.11.0-linux-ppc64le.tar.gz && \
  149. mkdir -p /usr/local/lib/nodejs && \
  150. tar -xzf node-v20.11.0-linux-ppc64le.tar.gz -C /usr/local/lib/nodejs'
  151. echo 'export PATH=/usr/local/lib/nodejs/node-v20.11.0-linux-ppc64le/bin:$PATH' >> ~/.bashrc
  152. source ~/.bashrc
  153. # Pip modules install
  154. sudo pip39_bin=${pip39_bin} -- sh -c '${pip39_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  155. sudo pip39_bin=${pip39_bin} -- sh -c 'ln -fs ${pip39_bin} $(dirname ${pip39_bin})/pip'
  156. # sqlite3 install
  157. sudo TOOLS_HOME=${TOOLS_HOME} -- sh -c 'mkdir -p ${TOOLS_HOME} && \
  158. cd ${TOOLS_HOME} && \
  159. curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  160. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  161. cd sqlite-autoconf-3350500 && \
  162. ./configure --prefix=${TOOLS_HOME}/sqlite && make && make install'
  163. export LD_LIBRARY_PATH=${TOOLS_HOME}/sqlite/lib:/usr/local/lib:$LD_LIBRARY_PATH
  164. fi
  165. }
  166. function sles12_install() {
  167. if [[ $FORCEINSTALL -eq 1 ]]; then
  168. # pre-req install
  169. sudo -- sh -c 'zypper install -y cyrus-sasl-gssapi \
  170. cyrus-sasl-plain \
  171. java-11-openjdk \
  172. java-11-openjdk-devel \
  173. java-11-openjdk-headless \
  174. krb5-client pam_krb5 krb5-appl-clients krb5-plugin-kdb-ldap \
  175. libpcap \
  176. ncurses-devel \
  177. nmap \
  178. python3-devel \
  179. postgresql-server-devel \
  180. xmlsec1 xmlsec1-devel xmlsec1-openssl-devel'
  181. # MySQLdb install
  182. sudo -- sh -c 'zypper install -y libmysqlclient-devel libmysqlclient18 libmysqld18 libmysqld-devel'
  183. # NODEJS 16 install
  184. # Upgrading to node-v16 because of the following CVE's in node-v14 "CVE-2021-3450, CVE-2021-44531, CVE-2023-32004, CVE-2023-32006"
  185. # Node-v20-LTS is not supported by old OS'es - Redhat7_ppc, Centos7, Ubuntu18, Sles12. So upgrading to node-v16
  186. sudo -- sh -c 'zypper install -y npm14 nodejs16'
  187. # Pip modules install
  188. sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  189. sudo pip38_bin=${pip38_bin} -- sh -c 'ln -fs ${pip38_bin} $(dirname ${pip38_bin})/pip'
  190. # sqlite3 install
  191. sudo -- sh -c 'curl --insecure -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  192. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  193. cd sqlite-autoconf-3350500 && \
  194. ./configure --prefix=/usr/local/ && make && make install'
  195. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  196. fi
  197. }
  198. function sles15_install() {
  199. if [[ $FORCEINSTALL -eq 1 ]]; then
  200. # pre-req install
  201. sudo -- sh -c 'zypper install -y cyrus-sasl-gssapi \
  202. cyrus-sasl-plain \
  203. java-11-openjdk \
  204. java-11-openjdk-devel \
  205. java-11-openjdk-headless \
  206. krb5-client pam_krb5 krb5-plugin-kdb-ldap \
  207. libpcap1 \
  208. ncurses-devel \
  209. nmap \
  210. postgresql-server-devel \
  211. xmlsec1 xmlsec1-devel xmlsec1-openssl-devel'
  212. # MySQLdb install
  213. sudo -- sh -c 'zypper install -y libmariadb-devel mariadb-client python3-mysqlclient'
  214. # NODEJS 18 install
  215. sudo -- sh -c 'zypper install -y nodejs18 npm20'
  216. # Pip modules install
  217. sudo pip310_bin=${pip310_bin} -- sh -c '${pip310_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  218. sudo pip310_bin=${pip310_bin} -- sh -c 'ln -fs ${pip310_bin} $(dirname ${pip310_bin})/pip'
  219. # sqlite3 install
  220. sudo -- sh -c 'curl --insecure -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  221. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  222. cd sqlite-autoconf-3350500 && \
  223. ./configure --prefix=/usr/local/ && make && make install'
  224. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  225. fi
  226. }
  227. function centos7_install() {
  228. if [[ $FORCEINSTALL -eq 1 ]]; then
  229. # pre-req install
  230. sudo -- sh -c 'yum install -y cyrus-sasl-gssapi \
  231. cyrus-sasl-plain \
  232. java-11-openjdk \
  233. java-11-openjdk-devel \
  234. java-11-openjdk-headless \
  235. krb5-workstation \
  236. libpcap \
  237. ncurses-devel \
  238. nmap-ncat \
  239. xmlsec1 \
  240. xmlsec1-openssl \
  241. unzip \
  242. python3-devel \
  243. postgresql-devel'
  244. # MySQLdb install
  245. sudo -- sh -c 'curl -sSLO https://dev.mysql.com/get/mysql80-community-release-el7-11.noarch.rpm && \
  246. rpm -ivh mysql80-community-release-el7-11.noarch.rpm && \
  247. yum install -y mysql-community-libs mysql-community-client-plugins mysql-community-common'
  248. # NODEJS 16 install
  249. # Upgrading to node-v16 because of the following CVE's in node-v14 "CVE-2021-3450, CVE-2021-44531, CVE-2023-32004, CVE-2023-32006"
  250. # Node-v20-LTS is not supported by old OS'es - Redhat7_ppc, Centos7, Ubuntu18, Sles12. So upgrading to node-v16
  251. sudo -- sh -c 'curl -fsSL https://rpm.nodesource.com/setup_16.x | sudo bash - && \
  252. yum install -y nodejs npm'
  253. # sqlite3 install
  254. sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  255. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  256. cd sqlite-autoconf-3350500 && \
  257. ./configure --prefix=/usr/local/ && make && make install'
  258. # python3.8 re install for sqlite3 3.35.5 or higher version
  259. sudo LD_LIBRARY_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_LIBRARY_PATH \
  260. LD_RUN_PATH=/usr/local/lib:$ORACLE_INSTANTCLIENT19_PATH:$LD_RUN_PATH \
  261. -- sh -c 'curl -o Python-3.8.13.tgz https://www.python.org/ftp/python/3.8.13/Python-3.8.13.tgz && \
  262. tar zxvf Python-3.8.13.tgz && \
  263. cd Python-3.8.13 && \
  264. ./configure --enable-shared --prefix=/opt/cloudera/cm-agent && \
  265. make install'
  266. # Pip modules install
  267. sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  268. sudo pip38_bin=${pip38_bin} -- sh -c 'ln -fs ${pip38_bin} $(dirname ${pip38_bin})/pip'
  269. fi
  270. }
  271. function redhat8_install() {
  272. if [[ $FORCEINSTALL -eq 1 ]]; then
  273. # pre-req install
  274. sudo -- sh -c 'yum install -y \
  275. java-11-openjdk \
  276. java-11-openjdk-devel \
  277. java-11-openjdk-headless \
  278. krb5-workstation \
  279. ncurses-devel \
  280. nmap-ncat \
  281. xmlsec1 \
  282. xmlsec1-openssl \
  283. libss \
  284. ncurses-c++-libs \
  285. python3-devel \
  286. postgresql-devel'
  287. # MySQLdb install
  288. sudo -- sh -c 'yum install -y python3-mysqlclient'
  289. # NODEJS 20 install
  290. sudo -- sh -c 'curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - && \
  291. yum install -y nodejs'
  292. # Pip modules install
  293. sudo pip39_bin=${pip39_bin} -- sh -c '${pip39_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  294. sudo pip39_bin=${pip39_bin} -- sh -c 'ln -fs ${pip39_bin} $(dirname ${pip39_bin})/pip'
  295. # sqlite3 install
  296. sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  297. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  298. cd sqlite-autoconf-3350500 && \
  299. ./configure --prefix=/usr/local/ && make && make install'
  300. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  301. fi
  302. }
  303. function redhat8_arm64_install() {
  304. if [[ $FORCEINSTALL -eq 1 ]]; then
  305. # pre-req install
  306. sudo -- sh -c 'yum install -y \
  307. java-11-openjdk \
  308. java-11-openjdk-devel \
  309. java-11-openjdk-headless \
  310. krb5-workstation \
  311. ncurses-devel \
  312. nmap-ncat \
  313. xmlsec1 \
  314. xmlsec1-openssl \
  315. libss \
  316. ncurses-c++-libs'
  317. # MySQLdb install
  318. sudo -- sh -c 'yum install -y python3-mysqlclient'
  319. # NODEJS 20 install
  320. sudo -- sh -c 'curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - && \
  321. yum install -y nodejs'
  322. # Pip modules install
  323. sudo pip39_bin=${pip39_bin} -- sh -c '${pip39_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  324. sudo pip39_bin=${pip39_bin} -- sh -c 'ln -fs ${pip39_bin} $(dirname ${pip39_bin})/pip'
  325. # sqlite3 install
  326. sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  327. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  328. cd sqlite-autoconf-3350500 && \
  329. ./configure --prefix=/usr/local/ && make && make install'
  330. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  331. fi
  332. }
  333. function ubuntu18_install() {
  334. if [[ $FORCEINSTALL -eq 1 ]]; then
  335. # pre-req install
  336. sudo -- sh -c 'DEBIAN_FRONTEND=noninteractive apt -qq -y install \
  337. krb5-user \
  338. krb5-kdc \
  339. krb5-config \
  340. libkrb5-dev'
  341. sudo -- sh -c 'apt -y install \
  342. ldap-utils \
  343. libpython3.8-dev \
  344. libpython3.8-minimal \
  345. libpython3.8-stdlib \
  346. libxmlsec1 \
  347. libxmlsec1-openssl \
  348. netcat \
  349. nmap \
  350. python3-asn1crypto \
  351. python3-cffi-backend \
  352. python3-crypto \
  353. python3-cryptography \
  354. python3-keyring \
  355. python3-psycopg2 \
  356. python3-setuptools \
  357. python3-wheel \
  358. python3.8-venv \
  359. python3-dev \
  360. libpq-dev \
  361. zlibc'
  362. # MySQLdb install
  363. # It is pre-installed
  364. # NODEJS 16 install
  365. # Upgrading to node-v16 because of the following CVE's in node-v14 "CVE-2021-3450, CVE-2021-44531, CVE-2023-32004, CVE-2023-32006"
  366. # Node-v20-LTS is not supported by old OS'es - Redhat7_ppc, Centos7, Ubuntu18, Sles12. So upgrading to node-v16
  367. sudo -- sh -c 'curl -sL https://deb.nodesource.com/setup_16.x | sudo bash - && \
  368. apt -y install nodejs'
  369. # Pip modules install
  370. sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  371. sudo pip38_bin=${pip38_bin} -- sh -c 'ln -fs ${pip38_bin} $(dirname ${pip38_bin})/pip'
  372. # sqlite3 install
  373. sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  374. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  375. cd sqlite-autoconf-3350500 && \
  376. ./configure --prefix=/usr/local/ && make && make install'
  377. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  378. fi
  379. }
  380. function ubuntu20_install() {
  381. if [[ $FORCEINSTALL -eq 1 ]]; then
  382. # pre-req install
  383. sudo -- sh -c 'DEBIAN_FRONTEND=noninteractive apt -qq -y install \
  384. krb5-user \
  385. krb5-kdc \
  386. krb5-config \
  387. libkrb5-dev'
  388. sudo -- sh -c 'apt -y install \
  389. ldap-utils \
  390. libpython3.8-dev \
  391. libpython3.8-minimal \
  392. libpython3.8-stdlib \
  393. libxmlsec1 \
  394. libxmlsec1-openssl \
  395. libpq-dev \
  396. netcat \
  397. nmap \
  398. python-asn1crypto \
  399. python3-crypto \
  400. python3-cryptography \
  401. python3-keyring \
  402. python3-psycopg2 \
  403. python3-setuptools \
  404. python3-wheel \
  405. python3.8-venv \
  406. zlibc \
  407. openssl \
  408. sudo \
  409. tar \
  410. util-linux'
  411. # MySQLdb install
  412. # It is pre-installed
  413. # NODEJS 20 install
  414. sudo -- sh -c 'apt-get install -y curl && \
  415. curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \
  416. apt-get install -y nodejs'
  417. # Pip modules install
  418. sudo pip38_bin=${pip38_bin} -- sh -c '${pip38_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  419. sudo pip38_bin=${pip38_bin} -- sh -c 'ln -fs ${pip38_bin} $(dirname ${pip38_bin})/pip'
  420. # sqlite3 install
  421. sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  422. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  423. cd sqlite-autoconf-3350500 && \
  424. ./configure --prefix=/usr/local/ && make && make install'
  425. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  426. fi
  427. }
  428. function ubuntu22_install() {
  429. if [[ $FORCEINSTALL -eq 1 ]]; then
  430. # pre-req install
  431. sudo -- sh -c 'DEBIAN_FRONTEND=noninteractive apt -qq -y install \
  432. krb5-user \
  433. krb5-kdc \
  434. krb5-config \
  435. libkrb5-dev'
  436. sudo -- sh -c 'apt -y install \
  437. ldap-utils \
  438. libpython3.10-dev \
  439. libpython3.10-minimal \
  440. libpython3.10-stdlib \
  441. libxmlsec1 \
  442. libxmlsec1-openssl \
  443. libpq-dev \
  444. netcat \
  445. nmap \
  446. python3-asn1crypto \
  447. python3-cryptography \
  448. python3-keyring \
  449. python3-psycopg2 \
  450. python3-setuptools \
  451. python3-wheel \
  452. python3.10-venv \
  453. openssl \
  454. sudo \
  455. tar \
  456. util-linux'
  457. # MySQLdb install
  458. # It is pre-installed
  459. # NODEJS 20 install
  460. sudo -- sh -c 'apt-get install -y curl && \
  461. curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && \
  462. apt-get install -y nodejs'
  463. # Pip modules install
  464. sudo pip310_bin=${pip310_bin} -- sh -c '${pip310_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  465. sudo pip310_bin=${pip310_bin} -- sh -c 'ln -fs ${pip310_bin} $(dirname ${pip310_bin})/pip'
  466. # sqlite3 install
  467. sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  468. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  469. cd sqlite-autoconf-3350500 && \
  470. ./configure --prefix=/usr/local/ && make && make install'
  471. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  472. fi
  473. }
  474. function redhat9_install() {
  475. if [[ $FORCEINSTALL -eq 1 ]]; then
  476. # pre-req install
  477. sudo -- sh -c 'yum install -y \
  478. java-11-openjdk \
  479. java-11-openjdk-devel \
  480. java-11-openjdk-headless \
  481. krb5-workstation \
  482. ncurses-devel \
  483. nmap-ncat \
  484. xmlsec1 \
  485. xmlsec1-openssl \
  486. libss \
  487. ncurses-c++-libs \
  488. postgresql-devel'
  489. # MySQLdb install
  490. sudo -- sh -c 'yum install -y python3-mysqlclient'
  491. # NODEJS 20 install
  492. sudo -- sh -c 'curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - && \
  493. yum install -y nodejs'
  494. # Pip modules install
  495. sudo pip39_bin=${pip39_bin} -- sh -c '${pip39_bin} install virtualenv=='${VIRTUAL_ENV_VERSION}' virtualenv-make-relocatable=='${VIRTUAL_ENV_RELOCATABLE_VERSION}' mysqlclient==2.1.1'
  496. sudo pip39_bin=${pip39_bin} -- sh -c 'ln -fs ${pip39_bin} $(dirname ${pip39_bin})/pip'
  497. # sqlite3 install
  498. sudo -- sh -c 'curl -o sqlite-autoconf-3350500.tar.gz https://www.sqlite.org/2021/sqlite-autoconf-3350500.tar.gz && \
  499. tar zxvf sqlite-autoconf-3350500.tar.gz && \
  500. cd sqlite-autoconf-3350500 && \
  501. ./configure --prefix=/usr/local/ && make && make install'
  502. export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
  503. fi
  504. }