From b90e9f726805610baacb253fea825d35ca6810e4 Mon Sep 17 00:00:00 2001 From: eduardolucioac Date: Wed, 23 Mar 2016 10:51:52 -0300 Subject: [PATCH] Initial commit! By Questor --- .directory | 8 ++++++++ LBGenerator.tar.gz | Bin 0 -> 1869468 bytes ez_i.sh | 823 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ install.sh | 859 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lbn-basic-dt-strt/lbn_basic_dt_strt.sql | 393 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ liblightbase.tar.gz | Bin 0 -> 735019 bytes other-srcs-n-apps/.directory | 5 +++++ other-srcs-n-apps/Python-3.2.2.tar.gz | Bin 0 -> 12875924 bytes other-srcs-n-apps/elasticsearch-1.1.1.noarch.rpm | Bin 0 -> 19087515 bytes other-srcs-n-apps/lbg.conf.dist | 23 +++++++++++++++++++++++ other-srcs-n-apps/mod_wsgi-4.3.2.tar.gz | Bin 0 -> 927776 bytes other-srcs-n-apps/pgdg-centos94-9.4-1.noarch.rpm | Bin 0 -> 5296 bytes other-srcs-n-apps/virtualenv-1.11.6.tar.gz | Bin 0 -> 1610581 bytes py-packs-LBGenerator.sh | 155 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ py-packs-LBGenerator/Beaker-1.7.0.tar.gz | Bin 0 -> 34299 bytes py-packs-LBGenerator/Mako-1.0.1.tar.gz | Bin 0 -> 473295 bytes py-packs-LBGenerator/PasteDeploy-1.5.2.tar.gz | Bin 0 -> 24006 bytes py-packs-LBGenerator/SQLAlchemy-0.9.4.tar.gz | Bin 0 -> 4492988 bytes py-packs-LBGenerator/WebOb-1.4.tar.gz | Bin 0 -> 633302 bytes py-packs-LBGenerator/alembic-0.6.7.tar.gz | Bin 0 -> 467942 bytes py-packs-LBGenerator/psycopg2-2.5.3.tar.gz | Bin 0 -> 690689 bytes py-packs-LBGenerator/pyramid-1.5.1.tar.gz | Bin 0 -> 2401767 bytes py-packs-LBGenerator/pyramid_beaker-0.8.tar.gz | Bin 0 -> 21830 bytes py-packs-LBGenerator/pyramid_restler-0.1a4.tar.gz | Bin 0 -> 13031 bytes py-packs-LBGenerator/repoze.lru-0.6.tar.gz | Bin 0 -> 19814 bytes py-packs-LBGenerator/requests-2.3.0.tar.gz | Bin 0 -> 429521 bytes py-packs-LBGenerator/translationstring-1.1.tar.gz | Bin 0 -> 28524 bytes py-packs-LBGenerator/venusian-1.0a8.tar.gz | Bin 0 -> 42845 bytes py-packs-LBGenerator/voluptuous-0.8.7.tar.gz | Bin 0 -> 24929 bytes py-packs-LBGenerator/waitress-0.8.9.tar.gz | Bin 0 -> 121048 bytes py-packs-LBGenerator/zope.deprecation-4.1.1.tar.gz | Bin 0 -> 146329 bytes py-packs-LBGenerator/zope.interface-4.1.1.tar.gz | Bin 0 -> 864139 bytes py-packs-liblightbase.sh | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ py-packs-liblightbase/decorator-3.4.0.tar.gz | Bin 0 -> 30333 bytes py-packs-liblightbase/jsonpath-rw-1.3.0.tar.gz | Bin 0 -> 12796 bytes py-packs-liblightbase/ply-3.4.tar.gz | Bin 0 -> 138342 bytes py-packs-liblightbase/python-dateutil-2.2.tar.gz | Bin 0 -> 259085 bytes py-packs-liblightbase/requests-2.3.0.tar.gz | Bin 0 -> 429521 bytes py-packs-liblightbase/six-1.7.2.tar.gz | Bin 0 -> 26399 bytes py-packs-liblightbase/voluptuous-0.8.7.tar.gz | Bin 0 -> 24929 bytes 40 files changed, 2354 insertions(+), 0 deletions(-) create mode 100644 .directory create mode 100755 LBGenerator.tar.gz create mode 100755 ez_i.sh create mode 100755 install.sh create mode 100755 lbn-basic-dt-strt/lbn_basic_dt_strt.sql create mode 100755 liblightbase.tar.gz create mode 100755 other-srcs-n-apps/.directory create mode 100755 other-srcs-n-apps/Python-3.2.2.tar.gz create mode 100755 other-srcs-n-apps/elasticsearch-1.1.1.noarch.rpm create mode 100755 other-srcs-n-apps/lbg.conf.dist create mode 100755 other-srcs-n-apps/mod_wsgi-4.3.2.tar.gz create mode 100755 other-srcs-n-apps/pgdg-centos94-9.4-1.noarch.rpm create mode 100755 other-srcs-n-apps/virtualenv-1.11.6.tar.gz create mode 100755 py-packs-LBGenerator.sh create mode 100755 py-packs-LBGenerator/Beaker-1.7.0.tar.gz create mode 100755 py-packs-LBGenerator/Mako-1.0.1.tar.gz create mode 100755 py-packs-LBGenerator/PasteDeploy-1.5.2.tar.gz create mode 100755 py-packs-LBGenerator/SQLAlchemy-0.9.4.tar.gz create mode 100755 py-packs-LBGenerator/WebOb-1.4.tar.gz create mode 100755 py-packs-LBGenerator/alembic-0.6.7.tar.gz create mode 100755 py-packs-LBGenerator/psycopg2-2.5.3.tar.gz create mode 100755 py-packs-LBGenerator/pyramid-1.5.1.tar.gz create mode 100755 py-packs-LBGenerator/pyramid_beaker-0.8.tar.gz create mode 100755 py-packs-LBGenerator/pyramid_restler-0.1a4.tar.gz create mode 100755 py-packs-LBGenerator/repoze.lru-0.6.tar.gz create mode 100755 py-packs-LBGenerator/requests-2.3.0.tar.gz create mode 100755 py-packs-LBGenerator/translationstring-1.1.tar.gz create mode 100755 py-packs-LBGenerator/venusian-1.0a8.tar.gz create mode 100755 py-packs-LBGenerator/voluptuous-0.8.7.tar.gz create mode 100755 py-packs-LBGenerator/waitress-0.8.9.tar.gz create mode 100755 py-packs-LBGenerator/zope.deprecation-4.1.1.tar.gz create mode 100755 py-packs-LBGenerator/zope.interface-4.1.1.tar.gz create mode 100755 py-packs-liblightbase.sh create mode 100755 py-packs-liblightbase/decorator-3.4.0.tar.gz create mode 100755 py-packs-liblightbase/jsonpath-rw-1.3.0.tar.gz create mode 100755 py-packs-liblightbase/ply-3.4.tar.gz create mode 100755 py-packs-liblightbase/python-dateutil-2.2.tar.gz create mode 100755 py-packs-liblightbase/requests-2.3.0.tar.gz create mode 100755 py-packs-liblightbase/six-1.7.2.tar.gz create mode 100755 py-packs-liblightbase/voluptuous-0.8.7.tar.gz diff --git a/.directory b/.directory new file mode 100644 index 0000000..aa8713d --- /dev/null +++ b/.directory @@ -0,0 +1,8 @@ +[Dolphin] +PreviewsShown=true +Timestamp=2016,3,23,10,50,49 +Version=3 +ViewMode=1 + +[Settings] +HiddenFilesShown=true diff --git a/LBGenerator.tar.gz b/LBGenerator.tar.gz new file mode 100755 index 0000000..ef72637 Binary files /dev/null and b/LBGenerator.tar.gz differ diff --git a/ez_i.sh b/ez_i.sh new file mode 100755 index 0000000..2ee740c --- /dev/null +++ b/ez_i.sh @@ -0,0 +1,823 @@ +#!/bin/bash +: 'Trata-se de um módulo que oferece uma série de funcionalidades para +criar um instalador usando "bash". + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ +Copyright 2016 Eduardo Lúcio Amorim Costa +' + +# NOTE: Obtêm a pasta do script atual para que seja usado como +# caminho base/referência durante a instalação! By Questor +EZ_I_DIR_V="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# NOTE: Quando setado faz "ez_i" desabilitar algumas funções, +# notadamente aquelas que envolvem "perguntas ao usuário" e as +# gráficas! By Questor +EZ_I_SKIP_ON_V=0 + +# > -------------------------------------------------------------------------- +# UTILITÁRIOS! +# -------------------------------------- + +f_enter_to_cont() { + : 'Solicitar ao usuário que pressione enter para continuar. + + Args: + INFO_P (Optional[str]): Se informado apresenta uma mensagem ao + usuário. + ' + + INFO_P=$1 + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + + if [ ! -z "$INFO_P" ] ; then + f_div_section + echo "$INFO_P" + f_div_section + fi + + read -p "Press enter to continue..." nothing +} + +GET_USR_INPUT_R="" +f_get_usr_input() { + : 'Obter entradas digitadas pelo usuário. + + Permite autocomplete (tab). Enter para submeter a entrada. + + Args: + QUESTION_P (str): Pergunta a ser feita ao usuário. + ALLOW_EMPTY_P (Optional[int]): 0 - Não permite valor vazio; 1 - Permite + valor vazio. Padrão 0. + + Returns: + GET_USR_INPUT_R (str): Entrada digitada pelo usuário. + ' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + QUESTION_P=$1 + ALLOW_EMPTY_P=$2 + if [ -z "$ALLOW_EMPTY_P" ] ; then + ALLOW_EMPTY_P=0 + fi + GET_USR_INPUT_R="" + read -e -r -p "$QUESTION_P (use enter to confirm): " RESP_V + if [ -n "$RESP_V" ] ; then + GET_USR_INPUT_R="$RESP_V" + elif [ ${ALLOW_EMPTY_P} -eq 0 ] ; then + f_get_usr_input "$QUESTION_P" 0 + fi +} + +F_EZ_SED_ECP_R="" +f_ez_sed_ecp() { + : '"Escapar" strings para o comando "sed". + + Como há muitas semelhanças entre o escape para "sed" ("f_ez_sed") e + escape para "grep" ("f_fl_cont_str") optei por colocar essa + função como utilitária para as outras duas citadas. + + Args: + VAL_TO_ECP (str): Valor a ser "escapado". + DONT_ECP_NL (Optional[int]): 0 - Não "escapa" "\n" (quebra de + linha); 1 - "Escapa" "\n". Padrão 1. + DONT_ECP_SQ (Optional[int]): 0 - Não "escapa" "'" (aspas + simples); 1 - "Escapa" "'". Padrão 0. NOTE: Usado apenas pela + função "f_fl_cont_str". + + Returns: + F_EZ_SED_ECP_R (str): Valor "escapado". + ' + + VAL_TO_ECP=$1 + DONT_ECP_NL=$2 + if [ -z "$DONT_ECP_NL" ] ; then + DONT_ECP_NL=1 + fi + DONT_ECP_SQ=$3 + if [ -z "$DONT_ECP_SQ" ] ; then + DONT_ECP_SQ=0 + fi + F_EZ_SED_ECP_R=$VAL_TO_ECP + if [ ${DONT_ECP_NL} -eq 1 ] ; then + F_EZ_SED_ECP_R=$(echo "$F_EZ_SED_ECP_R" | sed 's/\\n/C0673CECED2D4A8FBA90C9B92B9508A8/g') + fi + F_EZ_SED_ECP_R=$(echo "$F_EZ_SED_ECP_R" | sed 's/[]\/$*.^|[]/\\&/g') + if [ ${DONT_ECP_SQ} -eq 0 ] ; then + F_EZ_SED_ECP_R=$(echo "$F_EZ_SED_ECP_R" | sed "s/'/\\\x27/g") + fi + if [ ${DONT_ECP_NL} -eq 1 ] ; then + F_EZ_SED_ECP_R=$(echo "$F_EZ_SED_ECP_R" | sed 's/C0673CECED2D4A8FBA90C9B92B9508A8/\\n/g') + fi +} + +f_ez_sed() { + : 'Facilitar o uso da funcionalidade "sed". + + Args: + TARGET (str): Valor a ser substituído por pelo valor de REPLACE. + REPLACE (str): Valor que irá substituir TARGET. + FILE (str): Arquivo no qual será feita a substituição. + ALL_OCCUR (Optional[int]): 0 - Fazer replace apenas na primeira + ocorrência; 1 - Fazer replace em todas as ocorrências. Padrão 0. + DONT_ESCAPE (Optional[int]): 0 - Faz escape das strings em + TARGET e REPLACE; 1 - Não faz escape das strings em TARGET e + REPLACE. Padrão 0. + DONT_ECP_NL (Optional[int]): 1 - Não "escapa" "\n" (quebra de + linha); 0 - "Escapa" "\n". Padrão 1. + REMOVE_LN (Optional[int]): 1 - Remove a linha que possui o + valor em TARGET; 0 - Faz o replace convencional. Padrão 0. + ' + + FILE=$3 + ALL_OCCUR=$4 + if [ -z "$ALL_OCCUR" ] ; then + ALL_OCCUR=0 + fi + DONT_ESCAPE=$5 + if [ -z "$DONT_ESCAPE" ] ; then + DONT_ESCAPE=0 + fi + DONT_ECP_NL=$6 + if [ -z "$DONT_ECP_NL" ] ; then + DONT_ECP_NL=1 + fi + REMOVE_LN=$7 + if [ -z "$REMOVE_LN" ] ; then + REMOVE_LN=0 + fi + if [ ${DONT_ESCAPE} -eq 1 ] ; then + TARGET=$1 + REPLACE=$2 + else + f_ez_sed_ecp "$1" $DONT_ECP_NL + TARGET=$F_EZ_SED_ECP_R + f_ez_sed_ecp "$2" $DONT_ECP_NL + REPLACE=$F_EZ_SED_ECP_R + fi + if [ ${REMOVE_LN} -eq 1 ] ; then + if [ ${ALL_OCCUR} -eq 0 ] ; then + SED_RPL="'0,/$TARGET/{//d;}'" + else + SED_RPL="'/$TARGET/d'" + fi + eval "sed -i $SED_RPL $FILE" + else + if [ ${ALL_OCCUR} -eq 0 ] ; then + SED_RPL="'0,/$TARGET/s//$REPLACE/g'" + else + SED_RPL="'s/$TARGET/$REPLACE/g'" + fi + eval "sed -i $SED_RPL $FILE" + fi +} + +FL_CONT_STR_R=0 +f_fl_cont_str() { + : 'Checar se um arquivo contêm determinada string. + + Args: + STR_TO_CH (str): Valor de string a ser verificado. + FILE (str): Arquivo no qual será feita a verificação. + COND_MSG_P (Optional[str]): Mensagem a ser exibida se + verdadeira a verificação. Se vazio ou não informado não será + exibida mensagem. + CHK_INVERT (Optional[int]): Inverter a lógica da checagem. + Padrão 0. + DONT_ESCAPE (Optional[int]): 0 - Faz escape da string em + STR_TO_CH; 1 - Não faz escape das strings em STR_TO_CH. Padrão 0. + DONT_ECP_NL (Optional[int]): 1 - Não "escapa" "\n" (quebra de + linha); 0 - "Escapa" "\n". Padrão 1. + + Returns: + FL_CONT_STR_R (int): 1 - Se verdadeiro para a condição + analisada; 0 - Se falso para a condição analisada. + ' + + STR_TO_CH=$1 + FILE=$2 + COND_MSG_P=$3 + CHK_INVERT=$4 + DONT_ESCAPE=$5 + + if [ -z "$DONT_ESCAPE" ] ; then + DONT_ESCAPE=0 + fi + if [ ${DONT_ESCAPE} -eq 0 ] ; then + DONT_ECP_NL=$6 + if [ -z "$DONT_ECP_NL" ] ; then + DONT_ECP_NL=1 + fi + f_ez_sed_ecp "$STR_TO_CH" $DONT_ECP_NL 1 + STR_TO_CH=$F_EZ_SED_ECP_R + fi + + if [ -z "$CHK_INVERT" ] ; then + CHK_INVERT=0 + fi + FL_CONT_STR_R=0 + if [ ${CHK_INVERT} -eq 0 ] ; then + if grep -q "$STR_TO_CH" "$FILE"; then + FL_CONT_STR_R=1 + fi + else + if ! grep -q "$STR_TO_CH" "$FILE"; then + FL_CONT_STR_R=1 + fi + fi + if [ ${EZ_I_SKIP_ON_V} -eq 0 ] && [ ${FL_CONT_STR_R} -eq 1 ] && [ ! -z "$COND_MSG_P" ] ; then + f_div_section + echo "$COND_MSG_P" + f_div_section + f_enter_to_cont + fi +} + +CHK_FD_FL_R=0 +f_chk_fd_fl() { + : 'Verificar se determinado diretório ou arquivo existe. + + Args: + TARGET (str): Diretório ou arquivo qual se quer verificar. + CHK_TYPE (str): "d" - Checar por diretório; "f" - Checar por + arquivo. + + Returns: + CHK_FD_FL_R (int): 1 - True; 0 - False. + ' + + CHK_FD_FL_R=0 + TARGET=$1 + CHK_TYPE=$2 + if [ "$CHK_TYPE" == "f" ] ; then + if [ -f "$TARGET" ] ; then + CHK_FD_FL_R=1 + fi + fi + if [ "$CHK_TYPE" == "d" ] ; then + if [ -d "$TARGET" ] ; then + CHK_FD_FL_R=1 + fi + fi +} + +F_PACK_IS_INST_R=0 +f_pack_is_inst() { + : 'Checar se um pacote está instalado. + + Args: + PACKAGE_NM_P (str): Nome do pacote. + PACK_MANAG (str): Tipo de gerenciador de pacotes. Apenas yum é + suportado. Em caso diverso o script exibe erro e para. + EXIST_MSG_P (Optional[str]): Mensagem a ser exibida se o + pacote já estiver instalado. Se vazio ou não informado não será + exibida mensagem. + SKIP_MSG_P (Optional[int]): Omite a mensagem. Padrão 0. + + Returns: + F_PACK_IS_INST_R (int): 1 - Instalado; 0 - Não instalado. + ' + + PACKAGE_NM_P=$1 + PACK_MANAG=$2 + EXIST_MSG_P=$3 + SKIP_MSG_P=$4 + + if [ -z "$SKIP_MSG_P" ] ; then + SKIP_MSG_P=0 + fi + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + SKIP_MSG_P=1 + fi + + F_PACK_IS_INST_R=0 + if [ "$PACK_MANAG" == "yum" ] ; then + if yum list installed "$PACKAGE_NM_P" >/dev/null 2>&1; then + if [ ${SKIP_MSG_P} -eq 0 ] && [ ! -z "$EXIST_MSG_P" ] ; then + f_div_section + echo "$EXIST_MSG_P" + f_div_section + f_enter_to_cont + fi + F_PACK_IS_INST_R=1 + else + F_PACK_IS_INST_R=0 + fi + else + f_div_section + echo "ERROR! Not implemented for \"$PACK_MANAG\"!" + f_div_section + f_enter_to_cont + fi +} + +F_CHK_BY_PATH_HLP_R=0 +f_chk_by_path_hlp() { + : 'Checar se um aplicativo/pacote/arquivo está presente/instalado + verificando-o através do seu caminho físico informando. + + Args: + PATH_VER_P (str): Caminho físico para o aplicativo/pacote. + VER_TYPE_P (str): Se o caminho físico é para um diretório ("d") + ou arquivo ("f"). + EXIST_MSG_P (Optional[str]): Mensagem a ser "printada" caso o + aplicativo/pacote/arquivo exista. Se não informado ou vazio não + exibe a mensagem. + SKIP_MSG_P (Optional[int]): Não exibir mensagem. + + Returns: + F_CHK_BY_PATH_HLP_R (int): 0 - Não existe; 1 - Existe + ("printa" menssagem contida em EXIST_MSG_P). + ' + + PATH_VER_P=$1 + VER_TYPE_P=$2 + EXIST_MSG_P=$3 + SKIP_MSG_P=$4 + if [ -z "$SKIP_MSG_P" ] ; then + SKIP_MSG_P=0 + fi + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + SKIP_MSG_P=1 + fi + + F_CHK_BY_PATH_HLP_R=0 + f_chk_fd_fl "$PATH_VER_P" "$VER_TYPE_P" + if [ ${CHK_FD_FL_R} -eq 0 ] ; then + F_CHK_BY_PATH_HLP_R=0 + else + if [ ${SKIP_MSG_P} -eq 0 ] && [ ! -z "$EXIST_MSG_P" ]; then + f_div_section + echo "$EXIST_MSG_P" + f_div_section + f_enter_to_cont + fi + F_CHK_BY_PATH_HLP_R=1 + fi +} + +F_CHK_IPTABLES_R=0 +f_chk_iptables() { + : 'Fazer verificações usando "iptables". + + Trata-se de um utilitário para fazer verificações diversas usando o + comando "iptables" NORMALMENTE CHECAR DE DETERMINADA PORTA ESTÁ + ABERTA. + + Ex 1.: f_chk_iptables 80 + Ex 2.: f_chk_iptables 80 "Já está aberta!" + Ex 3.: f_chk_iptables 80 "Já está aberta!" 0 "ACCEPT" "tcp" "NEW" + Ex 4.: f_chk_iptables 80 "Já está aberta!" 0 "ACCEPT" "tcp" "NEW" 5 + + Args: + PORT_P (int): Porta a ser verificada. + MSG_P (Optional[str]): Mensagem a ser exibida em caso de + verdadeiro para a verificação (normalmente porta aberta). Se vazio + ou não informado não será exibida mensagem. + SKIP_MSG_P (Optional[int]): Não exibir mensagem. + Padrão 0. + TARGET_P (Optional[str]): Padrão "ACCEPT". + PROT_P (Optional[str]): Padrão "tcp". + STATE_P (str): Padrão "". + POS_IN_CHAIN_P (int): Padrão "". + + Returns: + F_CHK_IPTABLES_R (int): 1 - Verdadeiro para a verificação; + 0 - Falso para a verificação. + ' + + PORT_P=$1 + MSG_P=$2 + SKIP_MSG_P=$3 + + if [ -z "$SKIP_MSG_P" ] ; then + SKIP_MSG_P=0 + fi + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + SKIP_MSG_P=1 + fi + + TARGET_P=$4 + if [ -z "$TARGET_P" ] ; then + TARGET_P="ACCEPT" + fi + PROT_P=$5 + if [ -z "$PROT_P" ] ; then + PROT_P="tcp" + fi + STATE_P=$6 + if [ -z "$STATE_P" ] ; then + STATE_P="" + else + STATE_P="state $STATE_P " + fi + POS_IN_CHAIN_P=$7 + if [ -z "$POS_IN_CHAIN_P" ] ; then + POS_IN_CHAIN_P="" + else + POS_IN_CHAIN_P=$(printf "%-9s" $POS_IN_CHAIN_P) + fi + GREP_OUT=$(iptables -vnL --line-numbers | grep "$POS_IN_CHAIN_P" | grep "$TARGET_P" | grep "$PROT_P" | grep "$STATE_P$PROT_P dpt:$PORT_P") + if [ $? -eq 1 ] ; then + F_CHK_IPTABLES_R=1 + else + if [ ${SKIP_MSG_P} -eq 0 ] && [ ! -z "$MSG_P" ] ; then + f_div_section + echo "$MSG_P" + f_div_section + f_enter_to_cont + fi + F_CHK_IPTABLES_R=0 + fi +} + +F_IS_NOT_RUNNING_R=0 +f_is_not_running() { + : 'Checar de determinado processo (pode ser um serviço) está + rodando. + + Args: + PROC_NM_P (str): Nome do processo (pode ser um serviço). + COND_MSG_P (Optional[str]): Mensagem a ser exibida se + verdadeira a verificação. Se vazio ou não informado não será + exibida mensagem. + CHK_INVERT (Optional[int]): Inverter a lógica da checagem. + Padrão 0. + + Returns: + F_IS_NOT_RUNNING_R (int): 1 - Se verdadeiro para a condição + analisada; 0 - Se falso para a condição analisada. + ' + + PROC_NM_P=$1 + COND_MSG_P=$2 + CHK_INVERT=$3 + if [ -z "$CHK_INVERT" ] ; then + CHK_INVERT=0 + fi + F_IS_NOT_RUNNING_R=0 + # NOTE: A verificação "grep -v grep" é para que ele não dê positivo + # para o próprio comando grep! By Questor + F_IS_NOT_RUNNING_R=0 + if [ ${CHK_INVERT} -eq 0 ] ; then + if ! ps aux | grep -v "grep" | grep "$PROC_NM_P" > /dev/null ; then + F_IS_NOT_RUNNING_R=1 + fi + else + if ps aux | grep -v "grep" | grep "$PROC_NM_P" > /dev/null ; then + F_IS_NOT_RUNNING_R=1 + fi + fi + if [ ${EZ_I_SKIP_ON_V} -eq 0 ] && [ ${F_IS_NOT_RUNNING_R} -eq 1 ] && [ ! -z "$COND_MSG_P" ] ; then + f_div_section + echo "$COND_MSG_P" + f_div_section + f_enter_to_cont + fi +} + +F_GET_STDERR_R="" +F_GET_STDOUT_R="" +f_get_stderr_stdout() { + : 'Executar um comando e colocar a saída de stderr e stdout nas + variáveis "F_GET_STDERR_R" e "F_GET_STDOUT_R"!. + + Args: + CMD_TO_EXEC (str): Comando a ser executado. + + Returns: + F_GET_STDERR_R (str): Saída para stderr. + F_GET_STDOUT_R (str): Saída para stdout. + ' + + CMD_TO_EXEC=$1 + F_GET_STDERR_R="" + F_GET_STDOUT_R="" + unset t_std t_err + eval "$( eval "$CMD_TO_EXEC" 2> >(t_err=$(cat); typeset -p t_err) > >(t_std=$(cat); typeset -p t_std) )" + F_GET_STDERR_R=$t_err + F_GET_STDOUT_R=$t_std +} + +F_BAK_PATH_R="" +F_BAK_MD_R=0 +f_ez_mv_bak() { + : 'Modifica o nome de um arquivo ou pasta para um nome de backup. + + Adiciona um sufixo ao nome no formato: "-D%Y-%m-%d-T%H-%M-%S.bak". + + Args: + TARGET (str): Caminho para o arquivo ou pasta alvo. + CONF_MSG_P (Optional[str]): Verificar se o usuário deseja ou + não backup. Se vazio ou não informado não será exibida mensagem. + SKIP_MSG_P (Optional[int]): Não exibir mensagem. Padrão 0. + + Returns: + F_BAK_PATH_R (str): Caminho para o arquivo ou pasta alvo com o + novo nome. + F_BAK_NAME_R (str): Nome do arquivo recém criado. + F_BAK_MD_R (int): 1 - Backup realizado; 0 - Backup não + realizado. + ' + + TARGET=$1 + CONF_MSG_P=$2 + SKIP_MSG_P=$3 + if [ -z "$SKIP_MSG_P" ] ; then + SKIP_MSG_P=0 + fi + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + SKIP_MSG_P=1 + fi + + + MK_BAK=1 + F_BAK_PATH_R="" + F_BAK_NAME_R="" + F_BAK_MD_R=0 + + if [ ${SKIP_MSG_P} -eq 0 ] && [ ! -z "$CONF_MSG_P" ] ; then + f_div_section + f_yes_no "$CONF_MSG_P" + f_div_section + MK_BAK=$YES_NO_R + fi + if [ ${MK_BAK} -eq 1 ] ; then + SUFFIX=$(date +"-D%Y-%m-%d-T%H-%M-%S.bak") + NEW_NAME="$TARGET$SUFFIX" + mv "$TARGET" "$NEW_NAME" + F_BAK_PATH_R=$NEW_NAME + F_BAK_NAME_R="${NEW_NAME##*/}" + F_BAK_MD_R=1 + fi +} + +f_error_exit() { + : '"Printa" uma mensagem de erro e encerra o instalador. + + Args: + ERROR_CAUSE_P (Optional[str]): Causa do erro. + ' + + ERROR_CAUSE_P=$1 + echo + f_open_section "E R R O R !" + ERROR_MSG_NOW_P="AN ERROR OCCURRED AND THIS INSTALLER WAS CLOSED!" + if [ ! -z "$ERROR_CAUSE_P" ] ; then + ERROR_MSG_NOW_P="$ERROR_MSG_NOW_P ERROR: \"$ERROR_CAUSE_P\"" + fi + echo "$ERROR_MSG_NOW_P" + echo + f_close_section + exit 1 +} + +f_continue() { + : 'Questionar ao usuário se deseja continuar ou parar a instalação. + + Args: + NOTE_P (Optional[str]): Informações adicionais ao usuário. + ' + + NOTE_P=$1 + f_div_section + if [ -z "$NOTE_P" ] ; then + NOTE_P="" + else + NOTE_P=" (NOTE: \"$NOTE_P\")" + fi + + f_yes_no "CONTINUE? (USE \"n\" TO STOP THIS INSTALLER)$NOTE_P" + f_div_section + if [ ${YES_NO_R} -eq 0 ] ; then + exit 0 + fi +} + + +# < -------------------------------------------------------------------------- + +# > -------------------------------------------------------------------------- +# GRAFICO! +# -------------------------------------- + +f_indent() { + : 'Definir uma tabulação para uma string informada. + + Exemplo de uso: echo "" | f_indent 4 + + Args: + LEVEL_P (int): 2, 4 ou 8 espaços. + ' + + LEVEL_P=$1 + if [ ${LEVEL_P} -eq 2 ] ; then + sed 's/^/ /'; + fi + if [ ${LEVEL_P} -eq 4 ] ; then + sed 's/^/ /'; + fi + if [ ${LEVEL_P} -eq 8 ] ; then + sed 's/^/ /'; + fi +} + +f_open_section() { + : 'Printar abertura de uma seção.' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + TITLE_P=$1 + echo "> ------------------------------------------------" + if [ -n "$TITLE_P" ] ; then + echo "$TITLE_P" + f_div_section + echo + fi +} + +f_close_section() { + : 'Printar fechamento de uma seção.' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + echo "< ------------------------------------------------" + echo +} + +f_div_section() { + : 'Printar divisão em uma seção.' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + echo "----------------------------------" +} + +f_sub_section() { + : 'Printar uma subseção. + + Args: + TITLE_P (str): Título da subseção. + TEXT_P (str): Texto da subseção. + ' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + TITLE_P=$1 + TEXT_P=$2 + echo "> $TITLE_P" | f_indent 2 + echo + echo "$TEXT_P" | f_indent 4 + echo +} + +# < -------------------------------------------------------------------------- + +# > -------------------------------------------------------------------------- +# APRESENTAÇÃO! +# -------------------------------------- + +f_begin() { + : 'Printar uma abertura/apresentação para o instalador do produto. + + Usar no início da instalação. + + Args: + TITLE_P (str): Título. + VERSION_P (str): Versão do produto. + ABOUT_P (str): Sobre o produto. + WARNINGS_P (str): Avisos antes de continuar. + COMPANY_P (str): Informações sobre a empresa. + ' + + clear + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + TITLE_P=$1 + VERSION_P=$2 + ABOUT_P=$3 + WARNINGS_P=$4 + COMPANY_P=$5 + f_open_section "$TITLE_P ($VERSION_P)" + f_sub_section "ABOUT:" "$ABOUT_P" + f_sub_section "WARNINGS:" "$WARNINGS_P" + f_div_section + echo "$COMPANY_P" + f_close_section + f_enter_to_cont + clear +} + +f_end() { + : 'Printar uma fechamento/encerramento para o instalador do produto. + + Usar no final da instalação. + + Args: + TITLE_P (str): Título. + USEFUL_INFO_P (str): Informações úteis (uso básico etc...). + ' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + TITLE_P=$1 + USEFUL_INFO_P=$2 + f_open_section "$TITLE_P" + f_sub_section "USEFUL INFORMATION:" "$USEFUL_INFO_P" + f_close_section +} + +f_terms_licen() { + : 'Printar os termos de licença/uso do produto. + + Pede que o usuário concorde com os termos. + + Args: + TERMS_LICEN_P (str): Termos de licença/uso do produto. + ' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + TERMS_LICEN_P=$1 + f_open_section "LICENSE/TERMS:" + echo "$TERMS_LICEN_P" | f_indent 2 + echo + f_div_section + TITLE_F="BY ANSWERING YES (y) YOU WILL AGREE WITH TERMS AND CONDITIONS "\ +"PRESENTED! PROCEED?" + f_yes_no "$TITLE_F" + TITLE_F="" + f_close_section + sleep 1 + if [ ${YES_NO_R} -eq 0 ] ; then + exit 0 + fi + clear +} + +f_instruct() { + : 'Printar instruções sobre o produto. + + Args: + INSTRUCT_P (str): Instruções sobre o produto. + ' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + INSTRUCT_P=$1 + f_open_section "INSTRUCTIONS:" + echo "$INSTRUCT_P" | f_indent 2 + echo + f_close_section + f_enter_to_cont + clear +} + +# < -------------------------------------------------------------------------- + +# > -------------------------------------------------------------------------- +# ESQUEMAS CONDICIONAIS! +# -------------------------------------- + +YES_NO_R=0 +f_yes_no() { + : 'Questiona ao usuário "yes" ou "no" sobre determinado algo. + + Args: + QUESTION_P (str): Questionamento a ser feito. + + Returns: + YES_NO_R (int): 1 - Yes; 0 - No. + ' + + if [ ${EZ_I_SKIP_ON_V} -eq 1 ] ; then + return 0 + fi + QUESTION_P=$1 + YES_NO_R=0 + read -r -p "$QUESTION_P (y/n) " RESP_V + if [[ $RESP_V =~ ^([sS]|[yY])$ ]] ; then + YES_NO_R=1 + elif [[ $RESP_V =~ ^([nN])$ ]] ; then + echo "NO!" + YES_NO_R=0 + else + f_yes_no "$QUESTION_P" + fi +} + +# < -------------------------------------------------------------------------- diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..bf660a9 --- /dev/null +++ b/install.sh @@ -0,0 +1,859 @@ +#!/bin/bash + +# NOTE: Evita problemas com caminhos relativos! By Questor +SCRIPTDIR_V="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +. $SCRIPTDIR_V/ez_i.sh + +# > -------------------------------------------------------------------------- +# INÍCIO! +# -------------------------------------- + +read -d '' TITLE_F <<"EOF" +LBG - LBGenerator Installer +EOF + +read -d '' VERSION_F <<"EOF" +0.6.2.0 +EOF + +read -d '' ABOUT_F <<"EOF" +This script will install LBGenerator the LightBase data specification and model! + +Have fun! =D +EOF + +read -d '' WARNINGS_F <<"EOF" +- Installer designed for CentOS 6 AMD64/RHEL 6 AMD64! + +- We RECOMMEND you... + Install all the components (answer yes to everything). Except + contrary guidance! + Check for previous installations! If there is previous + installations consider this variant in the process! +- We WARNING you... + USE AT YOUR OWN RISK: WE ARE NOT RESPONSIBLE FOR ANY DAMAGE TO +YOURSELF, HARDWARE, OR CO-WORKERS. EXCEPT IN CASES WHERE THERE ARE +SIGNED CONTRACT THAT REGULATES THIS! +EOF + +read -d '' COMPANY_F <<"EOF" +BR Light LTDA - LightBase Consulting in Public Software/LightBase Consultoria em Software Público +Free Software + Our Ideas = Best Solution!/Software Livre + Nossas Idéias = Melhor Solução! ++55-61-3347-1949 - http://www.LightBase.com.br - Brasil-DF +EOF + +f_begin "$TITLE_F" "$VERSION_F" "$ABOUT_F" "$WARNINGS_F" "$COMPANY_F" +ABOUT_F="" +WARNINGS_F="" + +# < -------------------------------------------------------------------------- + +# > -------------------------------------------------------------------------- +# TERMOS E LICENÇA! +# -------------------------------------- + +read -d '' TERMS_LICEN_F <<"EOF" +BY USING THIS INSTALLER YOU ARE AGREEING TO THE TERMS OF USE OF ALL +INVOLVED SOFTWARE! +EOF + +f_terms_licen "$TERMS_LICEN_F" +TERMS_LICEN_F="" + +# < -------------------------------------------------------------------------- + +# > -------------------------------------------------------------------------- +# INTRUÇÕES! +# -------------------------------------- + +read -d '' INSTRUCT_F <<"EOF" +- To run this script YOU NEED to be root! + +- TO CANCEL installation at any time use Ctrl+c! +EOF + +f_instruct "$INSTRUCT_F" +INSTRUCT_F="" + +# < -------------------------------------------------------------------------- + +# > ----------------------------------------- +# Dá ao usuário mais avançado a possibilideade de usar o instalador +# simplificado! + +# NOTE: É possível forçar o processo de instalção simplificado setando +# "SIMPLE_INST" com 1! By Questor +SIMPLE_INST=0 +if [ ${SIMPLE_INST} -eq 0 ] ; then + f_open_section + f_yes_no "Use simple install (using a default value for most of the options)?" + if [ ${YES_NO_R} -eq 1 ] ; then + + # NOTE: Essa variável serve apenas para "preservar" o valor + # setado pelo usuário sendo somente "leitura". A variável a + # ser usada nas regras deve ser "EZ_I_SKIP_ON_V" (ez_i.sh)! Essa + # estratégia serve para mudarmos o comportamento do "ez_i.sh" + # de acordo com as circunstâncias! By Questor + SIMPLE_INST=1 + + # NOTE: Essa variável é para consumo do "ez_i.sh", para que ele + # não execute algumas funções e simplifique o processo de + # instalação! By Questor + EZ_I_SKIP_ON_V=1 + fi + f_close_section + sleep 1 +fi + +# < ----------------------------------------- + +# > ----------------------------------------- +# Garantir o encodamento correto para evitar problemas de +# compatibilidade! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Set terminal encode? (recommended for Windows terminal clients) +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + export LANG=pt_BR.utf8 +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Desabilita o SElinux! + +EZ_I_SKIP_ON_V=0 +f_open_section +read -d '' TITLE_F <<"EOF" +Disable SElinux (use "y" if you never did it)? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${YES_NO_R} -eq 1 ] ; then + setenforce 0 + + # NOTE: As condições abaixo visam evitar que o arquivo seja + # desnecessariamente e erroneamente modificado! By Questor + EZ_I_SKIP_ON_V=$SIMPLE_INST + f_fl_cont_str "# SELINUX=enforcing" "/etc/sysconfig/selinux" "The file \"/etc/sysconfig/selinux\" probably has already been changed! Check it!" + EZ_I_SKIP_ON_V=0 + if [ ${FL_CONT_STR_R} -eq 0 ] ; then + f_fl_cont_str "SELINUX=disabled" "/etc/sysconfig/selinux" + if [ ${FL_CONT_STR_R} -eq 0 ] ; then + f_ez_sed "SELINUX=enforcing" "# SELINUX=enforcing\nSELINUX=disabled" "/etc/sysconfig/selinux" + fi + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instala os componentes de base usados pela especificação LightBase! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install base components? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_pack_is_inst "gcc-c++" "yum" "\"gcc-c++\" already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y install gcc-c++ + fi + f_pack_is_inst "zlib-devel" "yum" "\"zlib-devel\" already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y install zlib-devel + fi + f_pack_is_inst "openssl-devel" "yum" "\"openssl-devel\" already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y install openssl-devel + fi + f_pack_is_inst "postgresql-devel" "yum" "\"postgresql-devel\" already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y install postgresql-devel + fi + f_pack_is_inst "git" "yum" "\"git\" already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y install git + fi +fi +f_close_section + +# < ----------------------------------------- + +BASE_INST_DIR_V="/usr/local/lb" +# > ----------------------------------------- +# Criar o diretório base da instalação! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +QUESTION_F="Insert where the base installation directory (\"lb\") will be created (don't use \"/\" at the end). +Use empty for \"/usr/local\"!" + +f_get_usr_input "$QUESTION_F" 1 +QUESTION_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ -z "$GET_USR_INPUT_R" ] ; then + f_chk_by_path_hlp "$BASE_INST_DIR_V" "d" "\"$BASE_INST_DIR_V\" directory already created!" + if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then + mkdir -p "$BASE_INST_DIR_V" + fi +else + BASE_INST_DIR_V="$GET_USR_INPUT_R/lb" + f_chk_by_path_hlp "$BASE_INST_DIR_V" "d" "\"$BASE_INST_DIR_V\" directory already created!" + if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then + mkdir -p "$BASE_INST_DIR_V" + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar o python3.2! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install python3.2? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_chk_by_path_hlp "$BASE_INST_DIR_V/py32" "d" "python3.2 already installed in \"$BASE_INST_DIR_V/py32\"!" + if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then + cd "$SCRIPTDIR_V" + cd ./other-srcs-n-apps + tar -zxvf Python-3.2.2.tar.gz + cd ./Python-3.2.2 + eval "./configure --prefix=$BASE_INST_DIR_V/py32/ --with-threads --enable-shared LDFLAGS=-Wl,-rpath=$BASE_INST_DIR_V/py32/lib/" + make && make install + cd .. + rm -rf ./Python-3.2.2 + f_enter_to_cont "python3.2 installed in \"$BASE_INST_DIR_V/py32\"!" + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar o virtualenv-1.11.6 no python3.2! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install virtualenv-1.11.6 on python3.2? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_chk_by_path_hlp "$BASE_INST_DIR_V/py32/bin/virtualenv-3.2" "f" "virtualenv-1.11.6 already installed in python3.2 (\"$BASE_INST_DIR_V/py32\")!" + if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then + cd "$SCRIPTDIR_V" + cd ./other-srcs-n-apps + tar -zxvf virtualenv-1.11.6.tar.gz + cd virtualenv-1.11.6 + $BASE_INST_DIR_V/py32/bin/python3.2 setup.py install + cd .. + rm -rf virtualenv-1.11.6 + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Criar o ambiente virtual (python3.2)! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +f_enter_to_cont "Create the virtual environment (python3.2)!" + +f_chk_by_path_hlp "$BASE_INST_DIR_V/ve32" "d" "Virtual environment (python3.2) already created in \"$BASE_INST_DIR_V/ve32\"!" +if [ ${F_CHK_BY_PATH_HLP_R} -eq 0 ] ; then + cd "$BASE_INST_DIR_V" + $BASE_INST_DIR_V/py32/bin/virtualenv-3.2 ve32 + mkdir "$BASE_INST_DIR_V/ve32/src" + f_enter_to_cont "Virtual environment created in \"$BASE_INST_DIR_V/ve32\"!" +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar o Apache (httpd)! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install Apache (httpd)? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_pack_is_inst "httpd-devel" "yum" "Apache (httpd) already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y install httpd-devel httpd + chkconfig httpd on + chown -R apache /var/www + chmod -R 755 /var/www + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Abrir o firewall para o Apache (httpd)! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Open firewall for Apache (httpd) (TCP 80)? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_chk_iptables 80 "Port 80 is already open!" 0 "ACCEPT" "tcp" "NEW" + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then + iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT + service iptables save + service iptables restart + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar o mod_wsgi-4.3.2! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install mod_wsgi-4.3.2? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + cd "$SCRIPTDIR_V" + cd ./other-srcs-n-apps + + f_fl_cont_str "$BASE_INST_DIR_V/py32/lib" "/etc/ld.so.conf" "The file \"/etc/ld.so.conf\" probably has already been changed! Check it!" + if [ ${FL_CONT_STR_R} -eq 0 ] ; then + f_ez_sed "include ld.so.conf.d/*.conf" "include ld.so.conf.d/*.conf\n$BASE_INST_DIR_V/py32/lib" "/etc/ld.so.conf" + fi + + UP_MOD_WSGI=1 + f_chk_by_path_hlp "/usr/lib64/httpd/modules/mod_wsgi.so" "f" "mod_wsgi already installed in \"/usr/lib64/httpd/modules/mod_wsgi.so\"!" + if [ ${F_CHK_BY_PATH_HLP_R} -eq 1 ] ; then + if [ ${EZ_I_SKIP_ON_V} -eq 0 ] ; then + TITLE_F="Update/reinstall mod_wsgi? (\"y\" recommended)" + f_div_section + f_yes_no "$TITLE_F" + f_div_section + TITLE_F="" + UP_MOD_WSGI=$YES_NO_R + if [ ${UP_MOD_WSGI} -eq 1 ] ; then + rm -rf "/usr/lib64/httpd/modules/mod_wsgi.so" + fi + fi + fi + if [ ${UP_MOD_WSGI} -eq 1 ] ; then + ldconfig + tar -zxvf ./mod_wsgi-4.3.2.tar.gz + cd ./mod_wsgi-4.3.2 + eval "./configure --with-python=$BASE_INST_DIR_V/py32/bin/python3.2" + make && make install + cd .. + rm -rf ./mod_wsgi-4.3.2 + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar o ElasticSearch! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install ElasticSearch? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_pack_is_inst "elasticsearch.noarch" "yum" "ElasticSearch already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + f_pack_is_inst "java-1.7.0-openjdk" "yum" "java-1.7.0-openjdk already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y install java-1.7.0-openjdk + fi + cd "$SCRIPTDIR_V" + cd ./other-srcs-n-apps + rpm -Uvh elasticsearch-1.1.1.noarch.rpm + /sbin/chkconfig --add elasticsearch + f_fl_cont_str "cluster.name: lb" "/etc/elasticsearch/elasticsearch.yml" "The file \"/etc/elasticsearch/elasticsearch.yml\" probably has already been changed! Check it!" + if [ ${FL_CONT_STR_R} -eq 0 ] ; then + f_ez_sed "# cluster.name: elasticsearch" "# cluster.name: elasticsearch\ncluster.name: lb" "/etc/elasticsearch/elasticsearch.yml" + fi + service elasticsearch start + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Abrir o firewall para o ElasticSearch! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Open firewall for ElasticSearch (TCP 9200)? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_chk_iptables 9200 "Port 9200 is already open!" 0 "ACCEPT" "tcp" "NEW" + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then + iptables -I INPUT 6 -p tcp -m state --state NEW -m tcp --dport 9200 -j ACCEPT + service iptables save + service iptables restart + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar o postgres 9.4! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install postgres 9.4? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + cd "$SCRIPTDIR_V" + cd ./other-srcs-n-apps + f_pack_is_inst "pgdg-centos94-9.4-1.noarch" "yum" "postgres 9.4 already installed!" + if [ ${F_PACK_IS_INST_R} -eq 0 ] ; then + yum -y localinstall pgdg-centos94-9.4-1.noarch.rpm + yum -y install postgresql94-server + service postgresql-9.4 initdb + chkconfig postgresql-9.4 on + service postgresql-9.4 start + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Configurar o postgres 9.4! + +CONF_PG=0 +EZ_I_SKIP_ON_V=0 +f_open_section +TITLE_F="Configure postgres 9.4 (use \"y\" if you never did it)?" +f_yes_no "$TITLE_F" +TITLE_F="" +PG_USER_F="lbu" +PG_PWD_F="lbu" +PG_EXT_ACS_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + + EZ_I_SKIP_ON_V=$SIMPLE_INST + + f_div_section + + QUESTION_F="Enter the postgres 9.4 user for lightbase (LBG). +Use empty for \"$PG_USER_F\"!" + + f_get_usr_input "$QUESTION_F" 1 + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + PG_USER_F=$GET_USR_INPUT_R + fi + + f_div_section + + QUESTION_F="Enter the postgres 9.4 password for \"$PG_USER_F\". +Use empty for \"$PG_PWD_F\"!" + + f_get_usr_input "$QUESTION_F" 1 + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + PG_PWD_F=$GET_USR_INPUT_R + fi + + f_div_section + + QUESTION_F="Enter one ip or ip range for external access. +e.g. \"172.20.143.89/32\" for a single host or \"172.20.143.0/24\" for a small network or \"10.6.0.0/16\" for a larger one! +Use empty for local access only!" + + f_get_usr_input "$QUESTION_F" 1 + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + PG_EXT_ACS_F=$GET_USR_INPUT_R + fi + EZ_I_SKIP_ON_V=0 + + f_is_not_running "postgres" "ERROR! \"postgres\" service not running!" + if [ ${F_IS_NOT_RUNNING_R} -eq 0 ] ; then + cd /tmp + f_get_stderr_stdout "sudo -u postgres psql -tAc \"SELECT * FROM pg_roles WHERE rolname='$PG_USER_F';\"" + if [[ $F_GET_STDOUT_R == *"$PG_USER_F|"* ]]; then + # NOTE: + # rolname| + # rolsuper| + # rolinherit| + # rolcreaterole| + # rolcreatedb| + # rolcatupdate| + # rolcanlogin| + # rolconnlimit| + # rolpassword| + # rolvaliduntil| + # rolconfig| + # oid + # ! By Questor + if [[ $F_GET_STDOUT_R != *"$PG_USER_F|t|t|t|t|t|t|f|-1|"* ]]; then + f_div_section + echo "The user \"$PG_USER_F\" already created, but something is apparently wrong with his roles. The expected roles are \"lbu|f|t|t|t|t|t|f|-1|...\"! DETAILS: \"$F_GET_STDOUT_R\"." + f_div_section + f_continue + else + EZ_I_SKIP_ON_V=$SIMPLE_INST + f_enter_to_cont "The user \"$PG_USER_F\" already created and his roles are correct!" + EZ_I_SKIP_ON_V=0 + fi + else + if [[ $F_GET_STDERR_R == "" ]]; then + sudo -u postgres psql -c "CREATE USER $PG_USER_F INHERIT SUPERUSER CREATEROLE CREATEDB;" + sudo -u postgres psql -c "ALTER USER $PG_USER_F PASSWORD '$PG_PWD_F';" + else + f_enter_to_cont "An error occurred when creating \"$PG_USER_F\" user permissions! ERROR: \"$F_GET_STDERR_R\"." + f_error_exit + fi + fi + cd - >/dev/null + else + f_error_exit + fi + + EZ_I_SKIP_ON_V=$SIMPLE_INST + if [ -n "$PG_EXT_ACS_F" ] ; then + f_fl_cont_str "host all all $PG_EXT_ACS_F trust" "/var/lib/pgsql/9.4/data/pg_hba.conf" "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" probably has already been changed for external access! Check it!" + if [ ${FL_CONT_STR_R} -eq 0 ] ; then + f_ez_sed "# IPv4 local connections:" "# IPv4 local connections:\nhost all all $PG_EXT_ACS_F trust" "/var/lib/pgsql/9.4/data/pg_hba.conf" + fi + fi + + f_fl_cont_str "host all all 127.0.0.1/32 trust" "/var/lib/pgsql/9.4/data/pg_hba.conf" "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" probably has already been changed for local access! Check it!" + if [ ${FL_CONT_STR_R} -eq 0 ] ; then + f_ez_sed "# IPv4 local connections:" "# IPv4 local connections:\nhost all all 127.0.0.1/32 trust" "/var/lib/pgsql/9.4/data/pg_hba.conf" + fi + + f_fl_cont_str "listen_addresses = '*'" "/var/lib/pgsql/9.4/data/postgresql.conf" "The file \"/var/lib/pgsql/9.4/data/postgresql.conf\" probably has already been changed! Check it!" + if [ ${FL_CONT_STR_R} -eq 0 ] ; then + f_ez_sed "# - Connection Settings -" "# - Connection Settings -\n\nlisten_addresses = '*'" "/var/lib/pgsql/9.4/data/postgresql.conf" + fi + + service postgresql-9.4 restart + f_enter_to_cont "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" has settings for postgres 9.4! Check it for more details!" + EZ_I_SKIP_ON_V=0 + CONF_PG=1 +else + f_enter_to_cont "The file \"/var/lib/pgsql/9.4/data/pg_hba.conf\" has settings for postgres 9.4! Check it!" +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Abrir o firewall para o postgres 9.4! + +EZ_I_SKIP_ON_V=0 +f_open_section +read -d '' TITLE_F <<"EOF" +Open firewall for postgres 9.4 (TCP 5432)? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${YES_NO_R} -eq 1 ] ; then + f_chk_iptables 5432 "Port 5432 is already open!" 0 "ACCEPT" "tcp" + if [ ${F_CHK_IPTABLES_R} -eq 1 ] ; then + iptables -I INPUT 1 -m tcp -p tcp --dport 5432 -j ACCEPT + service iptables save + service iptables restart + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Criar as estruturas de dados básicas do LB no postgres 9.4! + +CREATE_LB_DT=0 +EZ_I_SKIP_ON_V=0 +f_open_section +TITLE_F="Create the basic LightBase (LBG) data structures in postgres 9.4 (use \"y\" if you never did it)?" +f_yes_no "$TITLE_F" +TITLE_F="" +PG_DB_F="lb" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + + EZ_I_SKIP_ON_V=$SIMPLE_INST + QUESTION_F="Enter the postgres 9.4 database name for LightBase (LBG). +Use empty for \"$PG_DB_F\" (recommended)!" + + f_get_usr_input "$QUESTION_F" 1 + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + PG_DB_F=$GET_USR_INPUT_R + fi + EZ_I_SKIP_ON_V=0 + f_is_not_running "postgres" "ERROR! \"postgres\" service not running!" + if [ ${F_IS_NOT_RUNNING_R} -eq 0 ] ; then + cd /tmp + f_get_stderr_stdout "sudo -u postgres psql -c \"CREATE DATABASE $PG_DB_F;\"" + if [[ $F_GET_STDERR_R != "" ]]; then + if [[ $F_GET_STDERR_R == *" already exists"* ]]; then + EZ_I_SKIP_ON_V=$SIMPLE_INST + f_enter_to_cont "The database \"$PG_DB_F\" already created!" + EZ_I_SKIP_ON_V=0 + else + f_div_section + echo "An error occurred when creating \"$PG_DB_F\" database! ERROR: \"$F_GET_STDERR_R\"." + f_div_section + f_error_exit + fi + else + cd "$SCRIPTDIR_V" + cp ./lbn-basic-dt-strt/lbn_basic_dt_strt.sql /tmp + cd /tmp + chmod 700 lbn_basic_dt_strt.sql + chown postgres lbn_basic_dt_strt.sql + chown :postgres lbn_basic_dt_strt.sql + sudo -u postgres psql $PG_DB_F -f lbn_basic_dt_strt.sql + rm -f lbn_basic_dt_strt.sql + fi + else + f_error_exit + fi + CREATE_LB_DT=1 +else + f_enter_to_cont "The file \"./lbn-basic-dt-strt/lbn_basic_dt_strt.sql\" has the basic LightBase (LBG) data structures! Check it!" +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar as dependências python da LIB - liblightbase! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +cd "$SCRIPTDIR_V" +sh py-packs-liblightbase.sh "$EZ_I_SKIP_ON_V" "$BASE_INST_DIR_V" + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar a LIB - liblightbase! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +f_open_section +read -d '' TITLE_F <<"EOF" +Install the LIB - liblightbase? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + f_chk_by_path_hlp "$BASE_INST_DIR_V/ve32/src/liblightbase" "d" "\"liblightbase\" already installed in \"$BASE_INST_DIR_V/ve32/src\"!" + F_BAK_MD_R=1 + if [ ${F_CHK_BY_PATH_HLP_R} -eq 1 ] ; then + f_ez_mv_bak "$BASE_INST_DIR_V/ve32/src/liblightbase" "Backup old version and update? (\"y\" recommended)" + fi + if [ ${F_BAK_MD_R} -eq 1 ] ; then + cd "$SCRIPTDIR_V" + tar -zxvf liblightbase.tar.gz + mv "$SCRIPTDIR_V/liblightbase" "$BASE_INST_DIR_V/ve32/src/" + cd "$BASE_INST_DIR_V/ve32/src/liblightbase" + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + fi +fi +f_close_section + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar e configurar o LBG - LBGenerator! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +cd "$SCRIPTDIR_V" +sh py-packs-LBGenerator.sh "$EZ_I_SKIP_ON_V" "$BASE_INST_DIR_V" + +# < ----------------------------------------- + +# > ----------------------------------------- +# Instalar o LBG - LBGenerator! + +EZ_I_SKIP_ON_V=$SIMPLE_INST +APP_URL_F="lbg" +f_open_section +read -d '' TITLE_F <<"EOF" +Install the LBG - LBGenerator? +EOF + +f_yes_no "$TITLE_F" +TITLE_F="" +if [ ${EZ_I_SKIP_ON_V} -eq 1 ] || [ ${YES_NO_R} -eq 1 ] ; then + + f_chk_by_path_hlp "$BASE_INST_DIR_V/ve32/src/LBGenerator" "d" "\"LBGenerator\" already installed in \"$BASE_INST_DIR_V/ve32/src\"!" + F_BAK_MD_R=1 + if [ ${F_CHK_BY_PATH_HLP_R} -eq 1 ] ; then + f_ez_mv_bak "$BASE_INST_DIR_V/ve32/src/LBGenerator" "Backup old version and update? (\"y\" recommended)" + fi + if [ ${F_BAK_MD_R} -eq 1 ] ; then + cd "$SCRIPTDIR_V" + tar -zxvf LBGenerator.tar.gz + mv "$SCRIPTDIR_V/LBGenerator" "$BASE_INST_DIR_V/ve32/src/" + cd "$BASE_INST_DIR_V/ve32/src/LBGenerator" + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + + f_enter_to_cont "Configure httpd (Apache) for LBG - LBGenerator!" + + # NOTE: To debug! By Questor + # PG_USER_F="lbu" + # PG_PWD_F="lbu" + # PG_DB_F="lb" + PG_CFG_F="postgresql://$PG_USER_F:$PG_PWD_F@127.0.0.1/$PG_DB_F" + QUESTION_F="Enter the postgres 9.4 LBG configuration. +Use empty for \"$PG_CFG_F\"!" + + f_div_section + f_get_usr_input "$QUESTION_F" 1 + f_div_section + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + PG_CFG_F=$GET_USR_INPUT_R + fi + + QUESTION_F="Enter lightbase URL. +Use empty for \"$APP_URL_F\" (used like e.g. http:///$APP_URL_F)!" + f_div_section + f_get_usr_input "$QUESTION_F" 1 + f_div_section + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + APP_URL_F=$GET_USR_INPUT_R + fi + + eval "cp -f \"$BASE_INST_DIR_V/ve32/src/LBGenerator/lbgenerator.wsgi-dist\" \"$BASE_INST_DIR_V/ve32/src/LBGenerator/lbgenerator.wsgi\"" + f_ez_sed "" "$BASE_INST_DIR_V/ve32" "$BASE_INST_DIR_V/ve32/src/LBGenerator/lbgenerator.wsgi" + + eval "cp -f \"$BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini-dist\" \"$BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini\"" + f_ez_sed "" "$PG_CFG_F" "$BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini" 1 + + f_chk_by_path_hlp "/etc/httpd/conf.d/lbg.conf" "f" "\"lbg.conf\" already created in \"/etc/httpd/conf.d/lbg.conf\"!" + F_BAK_MD_R=1 + if [ ${F_CHK_BY_PATH_HLP_R} -eq 1 ] ; then + f_ez_mv_bak "/etc/httpd/conf.d/lbg.conf" "Backup old version and update? (\"y\" recommended)" + fi + + if [ ${F_BAK_MD_R} -eq 1 ] ; then + eval "cp -f \"$SCRIPTDIR_V/other-srcs-n-apps/lbg.conf.dist\" \"/etc/httpd/conf.d/lbg.conf\"" + f_ez_sed "" "$BASE_INST_DIR_V/ve32" "/etc/httpd/conf.d/lbg.conf" 1 + f_ez_sed "" "$APP_URL_F" "/etc/httpd/conf.d/lbg.conf" 1 + fi + + eval "chown -R apache $BASE_INST_DIR_V" + eval "chmod -R 755 $BASE_INST_DIR_V" + + service httpd restart + fi +fi +f_close_section + +# < ----------------------------------------- + +# > -------------------------------------------------------------------------- +# FINAL! +# -------------------------------------- + +EZ_I_SKIP_ON_V=0 +read -d '' TITLE_F <<"EOF" +Installer finished! Thanks! +EOF + +# NOTE: A lógica imediatamente abaixo serve para os casos onde o +# usuário optou por instalação simplificada para que ele seja informado +# sobre quais foram as configurações de persistência setadas! By Questor +PERSIST_CONFIG="" +if [ ${SIMPLE_INST} -eq 1 ] && ([ ${CONF_PG} -eq 1 ] || [ ${CREATE_LB_DT} -eq 1 ]); then + + if [ ${CONF_PG} -eq 1 ] ; then + CONF_PG_VL=" + user ...... $PG_USER_F + password .. $PG_PWD_F" + fi + if [ ${CREATE_LB_DT} -eq 1 ] ; then + CREATE_LB_DT_VL=" + database .... $PG_DB_F" + fi + + PERSIST_CONFIG=" + LightBase (LBG) postgres 9.4 persistence config...$CREATE_LB_DT_VL$CONF_PG_VL +" +fi + +USEFUL_INFO_F=" To start/stop... + service httpd start + service httpd stop +$PERSIST_CONFIG + To access... + http:///$APP_URL_F + + To configure... + vi $BASE_INST_DIR_V/ve32/src/LBGenerator/production.ini + + To configure httpd (Apache)... + vi /etc/httpd/conf.d/lbg.conf + + Log... + less /var/log/httpd/error_log" + +f_end "$TITLE_F" "$USEFUL_INFO_F" +TITLE_F="" +USEFUL_INFO_F="" + +# < -------------------------------------------------------------------------- diff --git a/lbn-basic-dt-strt/lbn_basic_dt_strt.sql b/lbn-basic-dt-strt/lbn_basic_dt_strt.sql new file mode 100755 index 0000000..d039601 --- /dev/null +++ b/lbn-basic-dt-strt/lbn_basic_dt_strt.sql @@ -0,0 +1,393 @@ +/* --------------------------------------------------- */ +/* TABELAS DA INFRAESTRTURA BÁSICA DO LB */ +/* ------------------------ */ + +/* ----------------------------------- */ +/* lb_base */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_base +( + id_base serial NOT NULL, + name character varying NOT NULL, + struct character varying NOT NULL, + dt_base timestamp without time zone NOT NULL, + idx_exp boolean NOT NULL, + idx_exp_url character varying, + idx_exp_time integer, + file_ext boolean NOT NULL, + file_ext_time integer, + txt_mapping character varying, + CONSTRAINT lb_base_pkey PRIMARY KEY (id_base), + CONSTRAINT lb_base_name_key UNIQUE (name) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_base + OWNER TO postgres; + +/* ------ */ + +INSERT INTO public.lb_base (name,struct,dt_base,idx_exp,idx_exp_url,idx_exp_time,file_ext,file_ext_time) VALUES ( +'_app_config','{"content": [{"field": {"name": "nm_aplicacao", "datatype": "Text", "required": false, "alias": "Aplicação", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Define o nome da aplicação"}}, {"field": {"name": "nm_apelido", "datatype": "Text", "required": false, "alias": "nm_apelido", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Apelido da aplicação. Campo usado para identificar à qual aplicação o config pertence ou de qual aplicação. Oriundo da tabela Aplicação nm_apelido."}}, {"group": {"content": [{"field": {"name": "manual", "datatype": "File", "required": false, "alias": "manual", "multivalued": false, "indices": ["Textual"], "description": "Manuais"}}, {"field": {"name": "ch_manual", "datatype": "Text", "required": true, "alias": "Chave do manual", "multivalued": false, "indices": ["Textual"], "description": "Chave para tornar única a identificação de cada manual."}}, {"field": {"name": "nm_manual", "datatype": "Text", "required": true, "alias": "Nome do manual", "multivalued": false, "indices": ["Textual"], "description": "Nome do manual"}}, {"field": {"name": "color", "datatype": "Text", "required": false, "alias": "Cor", "multivalued": false, "indices": ["Textual"], "description": "Cor na qual aparece para download"}}, {"group": {"content": [{"field": {"name": "nr_cpf_user_alteracao", "datatype": "Text", "required": false, "alias": "Número do CPF do usuário da alteração", "multivalued": false, "indices": ["Textual"], "description": "Número do CPF do usuário da ultima alteração. Campo usado para informar o cpf do usuário que fez a ultima alteração."}}, {"field": {"name": "dt_alteracao", "datatype": "DateTime", "required": false, "alias": "Data e hora da alteração", "multivalued": false, "indices": ["Textual"], "description": "Data e Hora no formato DD/MM/AAAA - HH:MM:SS . Campo usado para informar a data e hora da alteração."}}, {"field": {"name": "nm_user_alteracao", "datatype": "Text", "required": false, "alias": "Nome do usuário da alteração", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Nome do usuário da alteração. Campo usado para informar o nome do usuário que fez a alteração."}}], "metadata": {"multivalued": true, "alias": "Alteração", "name": "alteracao", "description": "Alteração"}}}, {"group": {"content": [{"field": {"name": "nr_cpf_user_inclusao", "datatype": "Text", "required": false, "alias": "Número do CPF do usuário que incluiu.", "multivalued": false, "indices": ["Textual"], "description": "Número do CPF do usuário que incluiu. Campo usado para informar o cpf do usuário que fez a inclusão do registro."}}, {"field": {"name": "dt_inclusao", "datatype": "Text", "required": false, "alias": "Data e Hora da inclusão", "multivalued": false, "indices": ["Textual"], "description": "Data e Hora no formato DD/MM/AAAA - HH:MM:SS de inclusão do usuário no Cadastro. Campo usado para informar a data que o usuário foi incluído."}}, {"field": {"name": "nm_user_inclusao", "datatype": "Text", "required": false, "alias": "Nome do usuário que incluiu", "multivalued": false, "indices": ["Textual"], "description": "Nome do usuário que incluiu. Campo usado para informar o nome do usuário que realizou a inclusão do usuário."}}], "metadata": {"multivalued": false, "alias": "Inclusão", "name": "inclusao", "description": "Inclusão"}}}], "metadata": {"multivalued": true, "alias": "Manuais", "name": "manuais", "description": "Manuais"}}}], "metadata": {"idx_exp": false, "description": "Configurações da aplicação", "color": "#000000", "file_ext_time": 0, "dt_base": "01/01/2015 00:00:00", "idx_exp_url": "", "file_ext": false, "password": "12345678", "id_base": ID_BASE_PLACEHOLDER, "name": "_app_config", "idx_exp_time": 0, "model": {"manuais": [{"inclusao": {"dt_inclusao": "Text", "nr_cpf_user_inclusao": "Text", "nm_user_inclusao": "Text"}, "color": "Text", "manual": "File", "ch_manual": "Text", "nm_manual": "Text", "alteracao": [{"dt_alteracao": "DateTime", "nm_user_alteracao": "Text", "nr_cpf_user_alteracao": "Text"}]}], "nm_aplicacao": "Text", "nm_apelido": "Text"}}}',TO_DATE('2015-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),false,'',0,false,0); + +UPDATE lb_base SET struct = replace(struct, 'ID_BASE_PLACEHOLDER', cast(id_base as text)) WHERE name='_app_config'; + +/* ------ */ + +INSERT INTO public.lb_base (name,struct,dt_base,idx_exp,idx_exp_url,idx_exp_time,file_ext,file_ext_time) VALUES ( +'_history','{"content": [{"field": {"alias": "id_base", "description": "Base old ID.", "name": "id_base", "datatype": "Integer", "indices": ["Textual"], "required": true, "multivalued": false}}, {"field": {"alias": "author", "description": "Event Author.", "name": "author", "datatype": "Text", "indices": ["Textual"], "required": true, "multivalued": false}}, {"field": {"alias": "date", "description": "Event Date.", "name": "date", "datatype": "DateTime", "indices": ["Textual"], "required": true, "multivalued": false}}, {"field": {"alias": "name", "description": "Base old name.", "name": "name", "datatype": "Text", "indices": ["Textual"], "required": true, "multivalued": false}}, {"field": {"alias": "structure", "description": "Base old structure", "name": "structure", "datatype": "Json", "indices": ["Textual"], "required": true, "multivalued": false}}, {"field": {"alias": "status", "description": "Base status", "name": "status", "datatype": "Text", "indices": ["Textual"], "required": true, "multivalued": false}}], "metadata": {"idx_exp": false, "description": "LightBase - History Meta Base.", "color": "#000000", "file_ext_time": 10, "idx_exp_time": 0, "idx_exp_url": "", "model": {"status": "Text", "name": "Text", "author": "Text", "id_base": "Integer", "date": "DateTime", "structure": "Json"}, "password": "password", "dt_base": "01/01/2015 00:00:00", "file_ext": false, "id_base": ID_BASE_PLACEHOLDER, "name": "_history"}}',TO_DATE('2015-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),false,'',0,false,10); + +UPDATE lb_base SET struct = replace(struct, 'ID_BASE_PLACEHOLDER', cast(id_base as text)) WHERE name='_history'; + +/* ------ */ + +INSERT INTO public.lb_base (name,struct,dt_base,idx_exp,idx_exp_url,idx_exp_time,file_ext,file_ext_time) VALUES ( +'_portal','{"content": [{"field": {"name": "nm_portal", "datatype": "Text", "required": true, "alias": "Nome do Portal", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Contm o nome do portal. Usado para diferenciar os portais."}}, {"field": {"name": "alias_portal", "datatype": "Text", "required": true, "alias": "Apelido do Portal", "multivalued": false, "indices": ["Textual"], "description": "Este campo informa um apelido, possibilitando exibir um nome amigvel."}}, {"field": {"name": "ds_portal", "datatype": "Text", "required": true, "alias": "Descriço", "multivalued": false, "indices": ["Textual"], "description": "Contm um texto falando sobre o portal. Qual a finalidade do portal criado."}}, {"field": {"name": "cpf_user", "datatype": "Text", "required": false, "alias": "CPF do Usurio", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Indica o cpf do usurio que criou o portal. Auxilia a listar os portais de cada usurio"}}, {"group": {"content": [{"field": {"name": "nm_base", "datatype": "Text", "required": true, "alias": "Nome da Base", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome da base, deve ser o mesmo nome com o qual a base est salva no lightbase. Ser usado para auxiliar nas pesquisas feitas pelo portal."}}, {"field": {"name": "ds_base", "datatype": "Text", "required": true, "alias": "Apelido da Base", "multivalued": false, "indices": ["Textual"], "description": "Este campo informa um apelido, possibilitando exibir um nome amigvel no Portal de Pesquisas."}}, {"field": {"name": "url_index", "datatype": "Url", "required": false, "alias": "Url do Indexador", "multivalued": false, "indices": ["Textual"], "description": "Uma URL que indica o host onde ser feita a pesquisa via REST. Pode ser, por exemplo, a URL de um host com o ELastic Search instalado e com os dados indexados."}}, {"field": {"name": "url_detail", "datatype": "Url", "required": false, "alias": "URL de Detalhe", "multivalued": false, "indices": ["Textual"], "description": "Representa a URL da pgina de detalhes. O valor oriundo da aplicaço em questo, ou seja, de acordo a aplicaço referenciada o nome da pgina pode ser DetalhesRecebidos.aspx ou DetalhesExpedido.aspx"}}, {"field": {"name": "url_app", "datatype": "Url", "required": false, "alias": "Url da aplicaço", "multivalued": false, "indices": ["Textual"], "description": "Este campo usado para possibilitar links entre o portal e a aplicaço que utiliza esta base, como, por exemplo, abrir os detalhes de um registro pesquisado para abrir na pgina da aplicaço."}}, {"field": {"name": "nr_order", "datatype": "Integer", "required": false, "alias": "Ordem", "multivalued": false, "indices": ["Textual"], "description": "Auxilia a ordenar as abas no portal de pesquisa."}}, {"group": {"content": [{"group": {"content": [{"field": {"name": "nm_display_direct", "datatype": "Text", "required": false, "alias": "Nome exibido", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome com o qual o campo deve ser exibido na tela de pesquisa direta."}}, {"field": {"name": "in_display_direct", "datatype": "Boolean", "required": false, "alias": "Exibir?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag informando se o campo deve ser exibido na tela de pesquisa direta."}}, {"field": {"name": "nm_type_control_direct", "datatype": "Text", "required": false, "alias": "Tipo de controle", "multivalued": false, "indices": ["Textual"], "description": "Define o controle que deve ser carregado para o campo na tela de pesquisa direta."}}, {"field": {"name": "nr_position_direct", "datatype": "Integer", "required": false, "alias": "Posiço", "multivalued": false, "indices": ["Textual"], "description": "Contm um inteiro informando a posiço do campo na tela de pesquisa direta."}}, {"field": {"name": "script_direct", "datatype": "TextArea", "required": false, "alias": "script", "multivalued": false, "indices": ["Textual"], "description": "Contm um script que ser executado no momento que o campo for exibido na tela de pesquisa direta."}}], "metadata": {"multivalued": false, "alias": "Informaçes busca direta", "name": "inf_direct_search", "description": "Contm informaçes de como o campo se comporta na tela de busca direta."}}}, {"group": {"content": [{"field": {"name": "nm_display_advanced", "datatype": "Text", "required": false, "alias": "Nome exibido", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome com o qual o campo deve ser exibido na tela de pesquisa avançada."}}, {"field": {"name": "in_display_advanced", "datatype": "Boolean", "required": false, "alias": "Exibir?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag informando se o campo deve ser exibido na tela de pesquisa avançada."}}, {"field": {"name": "in_fixed_advanced", "datatype": "Boolean", "required": false, "alias": "Campo fixo?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag informando se o campo fixo na tela de pesquisa avançada. Nesta tela os campo so escolhidos dinamicamente e inseridos como argumento de pesquisa, mas se o campo for fixo ela j fica fixado na tela."}}, {"field": {"name": "nm_type_control_advanced", "datatype": "Text", "required": false, "alias": "Tipo de Controle", "multivalued": false, "indices": ["Textual"], "description": "Define o controle que deve ser carregado na pesquisa avançada para exibir este campo."}}, {"field": {"name": "script_advanced", "datatype": "TextArea", "required": false, "alias": "script", "multivalued": false, "indices": ["Textual"], "description": "Contm um script para ser executado na pgina nome momento em que o campo exibido."}}], "metadata": {"multivalued": false, "alias": "Informaçes pesquisa avançada", "name": "inf_advanced_search", "description": "Contm informaçes que definem como o campo se comporta na tela de pesquisa avançada."}}}, {"group": {"content": [{"field": {"name": "nm_display_listed", "datatype": "Text", "required": false, "alias": "Nome exibido", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome que deve exibido na coluna da tabela resultado de pesquisa."}}, {"field": {"name": "in_select_listed", "datatype": "Boolean", "required": false, "alias": "Recuperar?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag informando se o campo deve ser selecionado no resultado de pesquisa, ou seja, recuperado nas consultas."}}, {"field": {"name": "in_display_listed", "datatype": "Boolean", "required": false, "alias": "Exibir?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag informando se o campo deve ser exibido no resultado de pesquisa"}}, {"field": {"name": "in_search_listed", "datatype": "Boolean", "required": false, "alias": "Pesquisar?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag informando se o campo usado na pesquisa. Essa informaço relevante para a pesquisa direta, que realiza a busca nos campos que contm essa flag marcada com true."}}, {"field": {"name": "nr_position_listed", "datatype": "Integer", "required": false, "alias": "Posiço", "multivalued": false, "indices": ["Textual"], "description": "Defina a posiço da coluna na tabela de resultado de pesquisa."}}, {"field": {"name": "script_listed", "datatype": "TextArea", "required": false, "alias": "script", "multivalued": false, "indices": ["Textual"], "description": "Contm um script que ser executado na exibiço do campo na tabela de resultado de pesquisa. til para criar botes, links, etc."}}, {"field": {"name": "in_sortable_listed", "datatype": "Boolean", "required": false, "alias": "Ordenar?", "multivalued": false, "indices": ["Textual"], "description": "Indica se a coluna ordenvel na tabela do resultado de pesquisa."}}], "metadata": {"multivalued": false, "alias": "Informaçes resultado de pesquisa", "name": "inf_listed_search", "description": "Contm as informaçes do campo de como se comportar na pesquisa listada."}}}, {"group": {"content": [{"field": {"name": "nm_display_detailed", "datatype": "Text", "required": false, "alias": "Nome exibido", "multivalued": false, "indices": ["Textual"], "description": "contm o nome com o qual o campo deve ser exibido na tela de detalhes."}}, {"field": {"name": "in_display_detailed", "datatype": "Boolean", "required": false, "alias": "Exibir?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag dizendo se o campo exibido ou no tela de detalhes."}}, {"field": {"name": "in_search_detailed", "datatype": "Boolean", "required": false, "alias": "Pesquisar?", "multivalued": false, "indices": ["Textual"], "description": "Contm uma flag informando se o campo pesquisado para chamar a pgina de detalhes."}}, {"field": {"name": "nr_position_detailed", "datatype": "Integer", "required": false, "alias": "Posiço", "multivalued": false, "indices": ["Textual"], "description": "Contm um inteiro informando a posiço do campo na tela de detalhes."}}, {"field": {"name": "script_detailed", "datatype": "TextArea", "required": false, "alias": "Script", "multivalued": false, "indices": ["Textual"], "description": "Contm um script que deve ser executado na exibiço do campo na pgina de detalhes. Por exemplo, criar um link dentro campo."}}], "metadata": {"multivalued": false, "alias": "Informaçes da tela de detalhes", "name": "inf_detailed_search", "description": "Contm as informaçes de como o campo se comporta na tela de detalhes. Caso esta tela seja tratada no portal, pois ela pode ser de outra aplicaço e neste caso usasse o campo url_detail."}}}, {"group": {"content": [{"field": {"name": "data_tabulated", "datatype": "Json", "required": false, "alias": "Lista de dados", "multivalued": false, "indices": ["Textual"], "description": "Contm uma lista de objetos json. Serve para criar uma tabela esttica com os campo tabelados. Por exemplo, uma tabela de siglas e nomes de estados."}}, {"field": {"name": "nm_field_value_tabulated", "datatype": "Text", "required": false, "alias": "Nome do campo valor", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome do campo da base referenciada que contm o valor."}}, {"field": {"name": "nm_field_key_tabulated", "datatype": "Text", "required": false, "alias": "Nome Campo Chave", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome do campo da base referenciada que contm a chave do valor."}}, {"field": {"name": "relational_key_tabulated", "datatype": "Text", "required": false, "alias": "Chave relacional", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome da coluna que contm a chave da relaço. o campo referenciado na base."}}, {"field": {"name": "nm_table_tabulated", "datatype": "Text", "required": false, "alias": "Nome da tabela referenciada", "multivalued": false, "indices": ["Textual"], "description": "Contm o nome da tabela que est sendo usada para tabelar o campo."}}], "metadata": {"multivalued": false, "alias": "Informaçes Campo Tabelado", "name": "inf_field_tabulated", "description": "Define as informaçes de campos tabelados. S precisa ser preenchido se o tipo de campo for igual a tabulated."}}}, {"field": {"name": "groups_can_view", "datatype": "Text", "required": false, "alias": "Grupos", "multivalued": true, "indices": ["Textual"], "description": "Define os grupos que podem visualizar o campo."}}, {"field": {"name": "ds_field", "datatype": "Text", "required": false, "alias": "Apelido do campo", "multivalued": false, "indices": ["Textual"], "description": "Define o apelido do campo. um nome mais amigvel para ser exibido no portal."}}, {"field": {"name": "nm_field", "datatype": "Text", "required": true, "alias": "Nome do campo", "multivalued": false, "indices": ["Textual"], "description": "Nome do campo da base. Deve coincidir com o nome do campo que est salvo no lightbase."}}, {"field": {"name": "nm_type_field", "datatype": "Text", "required": true, "alias": "Tipo de campo", "multivalued": false, "indices": ["Textual"], "description": "Indica qual o tipo de campo. utilizado pelo portal para saber como exibir o campo. oriundo dos tipos de campo que o lightbase usa para criar campos."}}], "metadata": {"multivalued": true, "alias": "Campo", "name": "field", "description": "Representa os campos da base. Informa onde e como sero usados pelo portal."}}}], "metadata": {"multivalued": true, "alias": "Bases do Portal", "name": "bases", "description": "Contm as Bases do portal."}}}], "metadata": {"idx_exp": false, "description": "Novo conceito do portal. Uma base _portal lista todos os portais separados por nome e com o id do usu-ario que criou.", "color": "", "file_ext_time": 0, "dt_base": "01/01/2015 00:00:00", "idx_exp_url": "", "file_ext": false, "password": "BRLight@)!$", "id_base": ID_BASE_PLACEHOLDER, "name": "_portal", "idx_exp_time": 0, "model": {"alias_portal": "Text", "cpf_user": "Text", "bases": [{"url_index": "Url", "nm_base": "Text", "field": [{"inf_advanced_search": {"in_fixed_advanced": "Boolean", "in_display_advanced": "Boolean", "nm_type_control_advanced": "Text", "nm_display_advanced": "Text", "script_advanced": "TextArea"}, "inf_listed_search": {"in_search_listed": "Boolean", "nm_display_listed": "Text", "in_select_listed": "Boolean", "in_sortable_listed": "Boolean", "nr_position_listed": "Integer", "script_listed": "TextArea", "in_display_listed": "Boolean"}, "inf_field_tabulated": {"nm_table_tabulated": "Text", "nm_field_key_tabulated": "Text", "relational_key_tabulated": "Text", "data_tabulated": "Json", "nm_field_value_tabulated": "Text"}, "inf_direct_search": {"nr_position_direct": "Integer", "nm_display_direct": "Text", "script_direct": "TextArea", "nm_type_control_direct": "Text", "in_display_direct": "Boolean"}, "groups_can_view": ["Text"], "ds_field": "Text", "nm_type_field": "Text", "nm_field": "Text", "inf_detailed_search": {"nm_display_detailed": "Text", "in_search_detailed": "Boolean", "in_display_detailed": "Boolean", "script_detailed": "TextArea", "nr_position_detailed": "Integer"}}], "url_detail": "Url", "url_app": "Url", "nr_order": "Integer", "ds_base": "Text"}], "nm_portal": "Text", "ds_portal": "Text"}}}',TO_DATE('2015-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),false,'',0,false,0); + +UPDATE lb_base SET struct = replace(struct, 'ID_BASE_PLACEHOLDER', cast(id_base as text)) WHERE name='_portal'; + +/* ------ */ + +INSERT INTO public.lb_base (name,struct,dt_base,idx_exp,idx_exp_url,idx_exp_time,file_ext,file_ext_time) VALUES ( +'_user','{"content": [{"field": {"alias": "id", "description": "LightBase''s uses ID", "name": "id_user", "datatype": "Integer", "indices": ["Textual", "Ordenado"], "required": true, "multivalued": false}}, {"field": {"alias": "name", "description": "User''s name", "name": "name_user", "datatype": "Text", "indices": ["Textual", "Ordenado"], "required": true, "multivalued": false}}, {"field": {"alias": "email", "description": "User''s mail", "name": "email_user", "datatype": "Text", "indices": ["Textual", "Ordenado"], "required": true, "multivalued": false}}, {"field": {"alias": "passwd", "description": "User''s password", "name": "passwd_user", "datatype": "Text", "indices": ["Textual", "Ordenado"], "required": true, "multivalued": false}}, {"group": {"content": [{"field": {"alias": "name_base", "description": "Name of the base the user can access", "name": "name_base", "datatype": "Text", "indices": ["Textual", "Ordenado", "Fuzzy"], "required": false, "multivalued": false}}, {"field": {"alias": "access_type", "description": "Type of access the user has", "name": "access_type", "datatype": "Text", "indices": ["Textual", "Ordenado"], "required": false, "multivalued": false}}], "metadata": {"alias": "bases", "description": "List of bases that the user can access and what kind of access it is", "multivalued": true, "name": "bases_user"}}}, {"field": {"alias": "creation_date", "description": "Date the user account was created", "name": "creation_date_user", "datatype": "Date", "indices": ["Textual", "Ordenado"], "required": true, "multivalued": false}}, {"field": {"alias": "status", "description": "Check if the user is activer or not", "name": "status_user", "datatype": "Boolean", "indices": ["Textual", "Ordenado"], "required": true, "multivalued": false}}], "metadata": {"idx_exp": false, "description": "LightBase''s Users Meta Base.", "color": "#000000", "file_ext_time": 0, "idx_exp_time": 0, "idx_exp_url": "", "model": {"name_user": "Text", "status_user": "Boolean", "bases_user": [{"name_base": "Text", "access_type": "Text"}], "id_user": "Integer", "creation_date_user": "Date", "email_user": "Text", "passwd_user": "Text"}, "password": "3Ax!vj6gV#DEtR", "dt_base": "01/01/2015 00:00:00", "file_ext": false, "id_base": ID_BASE_PLACEHOLDER, "name": "_user"}}',TO_DATE('2015-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),false,'',0,false,0); + +UPDATE lb_base SET struct = replace(struct, 'ID_BASE_PLACEHOLDER', cast(id_base as text)) WHERE name='_user'; + +/* ------ */ + +INSERT INTO public.lb_base (name,struct,dt_base,idx_exp,idx_exp_url,idx_exp_time,file_ext,file_ext_time) VALUES ( +'log_lbconverter','{"content": [{"field": {"name": "nm_base", "datatype": "Text", "required": true, "alias": "Nome da base", "multivalued": false, "indices": ["Ordenado"], "description": "Nome da base"}}, {"field": {"name": "id_doc_orig", "datatype": "Integer", "required": true, "alias": "id_doc_orig", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "id do documento que originou o erro."}}, {"field": {"name": "id_file_orig", "datatype": "Text", "required": true, "alias": "id_file_orig", "multivalued": false, "indices": ["Textual", "Unico"], "description": "ID do arquivo que originou o erro."}}, {"field": {"name": "file_name", "datatype": "Text", "required": true, "alias": "file_name", "multivalued": false, "indices": ["Ordenado"], "description": "File name"}}, {"field": {"name": "error_msg", "datatype": "Text", "required": true, "alias": "Mensagem de erro", "multivalued": false, "indices": ["Nenhum"], "description": "Mensagem de erro"}}, {"field": {"name": "dt_error", "datatype": "DateTime", "required": true, "alias": "Data do erro", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Data do erro"}}], "metadata": {"idx_exp": false, "description": "LightBase - Log de erros do LBConverter", "color": "#000000", "file_ext_time": 0, "dt_base": "01/01/2015 00:00:00", "idx_exp_url": "", "file_ext": false, "password": "qqqqqqqq", "id_base": ID_BASE_PLACEHOLDER, "name": "log_lbconverter", "idx_exp_time": 0, "model": {"id_file_orig": "Text", "nm_base": "Text", "file_name": "Text", "id_doc_orig": "Integer", "dt_error": "DateTime", "error_msg": "Text"}}}',TO_DATE('2015-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),false,'',0,false,0); + +UPDATE lb_base SET struct = replace(struct, 'ID_BASE_PLACEHOLDER', cast(id_base as text)) WHERE name='log_lbconverter'; + +/* ------ */ + +INSERT INTO public.lb_base (name,struct,dt_base,idx_exp,idx_exp_url,idx_exp_time,file_ext,file_ext_time) VALUES ( +'log_lbindex','{"content": [{"field": {"name": "nm_base", "datatype": "Text", "required": true, "alias": "Nome da base", "multivalued": false, "indices": ["Ordenado"], "description": "Nome da base"}}, {"field": {"name": "id_doc_orig", "datatype": "Integer", "required": true, "alias": "identificador do documento", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "id do documento que originou o erro."}}, {"field": {"name": "error_msg", "datatype": "Text", "required": true, "alias": "Mensagem de erro", "multivalued": false, "indices": ["Nenhum"], "description": "Mensagem de erro"}}, {"field": {"name": "dt_error", "datatype": "DateTime", "required": true, "alias": "Data do erro", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Data e Hora no formato DD/MM/AAAA - HH:MM:SS do erro"}}, {"field": {"name": "dt_last_up_orig", "datatype": "DateTime", "required": true, "alias": "dt_last_up_orig", "multivalued": false, "indices": ["Textual", "Ordenado"], "description": "Data e Hora no formato DD/MM/AAAA - HH:MM:SS da última atualização do registro que originou o erro."}}], "metadata": {"idx_exp": false, "description": "LightBase - Log de erros do LBIndex", "color": "#000000", "file_ext_time": 0, "dt_base": "01/01/2015 00:00:00", "idx_exp_url": "", "file_ext": false, "password": "qqqqqqqq", "id_base": ID_BASE_PLACEHOLDER, "name": "log_lbindex", "idx_exp_time": 0, "model": {"dt_last_up_orig": "DateTime", "id_doc_orig": "Integer", "dt_error": "DateTime", "error_msg": "Text", "nm_base": "Text"}}}',TO_DATE('2015-01-01 00:00:00','YYYY-MM-DD HH24:MI:SS'),false,'',0,false,0); + +UPDATE lb_base SET struct = replace(struct, 'ID_BASE_PLACEHOLDER', cast(id_base as text)) WHERE name='log_lbindex'; + +/* ------ */ + +/* ----------------------------------- */ +/* _app_config */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_doc__app_config +( + id_doc serial NOT NULL, + document json NOT NULL, + dt_doc timestamp without time zone NOT NULL, + dt_last_up timestamp without time zone NOT NULL, + dt_del timestamp without time zone, + dt_idx timestamp without time zone, + nm_user_alteracao character varying[], + nm_apelido character varying, + nm_aplicacao character varying, + CONSTRAINT lb_doc__app_config_pkey PRIMARY KEY (id_doc) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_doc__app_config + OWNER TO postgres; + +/* ------ */ +/* [OK] */ + +CREATE TABLE lb_file__app_config +( + id_file uuid NOT NULL, + id_doc integer, + filename character varying NOT NULL, + file bytea NOT NULL, + mimetype character varying NOT NULL, + filesize integer NOT NULL, + filetext character varying, + dt_ext_text timestamp without time zone, + CONSTRAINT lb_file__app_config_pkey PRIMARY KEY (id_file) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_file__app_config + OWNER TO postgres; + +/* ----------------------------------- */ +/* _history */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_doc__history +( + id_doc serial NOT NULL, + document json NOT NULL, + dt_doc timestamp without time zone NOT NULL, + dt_last_up timestamp without time zone NOT NULL, + dt_del timestamp without time zone, + dt_idx timestamp without time zone, + CONSTRAINT lb_doc__history_pkey PRIMARY KEY (id_doc) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_doc__history + OWNER TO postgres; + +/* ------ */ +/* [OK] */ + +CREATE TABLE lb_file__history +( + id_file uuid NOT NULL, + id_doc integer, + filename character varying NOT NULL, + file bytea NOT NULL, + mimetype character varying NOT NULL, + filesize integer NOT NULL, + filetext character varying, + dt_ext_text timestamp without time zone, + CONSTRAINT lb_file__history_pkey PRIMARY KEY (id_file) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_file__history + OWNER TO postgres; + +/* ----------------------------------- */ +/* _portal */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_doc__portal +( + id_doc serial NOT NULL, + document json NOT NULL, + dt_doc timestamp without time zone NOT NULL, + dt_last_up timestamp without time zone NOT NULL, + dt_del timestamp without time zone, + dt_idx timestamp without time zone, + cpf_user character varying, + nm_portal character varying, + CONSTRAINT lb_doc__portal_pkey PRIMARY KEY (id_doc) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_doc__portal + OWNER TO postgres; + +/* ------ */ +/* [OK] */ + +CREATE TABLE lb_file__portal +( + id_file uuid NOT NULL, + id_doc integer, + filename character varying NOT NULL, + file bytea NOT NULL, + mimetype character varying NOT NULL, + filesize integer NOT NULL, + filetext character varying, + dt_ext_text timestamp without time zone, + CONSTRAINT lb_file__portal_pkey PRIMARY KEY (id_file) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_file__portal + OWNER TO postgres; + +/* ----------------------------------- */ +/* _user */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_doc__user +( + id_doc serial NOT NULL, + document json NOT NULL, + dt_doc timestamp without time zone NOT NULL, + dt_last_up timestamp without time zone NOT NULL, + dt_del timestamp without time zone, + dt_idx timestamp without time zone, + name_base character varying[], + id_user integer, + status_user boolean, + access_type character varying[], + name_user character varying, + creation_date_user date, + email_user character varying, + passwd_user character varying, + CONSTRAINT lb_doc__user_pkey PRIMARY KEY (id_doc) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_doc__user + OWNER TO postgres; + +/* ------ */ +/* [OK] */ + +CREATE TABLE lb_file__user +( + id_file uuid NOT NULL, + id_doc integer, + filename character varying NOT NULL, + file bytea NOT NULL, + mimetype character varying NOT NULL, + filesize integer NOT NULL, + filetext character varying, + dt_ext_text timestamp without time zone, + CONSTRAINT lb_file__user_pkey PRIMARY KEY (id_file) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_file__user + OWNER TO postgres; + +/* ----------------------------------- */ +/* lb_index_error */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_index_error +( + id_error serial NOT NULL, + base character varying NOT NULL, + id_doc integer NOT NULL, + dt_error timestamp without time zone NOT NULL, + msg_error character varying, + CONSTRAINT lb_index_error_pkey PRIMARY KEY (id_error) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_index_error + OWNER TO postgres; + +/* ----------------------------------- */ +/* log_lbindex */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_doc_log_lbindex +( + id_doc serial NOT NULL, + document json NOT NULL, + dt_doc timestamp without time zone NOT NULL, + dt_last_up timestamp without time zone NOT NULL, + dt_del timestamp without time zone, + dt_idx timestamp without time zone, + id_doc_orig integer, + dt_last_up_orig timestamp without time zone, + nm_base character varying, + dt_error timestamp without time zone, + CONSTRAINT lb_doc_log_lbindex_pkey PRIMARY KEY (id_doc) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_doc_log_lbindex + OWNER TO postgres; + +/* ------ */ +/* [OK] */ + +CREATE TABLE lb_file_log_lbindex +( + id_file uuid NOT NULL, + id_doc integer, + filename character varying NOT NULL, + file bytea NOT NULL, + mimetype character varying NOT NULL, + filesize integer NOT NULL, + filetext character varying, + dt_ext_text timestamp without time zone, + CONSTRAINT lb_file_log_lbindex_pkey PRIMARY KEY (id_file) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_file_log_lbindex + OWNER TO postgres; + +/* ----------------------------------- */ +/* log_lbconverter */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_doc_log_lbconverter +( + id_doc serial NOT NULL, + document json NOT NULL, + dt_doc timestamp without time zone NOT NULL, + dt_last_up timestamp without time zone NOT NULL, + dt_del timestamp without time zone, + dt_idx timestamp without time zone, + file_name character varying, + id_doc_orig integer, + nm_base character varying, + dt_error timestamp without time zone, + CONSTRAINT lb_doc_log_lbconverter_pkey PRIMARY KEY (id_doc) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_doc_log_lbconverter + OWNER TO postgres; + +/* ------ */ +/* [OK] */ + +CREATE TABLE lb_file_log_lbconverter +( + id_file uuid NOT NULL, + id_doc integer, + filename character varying NOT NULL, + file bytea NOT NULL, + mimetype character varying NOT NULL, + filesize integer NOT NULL, + filetext character varying, + dt_ext_text timestamp without time zone, + CONSTRAINT lb_file_log_lbconverter_pkey PRIMARY KEY (id_file) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_file_log_lbconverter + OWNER TO postgres; + +/* ----------------------------------- */ +/* lb_txt_idx */ +/* ------------- */ +/* [OK] */ + +CREATE TABLE lb_txt_idx +( + id_idx serial NOT NULL, + nm_idx character varying NOT NULL, + cfg_idx character varying NOT NULL, + dt_crt_idx timestamp without time zone NOT NULL, + dt_upt_idx timestamp without time zone NOT NULL, + url_idx character varying NOT NULL, + actv_idx boolean NOT NULL, + struct character varying NOT NULL, + CONSTRAINT lb_txt_idx_pkey PRIMARY KEY (id_idx), + CONSTRAINT lb_txt_idx_nm_idx_key UNIQUE (nm_idx) +) +WITH ( + OIDS=FALSE +); +ALTER TABLE lb_txt_idx + OWNER TO postgres; +\q + +/* --------------------------------------------------- */ \ No newline at end of file diff --git a/liblightbase.tar.gz b/liblightbase.tar.gz new file mode 100755 index 0000000..2bb9772 Binary files /dev/null and b/liblightbase.tar.gz differ diff --git a/other-srcs-n-apps/.directory b/other-srcs-n-apps/.directory new file mode 100755 index 0000000..09b43f8 --- /dev/null +++ b/other-srcs-n-apps/.directory @@ -0,0 +1,5 @@ +[Dolphin] +PreviewsShown=true +Timestamp=2015,5,12,11,49,12 +Version=3 +ViewMode=1 diff --git a/other-srcs-n-apps/Python-3.2.2.tar.gz b/other-srcs-n-apps/Python-3.2.2.tar.gz new file mode 100755 index 0000000..43b0089 Binary files /dev/null and b/other-srcs-n-apps/Python-3.2.2.tar.gz differ diff --git a/other-srcs-n-apps/elasticsearch-1.1.1.noarch.rpm b/other-srcs-n-apps/elasticsearch-1.1.1.noarch.rpm new file mode 100755 index 0000000..2ea2af8 Binary files /dev/null and b/other-srcs-n-apps/elasticsearch-1.1.1.noarch.rpm differ diff --git a/other-srcs-n-apps/lbg.conf.dist b/other-srcs-n-apps/lbg.conf.dist new file mode 100755 index 0000000..17ce91d --- /dev/null +++ b/other-srcs-n-apps/lbg.conf.dist @@ -0,0 +1,23 @@ +# Use only 1 Python sub-interpreter. Multiple sub-interpreters +# play badly with C extensions. + +LoadModule wsgi_module /usr/lib64/httpd/modules/mod_wsgi.so + +WSGISocketPrefix /var/run/wsgi + +ServerAdmin admin@lightbase.com.br +ServerName 127.0.0.1 + +WSGIApplicationGroup %{GLOBAL} +WSGIPassAuthorization On +WSGIDaemonProcess user=apache group=apache threads=8 python-path=/lib/python3.2/site-packages +WSGIScriptAlias / /src/LBGenerator/lbgenerator.wsgi + +> + WSGIProcessGroup + Order allow,deny + Allow from all + + +ErrorLog /var/log/httpd/neo-lightbase-error.log +CustomLog /var/log/httpd/neo-lightbase-access.log combined diff --git a/other-srcs-n-apps/mod_wsgi-4.3.2.tar.gz b/other-srcs-n-apps/mod_wsgi-4.3.2.tar.gz new file mode 100755 index 0000000..9954e10 Binary files /dev/null and b/other-srcs-n-apps/mod_wsgi-4.3.2.tar.gz differ diff --git a/other-srcs-n-apps/pgdg-centos94-9.4-1.noarch.rpm b/other-srcs-n-apps/pgdg-centos94-9.4-1.noarch.rpm new file mode 100755 index 0000000..0adcbab Binary files /dev/null and b/other-srcs-n-apps/pgdg-centos94-9.4-1.noarch.rpm differ diff --git a/other-srcs-n-apps/virtualenv-1.11.6.tar.gz b/other-srcs-n-apps/virtualenv-1.11.6.tar.gz new file mode 100755 index 0000000..e2a760e Binary files /dev/null and b/other-srcs-n-apps/virtualenv-1.11.6.tar.gz differ diff --git a/py-packs-LBGenerator.sh b/py-packs-LBGenerator.sh new file mode 100755 index 0000000..3080257 --- /dev/null +++ b/py-packs-LBGenerator.sh @@ -0,0 +1,155 @@ +#!/bin/bash + +# Instalação das dependências do LBG - LBGenerator no python3.2! + +. ./ez_i.sh + +SKIP_ON_V=$1 +if [ -z "$SKIP_ON_V" ] ; then + SKIP_ON_V=0 +fi + +BASE_INST_DIR_V=$2 + +# > ----------------------------------------- +# Informar o diretório base da instalação! + +if [ -z "$BASE_INST_DIR_V" ] ; then + f_open_section + BASE_INST_DIR_V="/usr/local/lb" + + QUESTION_F="Enter the installation directory. + Use empty for \"$BASE_INST_DIR_V\"!" + + f_get_usr_input "$QUESTION_F" 1 + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + BASE_INST_DIR_V="$GET_USR_INPUT_R/lb" + fi + f_close_section +fi + +# < ----------------------------------------- + +f_open_section + +TITLE_F="Install LBGenerator dependencies for python3.2?" + +f_yes_no "$TITLE_F" +TITLE_F="" + +if [ ${YES_NO_R} -eq 1 ] || [ ${SKIP_ON_V} -eq 1 ] ; then + + cd "$SCRIPTDIR_V" + cd ./py-packs-LBGenerator + + tar -zxvf ./SQLAlchemy-0.9.4.tar.gz + cd ./SQLAlchemy-0.9.4 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./SQLAlchemy-0.9.4 + + tar -zxvf ./Mako-1.0.1.tar.gz + cd ./Mako-1.0.1 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./Mako-1.0.1 + + tar -zxvf ./alembic-0.6.7.tar.gz + cd ./alembic-0.6.7 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./alembic-0.6.7 + + tar -zxvf ./Beaker-1.7.0.tar.gz + cd ./Beaker-1.7.0 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./Beaker-1.7.0 + + tar -zxvf ./PasteDeploy-1.5.2.tar.gz + cd ./PasteDeploy-1.5.2 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./PasteDeploy-1.5.2 + + tar -zxvf ./psycopg2-2.5.3.tar.gz + cd ./psycopg2-2.5.3 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./psycopg2-2.5.3 + + tar -zxvf ./WebOb-1.4.tar.gz + cd ./WebOb-1.4 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./WebOb-1.4 + + tar -zxvf ./translationstring-1.1.tar.gz + cd ./translationstring-1.1 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./translationstring-1.1 + + tar -zxvf ./venusian-1.0a8.tar.gz + cd ./venusian-1.0a8 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./venusian-1.0a8 + + tar -zxvf ./waitress-0.8.9.tar.gz + cd ./waitress-0.8.9 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./waitress-0.8.9 + + tar -zxvf ./zope.deprecation-4.1.1.tar.gz + cd ./zope.deprecation-4.1.1 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./zope.deprecation-4.1.1 + + tar -zxvf ./zope.interface-4.1.1.tar.gz + cd ./zope.interface-4.1.1 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./zope.interface-4.1.1 + + tar -zxvf ./repoze.lru-0.6.tar.gz + cd ./repoze.lru-0.6 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./repoze.lru-0.6 + + tar -zxvf ./pyramid-1.5.1.tar.gz + cd ./pyramid-1.5.1 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./pyramid-1.5.1 + + tar -zxvf ./pyramid_beaker-0.8.tar.gz + cd ./pyramid_beaker-0.8 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./pyramid_beaker-0.8 + + tar -zxvf ./pyramid_restler-0.1a4.tar.gz + cd ./pyramid_restler-0.1a4 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./pyramid_restler-0.1a4 + + tar -zxvf ./requests-2.3.0.tar.gz + cd ./requests-2.3.0 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./requests-2.3.0 + + tar -zxvf ./voluptuous-0.8.7.tar.gz + cd ./voluptuous-0.8.7 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./voluptuous-0.8.7 + +fi +f_close_section diff --git a/py-packs-LBGenerator/Beaker-1.7.0.tar.gz b/py-packs-LBGenerator/Beaker-1.7.0.tar.gz new file mode 100755 index 0000000..560e51c Binary files /dev/null and b/py-packs-LBGenerator/Beaker-1.7.0.tar.gz differ diff --git a/py-packs-LBGenerator/Mako-1.0.1.tar.gz b/py-packs-LBGenerator/Mako-1.0.1.tar.gz new file mode 100755 index 0000000..0052984 Binary files /dev/null and b/py-packs-LBGenerator/Mako-1.0.1.tar.gz differ diff --git a/py-packs-LBGenerator/PasteDeploy-1.5.2.tar.gz b/py-packs-LBGenerator/PasteDeploy-1.5.2.tar.gz new file mode 100755 index 0000000..fd4f9e1 Binary files /dev/null and b/py-packs-LBGenerator/PasteDeploy-1.5.2.tar.gz differ diff --git a/py-packs-LBGenerator/SQLAlchemy-0.9.4.tar.gz b/py-packs-LBGenerator/SQLAlchemy-0.9.4.tar.gz new file mode 100755 index 0000000..e2faff3 Binary files /dev/null and b/py-packs-LBGenerator/SQLAlchemy-0.9.4.tar.gz differ diff --git a/py-packs-LBGenerator/WebOb-1.4.tar.gz b/py-packs-LBGenerator/WebOb-1.4.tar.gz new file mode 100755 index 0000000..df97909 Binary files /dev/null and b/py-packs-LBGenerator/WebOb-1.4.tar.gz differ diff --git a/py-packs-LBGenerator/alembic-0.6.7.tar.gz b/py-packs-LBGenerator/alembic-0.6.7.tar.gz new file mode 100755 index 0000000..7433501 Binary files /dev/null and b/py-packs-LBGenerator/alembic-0.6.7.tar.gz differ diff --git a/py-packs-LBGenerator/psycopg2-2.5.3.tar.gz b/py-packs-LBGenerator/psycopg2-2.5.3.tar.gz new file mode 100755 index 0000000..05a095c Binary files /dev/null and b/py-packs-LBGenerator/psycopg2-2.5.3.tar.gz differ diff --git a/py-packs-LBGenerator/pyramid-1.5.1.tar.gz b/py-packs-LBGenerator/pyramid-1.5.1.tar.gz new file mode 100755 index 0000000..3a2846b Binary files /dev/null and b/py-packs-LBGenerator/pyramid-1.5.1.tar.gz differ diff --git a/py-packs-LBGenerator/pyramid_beaker-0.8.tar.gz b/py-packs-LBGenerator/pyramid_beaker-0.8.tar.gz new file mode 100755 index 0000000..0faa766 Binary files /dev/null and b/py-packs-LBGenerator/pyramid_beaker-0.8.tar.gz differ diff --git a/py-packs-LBGenerator/pyramid_restler-0.1a4.tar.gz b/py-packs-LBGenerator/pyramid_restler-0.1a4.tar.gz new file mode 100755 index 0000000..de2c0a5 Binary files /dev/null and b/py-packs-LBGenerator/pyramid_restler-0.1a4.tar.gz differ diff --git a/py-packs-LBGenerator/repoze.lru-0.6.tar.gz b/py-packs-LBGenerator/repoze.lru-0.6.tar.gz new file mode 100755 index 0000000..81e8ee5 Binary files /dev/null and b/py-packs-LBGenerator/repoze.lru-0.6.tar.gz differ diff --git a/py-packs-LBGenerator/requests-2.3.0.tar.gz b/py-packs-LBGenerator/requests-2.3.0.tar.gz new file mode 100755 index 0000000..4c8e509 Binary files /dev/null and b/py-packs-LBGenerator/requests-2.3.0.tar.gz differ diff --git a/py-packs-LBGenerator/translationstring-1.1.tar.gz b/py-packs-LBGenerator/translationstring-1.1.tar.gz new file mode 100755 index 0000000..25370b8 Binary files /dev/null and b/py-packs-LBGenerator/translationstring-1.1.tar.gz differ diff --git a/py-packs-LBGenerator/venusian-1.0a8.tar.gz b/py-packs-LBGenerator/venusian-1.0a8.tar.gz new file mode 100755 index 0000000..fdb10c0 Binary files /dev/null and b/py-packs-LBGenerator/venusian-1.0a8.tar.gz differ diff --git a/py-packs-LBGenerator/voluptuous-0.8.7.tar.gz b/py-packs-LBGenerator/voluptuous-0.8.7.tar.gz new file mode 100755 index 0000000..6d33a69 Binary files /dev/null and b/py-packs-LBGenerator/voluptuous-0.8.7.tar.gz differ diff --git a/py-packs-LBGenerator/waitress-0.8.9.tar.gz b/py-packs-LBGenerator/waitress-0.8.9.tar.gz new file mode 100755 index 0000000..73fb6e6 Binary files /dev/null and b/py-packs-LBGenerator/waitress-0.8.9.tar.gz differ diff --git a/py-packs-LBGenerator/zope.deprecation-4.1.1.tar.gz b/py-packs-LBGenerator/zope.deprecation-4.1.1.tar.gz new file mode 100755 index 0000000..9272384 Binary files /dev/null and b/py-packs-LBGenerator/zope.deprecation-4.1.1.tar.gz differ diff --git a/py-packs-LBGenerator/zope.interface-4.1.1.tar.gz b/py-packs-LBGenerator/zope.interface-4.1.1.tar.gz new file mode 100755 index 0000000..f12ee6c Binary files /dev/null and b/py-packs-LBGenerator/zope.interface-4.1.1.tar.gz differ diff --git a/py-packs-liblightbase.sh b/py-packs-liblightbase.sh new file mode 100755 index 0000000..4993c91 --- /dev/null +++ b/py-packs-liblightbase.sh @@ -0,0 +1,88 @@ +#!/bin/bash + +# Instalação das dependências da LIB - liblightbase no python3.2! + +. ./ez_i.sh + +SKIP_ON_V=$1 +if [ -z "$SKIP_ON_V" ] ; then + SKIP_ON_V=0 +fi + +BASE_INST_DIR_V=$2 + +# > ----------------------------------------- +# Informar o diretório base da instalação! + +if [ -z "$BASE_INST_DIR_V" ] ; then + f_open_section + BASE_INST_DIR_V="/usr/local/lb" + + QUESTION_F="Enter the installation directory. + Use empty for \"$BASE_INST_DIR_V\"!" + + f_get_usr_input "$QUESTION_F" 1 + QUESTION_F="" + if [ -n "$GET_USR_INPUT_R" ] ; then + BASE_INST_DIR_V="$GET_USR_INPUT_R/lb" + fi + f_close_section +fi + +# < ----------------------------------------- + +f_open_section + +TITLE_F="Install liblightbase dependencies for python3.2?" + +f_yes_no "$TITLE_F" +TITLE_F="" + +if [ ${YES_NO_R} -eq 1 ] || [ ${SKIP_ON_V} -eq 1 ] ; then + + cd "$SCRIPTDIR_V" + cd ./py-packs-liblightbase + + tar -zxvf ./decorator-3.4.0.tar.gz + cd ./decorator-3.4.0 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./decorator-3.4.0 + + tar -zxvf ./six-1.7.2.tar.gz + cd ./six-1.7.2 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./six-1.7.2 + + tar -zxvf ./ply-3.4.tar.gz + cd ./ply-3.4 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./ply-3.4 + + tar -zxvf ./jsonpath-rw-1.3.0.tar.gz + cd ./jsonpath-rw-1.3.0 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./jsonpath-rw-1.3.0 + + tar -zxvf ./python-dateutil-2.2.tar.gz + cd ./python-dateutil-2.2 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./python-dateutil-2.2 + + tar -zxvf ./requests-2.3.0.tar.gz + cd ./requests-2.3.0 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./requests-2.3.0 + + tar -zxvf ./voluptuous-0.8.7.tar.gz + cd ./voluptuous-0.8.7 + eval "$BASE_INST_DIR_V/ve32/bin/python3.2 setup.py install" + cd .. + rm -rf ./voluptuous-0.8.7 + +fi diff --git a/py-packs-liblightbase/decorator-3.4.0.tar.gz b/py-packs-liblightbase/decorator-3.4.0.tar.gz new file mode 100755 index 0000000..a28043e Binary files /dev/null and b/py-packs-liblightbase/decorator-3.4.0.tar.gz differ diff --git a/py-packs-liblightbase/jsonpath-rw-1.3.0.tar.gz b/py-packs-liblightbase/jsonpath-rw-1.3.0.tar.gz new file mode 100755 index 0000000..d92e706 Binary files /dev/null and b/py-packs-liblightbase/jsonpath-rw-1.3.0.tar.gz differ diff --git a/py-packs-liblightbase/ply-3.4.tar.gz b/py-packs-liblightbase/ply-3.4.tar.gz new file mode 100755 index 0000000..41620e0 Binary files /dev/null and b/py-packs-liblightbase/ply-3.4.tar.gz differ diff --git a/py-packs-liblightbase/python-dateutil-2.2.tar.gz b/py-packs-liblightbase/python-dateutil-2.2.tar.gz new file mode 100755 index 0000000..65be23c Binary files /dev/null and b/py-packs-liblightbase/python-dateutil-2.2.tar.gz differ diff --git a/py-packs-liblightbase/requests-2.3.0.tar.gz b/py-packs-liblightbase/requests-2.3.0.tar.gz new file mode 100755 index 0000000..4c8e509 Binary files /dev/null and b/py-packs-liblightbase/requests-2.3.0.tar.gz differ diff --git a/py-packs-liblightbase/six-1.7.2.tar.gz b/py-packs-liblightbase/six-1.7.2.tar.gz new file mode 100755 index 0000000..036b9ee Binary files /dev/null and b/py-packs-liblightbase/six-1.7.2.tar.gz differ diff --git a/py-packs-liblightbase/voluptuous-0.8.7.tar.gz b/py-packs-liblightbase/voluptuous-0.8.7.tar.gz new file mode 100755 index 0000000..6d33a69 Binary files /dev/null and b/py-packs-liblightbase/voluptuous-0.8.7.tar.gz differ -- libgit2 0.21.2