pkg target and renamed the old --ck in chk in INSTALL.sh management script
[brisk.git] / INSTALL.sh
index 862f27f..61a4bff 100755 (executable)
@@ -6,7 +6,7 @@
 players_n=3
 tables_n=16
 tables_auth_n=6
-brisk_auth_conf="brisk_auth.conf.pho"
+brisk_auth_conf="brisk_auth2.conf.pho"
 brisk_debug="0xffff"
 web_path="$HOME/brisk"
 legal_path="$HOME/brisk-priv"
@@ -15,8 +15,34 @@ proxy_path="$HOME/brisk-priv/proxy"
 web_only="FALSE"
 brisk_conf="brisk.conf.pho"
 
-if [ -f $HOME/.trusty_install ]; then
-   . $HOME/.trusty_install
+if [ "$1" = "chk" ]; then
+    find -name '*.pho' -o -name '*.phh' -o -name '*.php' -exec php5 -l {} \;
+    exit 0
+fi
+
+if [ "$1" = "pkg" ]; then
+    if [ "$2" != "" ]; then
+        tag="$2"
+    else
+        tag="$(git describe)"
+    fi
+    nam1="brisk_${tag}.tgz"
+    nam2="brisk-img_${tag}.tgz"
+    echo "Build packages ${nam1} and ${nam2}."
+    read -p "Proceed [y/n]: " a
+    if [ "$a" != "y" -a  "$a" != "Y" ]; then
+        exit 1
+    fi
+    git archive --format=tar --prefix=brisk-${tag}/brisk/ $tag | gzip > ../$nam1
+    cd ../brisk-img
+    git archive --format=tar --prefix=brisk-${tag}/brisk-img/ $tag | gzip > ../$nam2
+    cd -
+    exit 0
+fi
+    
+
+if [ -f $HOME/.brisk_install ]; then
+   . $HOME/.brisk_install
 fi
 if [ "x$cookie_path" = "x" ]; then
    cookie_path=$web_path
@@ -24,6 +50,8 @@ fi
 function usage () {
     echo
     echo "$1 -h"
+    echo "$1 chk                          - run lintian on all ph* files."
+    echo "$1 pkg                          - build brisk packages."
     echo "$1 [-W] [-n 3|5] [-t <(n>=4)>] [-T <auth_tab>] [-a <auth_file_name>] [-f conffile] [-p outconf] [-d TRUE|FALSE] [-w web_dir] [-k <ftok_dir>] [-l <legal_path>] [-y <proxy_path>] [-c <cookie_path>]"
     echo "  -h this help"
     echo "  -f use this config file"