[openrtm-commit:02969] r3105 - branches/RELENG_1_2/OpenRTM-aist/build

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 12月 10日 (日) 15:05:44 JST


Author: n-ando
Date: 2017-12-10 15:05:44 +0900 (Sun, 10 Dec 2017)
New Revision: 3105

Added:
   branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_raspbian.sh
Modified:
   branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_debian.sh
   branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_fedora.sh
   branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_ubuntu.sh
Log:
merged changes from trunk/OpenRTM-aist r3007-3009, 3011, 3014-3015 during 2017-07:
[compat,->RELENG_1_2] Graphviz and nkf have been added in pkg_install_ubuntu.sh. refs #4136
[compat,->RELENG_1_2] libtool-bin package has been removed from ubuntu14.04. refs #4136
[compat,->RELENG_1_2] Fixed bugs. refs #4136
[compat,->RELENG_1_2] Graphviz and nkf have been added to the debian and fedora package installation script. refs #4136
[compat,->RELENG_1_2] Ant and git have been added to package installation script. refs #4136
[compat,->RELENG_1_2] Install script for raspbian has been added. refs #4148


Modified: branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_debian.sh
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_debian.sh	2017-12-10 06:03:23 UTC (rev 3104)
+++ branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_debian.sh	2017-12-10 06:05:44 UTC (rev 3105)
@@ -18,7 +18,7 @@
   Usage: 
 
     $(basename ${0}) [-l all/c++] [-r/-d/-s/-c] [-u]
-    $(basename ${0}) [-l python/java] [-d/-c] [-u]
+    $(basename ${0}) [-l python/java] [-r/-d/-c] [-u]
     $(basename ${0}) [-l openrtp/rtshell] [-d] [-u]                           
 
   Example:
@@ -56,10 +56,10 @@
 else
   autotools="autoconf libtool libtool-bin"
 fi
-base_tools="bc iputils-ping net-tools"
+base_tools="bc iputils-ping net-tools zip"
 cxx_devel="gcc g++ make python-yaml"
-cmake_tools="cmake doxygen"
-build_tools="subversion"
+cmake_tools="cmake doxygen graphviz nkf"
+build_tools="subversion git"
 deb_pkg="uuid-dev libboost-filesystem-dev"
 pkg_tools="build-essential debhelper devscripts"
 omni_devel="libomniorb4-dev omniidl"
@@ -70,39 +70,44 @@
 runtime_pkgs="$omni_runtime $openrtm_runtime"
 u_runtime_pkgs=$runtime_pkgs
 
-src_pkgs="$cxx_devel $cmake_tools $deb_pkg $omni_runtime $omni_devel"
+src_pkgs="$cxx_devel $cmake_tools $deb_pkg $base_tools $omni_runtime $omni_devel"
 u_src_pkgs="$omni_runtime $omni_devel"
 
 dev_pkgs="$runtime_pkgs $src_pkgs $openrtm_devel"
 u_dev_pkgs="$u_runtime_pkgs $omni_devel $openrtm_devel"
 
-core_pkgs="$src_pkgs $autotools $base_tools $build_tools $pkg_tools"
+core_pkgs="$src_pkgs $autotools $build_tools $pkg_tools"
 u_core_pkgs="$u_src_pkgs"
 
 #--------------------------------------- Python
 omnipy="omniidl-python"
-python_devel="python python-pip python-pyorbit-omg"
+python_runtime="python python-pyorbit-omg"
+python_devel="python-pip $cmake_tools $base_tools $omnipy"
 openrtm_py_devel="openrtm-aist-python-doc"
 openrtm_py_runtime="openrtm-aist-python openrtm-aist-python-example"
 
-python_base="$python_devel $cmake_tools"
-python_omni="$omni_runtime $omnipy"
+python_runtime_pkgs="$omni_runtime $python_runtime $openrtm_py_runtime"
+u_python_runtime_pkgs="$omni_runtime $openrtm_py_runtime"
 
-python_dev_pkgs="$python_base $python_omni $openrtm_py_runtime $openrtm_py_devel"
-u_python_dev_pkgs="$python_omni $openrtm_py_runtime $openrtm_py_devel"
+python_dev_pkgs="$python_runtime_pkgs $python_devel $openrtm_py_devel"
+u_python_dev_pkgs="$u_python_runtime_pkgs $omnipy $openrtm_py_devel"
 
-python_core_pkgs="$python_base $python_omni $build_tools"
-u_python_core_pkgs="$python_omni"
+python_core_pkgs="$omni_runtime $python_runtime $python_devel $build_tools $pkg_tools"
+u_python_core_pkgs="$omni_runtime $omnipy"
 
 #--------------------------------------- Java
 java_devel="default-jdk"
-openrtm_java_devel="openrtm-aist-java-doc"
-openrtm_java_runtime="openrtm-aist-java openrtm-aist-java-example"
+java_build="ant"
+openrtm_j_devel="openrtm-aist-java-doc"
+openrtm_j_runtime="openrtm-aist-java openrtm-aist-java-example"
 
-java_dev_pkgs="$java_devel $omni_runtime $cmake_tools $openrtm_java_runtime $openrtm_java_devel"
-u_java_dev_pkgs="$omni_runtime $openrtm_java_runtime $openrtm_java_devel"
+java_runtime_pkgs="$omni_runtime $java_devel $openrtm_j_runtime"
+u_java_runtime_pkgs="$omni_runtime $openrtm_j_runtime"
 
-java_core_pkgs="$java_devel $omni_runtime $cmake_tools $build_tools"
+java_dev_pkgs="$java_runtime_pkgs $cmake_tools $base_tools $openrtm_j_devel"
+u_java_dev_pkgs="$omni_runtime $openrtm_j_runtime $openrtm_j_devel"
+
+java_core_pkgs="$omni_runtime $java_devel $cmake_tools $base_tools $build_tools $java_build $pkg_tools"
 u_java_core_pkgs="$omni_runtime"
 
 #--------------------------------------- OpenRTP
@@ -327,7 +332,7 @@
 install_packages () {
   for p in $*; do
     echo $msg9 $p
-    dpkg -l | grep $p > /dev/null 2>&1
+    echo $install_pkgs | grep $p > /dev/null 2>&1
     if [ $? -ne 0 ]; then
       tmp_pkg="$install_pkgs $p"
       install_pkgs=$tmp_pkg
@@ -362,9 +367,11 @@
 uninstall_packages () {
   for p in $*; do
     echo $msg11 $p
-    tmp_pkg="$uninstall_pkgs $p"
-    uninstall_pkgs=$tmp_pkg
-
+    echo $uninstall_pkgs | grep $p > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+      tmp_pkg="$uninstall_pkgs $p"
+      uninstall_pkgs=$tmp_pkg
+    fi
     apt-get --purge remove $p
     if test "$?" != 0; then
       apt-get purge $p
@@ -399,6 +406,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_p="[python] install tool_packages for core developer"
       install_packages $python_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] install robot component runtime"
+      install_packages $python_runtime_pkgs
     else
       select_opt_p="[python] install robot component developer"
       install_packages $python_dev_pkgs
@@ -409,6 +419,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_j="[java] install tool_packages for core developer"
       install_packages $java_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] install robot component runtime"
+      install_packages $java_runtime_pkgs
     else
       select_opt_j="[java] install robot component developer"
       install_packages $java_dev_pkgs
@@ -422,7 +435,7 @@
 
   if test "x$arg_rtshell" = "xtrue" ; then
     select_opt_shl="[rtshell] install"
-    install_packages $python_devel
+    install_packages python-pip
     rtshell_ret=`pip install rtshell`
   fi
 }
@@ -452,6 +465,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_p="[python] uninstall tool_packages for core developer"
       uninstall_packages `reverse $u_python_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] uninstall robot component runtime"
+      uninstall_packages `reverse $u_python_runtime_pkgs`
     else
       select_opt_p="[python] uninstall robot component developer"
       uninstall_packages `reverse $u_python_dev_pkgs`
@@ -462,6 +478,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_j="[java] uninstall tool_packages for core developer"
       uninstall_packages `reverse $u_java_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] uninstall robot component runtime"
+      uninstall_packages `reverse $u_java_runtime_pkgs`
     else
       select_opt_j="[java] uninstall robot component developer"
       uninstall_packages `reverse $u_java_dev_pkgs`
@@ -547,7 +566,7 @@
 =============================================
 EOF
   if [ $# -eq 0 ] && test "x$OPT_FLG" = "xtrue"; then
-    echo "There is no installation package."
+    echo "There is no uninstall package."
     return
   fi
 

Modified: branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_fedora.sh
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_fedora.sh	2017-12-10 06:03:23 UTC (rev 3104)
+++ branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_fedora.sh	2017-12-10 06:05:44 UTC (rev 3105)
@@ -17,7 +17,7 @@
   Usage: 
 
     $(basename ${0}) [-l all/c++] [-r/-d/-s/-c] [-u]
-    $(basename ${0}) [-l python/java] [-d/-c] [-u]
+    $(basename ${0}) [-l python/java] [-r/-d/-c] [-u]
     $(basename ${0}) [-l openrtp] [-d] [-u]                           
 
   Example:
@@ -51,8 +51,8 @@
 #--------------------------------------- C++
 autotools="autoconf automake libtool"
 cxx_devel="gcc-c++ make PyYAML"
-cmake_tools="cmake doxygen"
-build_tools="subversion"
+cmake_tools="cmake doxygen graphviz nkf"
+build_tools="subversion git"
 rpm_pkg="uuid-devel libuuid-devel boost boost-devel"
 rpm_tools="createrepo rpm-build"
 omni_devel="omniORB-devel omniORB-doc  omniORB-utils"
@@ -74,28 +74,33 @@
 
 #--------------------------------------- Python
 omnipy="omniORBpy-devel"
-python_devel="python python-omniORB"
+python_runtime="python python-omniORB"
+python_devel="$cmake_tools $omnipy"
 openrtm_py_devel="OpenRTM-aist-Python-doc"
 openrtm_py_runtime="OpenRTM-aist-Python OpenRTM-aist-Python-example"
 
-python_base="$python_devel $cmake_tools"
-python_omni="$omni_runtime $omnipy"
+python_runtime_pkgs="$omni_runtime $python_runtime $openrtm_py_runtime"
+u_python_runtime_pkgs="$omni_runtime $openrtm_py_runtime"
 
-python_dev_pkgs="$python_base $python_omni $openrtm_py_runtime $openrtm_py_devel"
-u_python_dev_pkgs="$python_omni $openrtm_py_runtime $openrtm_py_devel"
+python_dev_pkgs="$python_runtime_pkgs $python_devel $openrtm_py_devel"
+u_python_dev_pkgs="$u_python_runtime_pkgs $omnipy $openrtm_py_devel"
 
-python_core_pkgs="$python_base $python_omni $build_tools"
-u_python_core_pkgs="$python_omni"
+python_core_pkgs="$omni_runtime $python_runtime $python_devel $build_tools $rpm_tools"
+u_python_core_pkgs="$omni_runtime $omnipy"
 
 #--------------------------------------- Java
 java_devel="java-1.8.0-openjdk-devel"
-openrtm_java_devel="OpenRTM-aist-Java-doc"
-openrtm_java_runtime="OpenRTM-aist-Java OpenRTM-aist-Java-example"
+java_build="ant"
+openrtm_j_devel="OpenRTM-aist-Java-doc"
+openrtm_j_runtime="OpenRTM-aist-Java OpenRTM-aist-Java-example"
 
-java_dev_pkgs="$java_devel $omni_runtime $cmake_tools $openrtm_java_runtime $openrtm_java_devel"
-u_java_dev_pkgs="$omni_runtime $openrtm_java_runtime $openrtm_java_devel"
+java_runtime_pkgs="$omni_runtime $java_devel $openrtm_j_runtime"
+u_java_runtime_pkgs="$omni_runtime $openrtm_j_runtime"
 
-java_core_pkgs="$java_devel $omni_runtime $cmake_tools $build_tools"
+java_dev_pkgs="$java_runtime_pkgs $cmake_tools $openrtm_j_devel"
+u_java_dev_pkgs="$omni_runtime $openrtm_j_runtime $openrtm_j_devel"
+
+java_core_pkgs="$omni_runtime $java_devel $cmake_tools $build_tools $java_build $rpm_tools"
 u_java_core_pkgs="$omni_runtime"
 
 #--------------------------------------- OpenRTP
@@ -379,6 +384,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_p="[python] install tool_packages for core developer"
       install_packages $python_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] install robot component runtime"
+      install_packages $python_runtime_pkgs
     else
       select_opt_p="[python] install robot component developer"
       install_packages $python_dev_pkgs
@@ -389,6 +397,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_j="[java] install tool_packages for core developer"
       install_packages $java_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] install robot component runtime"
+      install_packages $java_runtime_pkgs
     else
       select_opt_j="[java] install robot component developer"
       install_packages $java_dev_pkgs
@@ -402,7 +413,7 @@
 
   if test "x$arg_rtshell" = "xtrue" ; then
     select_opt_shl="[rtshell] install"
-    install_packages $python_devel
+    install_packages python-pip
     rtshell_ret=`pip install rtshell`
   fi
 }
@@ -432,6 +443,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_p="[python] uninstall tool_packages for core developer"
       uninstall_packages `reverse $u_python_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] uninstall robot component runtime"
+      uninstall_packages `reverse $u_python_runtime_pkgs`
     else
       select_opt_p="[python] uninstall robot component developer"
       uninstall_packages `reverse $u_python_dev_pkgs`
@@ -442,6 +456,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_j="[java] uninstall tool_packages for core developer"
       uninstall_packages `reverse $u_java_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] uninstall robot component runtime"
+      uninstall_packages `reverse $u_java_runtime_pkgs`
     else
       select_opt_j="[java] uninstall robot component developer"
       uninstall_packages `reverse $u_java_dev_pkgs`
@@ -527,7 +544,7 @@
 =============================================
 EOF
   if [ $# -eq 0 ] && test "x$OPT_FLG" = "xtrue"; then
-    echo "There is no installation package."
+    echo "There is no uninstall package."
     return
   fi
 

Copied: branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_raspbian.sh (from rev 3015, trunk/OpenRTM-aist/build/pkg_install_raspbian.sh)
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_raspbian.sh	                        (rev 0)
+++ branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_raspbian.sh	2017-12-10 06:05:44 UTC (rev 3105)
@@ -0,0 +1,573 @@
+#!/bin/sh
+#
+# @file pkg_install_raspbian.sh
+# @brief OpenRTM-aist dependent packages install script for Debian
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#         Nobu Kawauchi
+#
+
+#---------------------------------------
+# usage
+#---------------------------------------
+usage()
+{
+  cat <<EOF
+  Usage: 
+
+    $(basename ${0}) [-l all/c++] [-r/-d/-s/-c] [-u]
+    $(basename ${0}) [-l python/java] [-r/-d/-c] [-u]
+
+  Example:
+    $(basename ${0})  [= $(basename ${0}) -l c++ -d]
+    $(basename ${0}) -l all -d  [= -l c++ -l python -l java -d]
+    $(basename ${0}) -l c++ -l python -c --yes
+
+  Options:
+    -l <argument>  language or tool [c++/python/java]
+    -r             install robot component runtime
+    -d             install robot component developer [default]
+    -s             install tool_packages for build source packages
+    -c             install tool_packages for core developer
+    -u             uninstall
+    --yes          force yes
+    --help, -h     print this
+EOF
+}
+
+#---------------------------------------
+# パッケージリスト
+#---------------------------------------
+default_reposerver="openrtm.org"
+reposervers="openrtm.org"
+reposerver=""
+
+#--------------------------------------- C++
+res=`grep wheezy /etc/os-release`
+if test ! "x$res" = "x" ; then
+  # wheezy
+  autotools="autoconf libtool"
+else
+  autotools="autoconf libtool libtool-bin"
+fi
+base_tools="bc iputils-ping net-tools zip"
+cxx_devel="gcc g++ make python-yaml"
+#cmake_tools="cmake doxygen graphviz nkf"
+cmake_tools="cmake doxygen"
+build_tools="subversion git"
+deb_pkg="uuid-dev libboost-filesystem-dev"
+pkg_tools="build-essential debhelper devscripts"
+omni_devel="libomniorb4-dev omniidl"
+omni_runtime="omniorb-nameserver"
+openrtm_devel="openrtm-aist-doc openrtm-aist-dev"
+openrtm_runtime="openrtm-aist openrtm-aist-example"
+
+runtime_pkgs="$omni_runtime $openrtm_runtime"
+u_runtime_pkgs=$runtime_pkgs
+
+src_pkgs="$cxx_devel $cmake_tools $deb_pkg $base_tools $omni_runtime $omni_devel"
+u_src_pkgs="$omni_runtime $omni_devel"
+
+dev_pkgs="$runtime_pkgs $src_pkgs $openrtm_devel"
+u_dev_pkgs="$u_runtime_pkgs $omni_devel $openrtm_devel"
+
+core_pkgs="$src_pkgs $build_tools $pkg_tools"
+u_core_pkgs="$u_src_pkgs"
+
+#--------------------------------------- Python
+omnipy="omniidl-python"
+python_runtime="python python-pyorbit-omg"
+python_devel="python-pip $cmake_tools $base_tools $omnipy"
+openrtm_py_devel="openrtm-aist-python-doc"
+openrtm_py_runtime="openrtm-aist-python openrtm-aist-python-example"
+
+python_runtime_pkgs="$omni_runtime $python_runtime $openrtm_py_runtime"
+u_python_runtime_pkgs="$omni_runtime $openrtm_py_runtime"
+
+python_dev_pkgs="$python_runtime_pkgs $python_devel $openrtm_py_devel"
+u_python_dev_pkgs="$u_python_runtime_pkgs $omnipy $openrtm_py_devel"
+
+python_core_pkgs="$omni_runtime $python_runtime $python_devel $build_tools $pkg_tools"
+u_python_core_pkgs="$omni_runtime $omnipy"
+
+#--------------------------------------- Java
+java_devel="default-jdk"
+java_build="ant"
+openrtm_j_devel="openrtm-aist-java-doc"
+openrtm_j_runtime="openrtm-aist-java openrtm-aist-java-example"
+
+java_runtime_pkgs="$omni_runtime $java_devel $openrtm_j_runtime"
+u_java_runtime_pkgs="$omni_runtime $openrtm_j_runtime"
+
+java_dev_pkgs="$java_runtime_pkgs $cmake_tools $base_tools $openrtm_j_devel"
+u_java_dev_pkgs="$omni_runtime $openrtm_j_runtime $openrtm_j_devel"
+
+java_core_pkgs="$omni_runtime $java_devel $cmake_tools $base_tools $build_tools $java_build $pkg_tools"
+u_java_core_pkgs="$omni_runtime"
+
+
+#---------------------------------------
+# Script options, argument analysis
+#---------------------------------------
+init_param()
+{
+OPT_RT=false
+OPT_DEV=false
+OPT_SRC=false
+OPT_CORE=false
+OPT_FLG=true
+install_pkgs=""
+uninstall_pkgs=""
+}
+
+check_arg()
+{
+  local arg=$1
+  arg_err=0
+  
+  case "$arg" in
+    all ) arg_all=true ;;
+    c++ ) arg_cxx=true ;;
+    python ) arg_python=true ;;
+    java ) arg_java=true ;;
+    *) arg_err=-1 ;;
+  esac
+}
+
+get_opt()
+{ 
+  # オプション指定が無い場合のデフォルト設定
+  if [ $# -eq 0 ] ; then
+    arg_cxx=true
+    OPT_DEV=true
+  fi
+  arg_num=$#
+ 
+  OPT=`getopt -o l:rcsdhu -l help,yes -- $@` > /dev/null 2>&1
+  # return code check
+  if [ $? -ne 0 ] ; then
+    echo "[ERROR] Invalid option '$1'"
+    usage
+    exit
+  fi
+  eval set -- $OPT
+
+  while true
+  do
+    case "$1" in
+        -h|--help ) usage ; exit ;;
+        --yes ) FORCE_YES=true ;;
+        -l )  if [ -z "$2" ] ; then
+                echo "$1 option requires an argument." 1>&2
+                exit
+              fi
+              check_arg $2
+              if [ "$arg_err" = "-1" ]; then
+                echo "[ERROR] Invalid argument '$2'"
+                usage
+                exit
+              fi
+              shift ;;
+        -r )  OPT_RT=true ;;
+        -d )  OPT_DEV=true ;;
+        -s )  OPT_SRC=true ;;
+        -c )  OPT_CORE=true ;;
+        -u )  OPT_FLG=false ;;
+        -- ) shift ; break ;;                 
+        * )
+          echo "Internal Error" 1>&2
+          exit ;;
+    esac
+    shift
+  done
+
+  # オプション指定が -u のみの場合
+  if [ $arg_num -eq 1 ] ; then
+    if test "x$OPT_FLG" = "xfalse" ; then 
+      arg_cxx=true
+    fi
+  fi
+}
+
+#---------------------------------------
+# ロケールの言語確認
+#---------------------------------------
+check_lang()
+{
+lang="en"
+
+locale | grep ja_JP > /dev/null && lang="jp"
+
+if test "$lang" = "jp" ;then
+    msg1="ディストリビューションを確認してください。\nDebianかUbuntu以外のOSの可能性があります。"
+    msg2="コードネーム :"
+    msg3="このOSはサポートしておりません。"
+    msg4="OpenRTM-aist のリポジトリが登録されていません。"
+    msg5="Source.list に OpenRTM-aist のリポジトリ: "
+    msg6="を追加します。よろしいですか?(y/n)[y] "
+    msg7="中断します。"
+    msg8="ルートユーザーで実行してください。"
+    msg9="インストール中です..."
+    msg10="完了"
+    msg11="アンインストール中です."
+else
+    msg1="This distribution may not be debian/ubuntu."
+    msg2="The code name is : "
+    msg3="This OS is not supported."
+    msg4="No repository entry for OpenRTM-aist is configured in your system."
+    msg5="repository entry for OpenRTM-aist: "
+    msg6="Do you want to add new repository entry for OpenRTM-aist in source.list? (y/n) [y] "
+    msg7="Abort."
+    msg8="This script should be run as root."
+    msg9="Now installing: "
+    msg10="done."
+    msg11="Now uninstalling: "
+fi
+
+}
+
+#---------------------------------------
+# コードネーム取得
+#---------------------------------------
+check_codename () {
+  cnames="wheezy jessie"
+  for c in $cnames; do
+    if test -f "/etc/apt/sources.list"; then
+      res=`grep $c /etc/apt/sources.list`
+    else
+      echo $msg1
+      exit
+    fi
+    if test ! "x$res" = "x" ; then
+      code_name=$c
+    fi
+  done
+  if test ! "x$code_name" = "x"; then
+    echo $msg2 $code_name
+  else
+    echo $msg3
+    exit
+  fi
+}
+
+#----------------------------------------
+# 近いリポジトリサーバを探す
+#----------------------------------------
+check_reposerver()
+{
+  minrtt=65535
+  nearhost=''
+  for host in $reposervers; do
+    rtt=`ping -c 1 $host | grep 'time=' | sed -e 's/^.*time=\([0-9\.]*\) ms.*/\1/' 2> /dev/null`
+    if test "x$rtt" = "x"; then
+      rtt=65535
+    fi
+    if test `echo "scale=2 ; $rtt < $minrtt" | bc` -gt 0; then
+      minrtt=$rtt
+      nearhost=$host
+    fi
+  done
+  if test "x$nearhost" = "x"; then
+    echo "Repository servers unreachable.", $hosts
+    echo "Check your internet connection. (or are you using proxy?)"
+    nearhost=$default_reposerver
+  fi
+  reposerver=$nearhost
+}
+
+#---------------------------------------
+# リポジトリサーバ
+#---------------------------------------
+create_srclist () {
+  openrtm_repo="deb http://$reposerver/pub/Linux/raspbian/ $code_name main"
+}
+
+#---------------------------------------
+# ソースリスト更新関数の定義
+#---------------------------------------
+update_source_list () {
+  rtmsite=`grep "$openrtm_repo" /etc/apt/sources.list`
+  if test "x$rtmsite" = "x" ; then
+    echo $msg4
+    echo $msg5
+    echo "  " $openrtm_repo
+    read -p "$msg6" kick_shell
+
+    if test "x$kick_shell" = "xn" ; then
+      echo $msg7
+      exit 0
+    else
+      echo $openrtm_repo >> /etc/apt/sources.list
+   # 公開鍵登録
+      #apt-key adv --keyserver keys.gnupg.net --recv-keys 4BCE106E087AFAC0
+    fi
+  fi
+}
+
+#----------------------------------------
+# root かどうかをチェック
+#----------------------------------------
+check_root () {
+  if test ! `id -u` = 0 ; then
+    echo ""
+    echo $msg8
+    echo $msg7
+    echo ""
+    exit 1
+  fi
+}
+
+#----------------------------------------
+# パッケージインストール関数
+#----------------------------------------
+install_packages () {
+  for p in $*; do
+    echo $msg9 $p
+    echo $install_pkgs | grep $p > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+      tmp_pkg="$install_pkgs $p"
+      install_pkgs=$tmp_pkg
+    fi
+
+    if test "x$FORCE_YES" = "xtrue" ; then
+      apt-get install --assume-yes --allow-unauthenticated $p
+    else
+      apt-get install $p
+    fi
+    if [ $? -ne 0 ]; then
+      echo $msg7
+      exit
+    fi
+    echo $msg10
+    echo ""
+  done
+}
+
+#------------------------------------------------------------
+# リストを逆順にする
+#------------------------------------------------------------
+reverse () {
+  for i in $*; do
+    echo $i
+  done | sed '1!G;h;$!d'
+}
+
+#----------------------------------------
+# パッケージをアンインストールする
+#----------------------------------------
+uninstall_packages () {
+  for p in $*; do
+    echo $msg11 $p
+    echo $uninstall_pkgs | grep $p > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+      tmp_pkg="$uninstall_pkgs $p"
+      uninstall_pkgs=$tmp_pkg
+    fi
+    apt-get --purge remove $p
+    if test "$?" != 0; then
+      apt-get purge $p
+    fi
+    echo $msg10
+    echo ""
+  done
+}
+
+#---------------------------------------
+# install_branch
+#---------------------------------------
+install_branch()
+{
+  if test "x$arg_cxx" = "xtrue" ; then
+    if test "x$OPT_CORE" = "xtrue" ; then
+      select_opt_c="[c++] install tool_packages for core developer"
+      install_packages $core_pkgs
+    elif test "x$OPT_SRC" = "xtrue" ; then
+      select_opt_c="[c++] install tool_packages for source packages"
+      install_packages $src_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_c="[c++] install robot component runtime"
+      install_packages $runtime_pkgs
+    else
+      select_opt_c="[c++] install robot component developer"
+      install_packages $dev_pkgs
+    fi
+  fi
+
+  if test "x$arg_python" = "xtrue" ; then
+    if test "x$OPT_CORE" = "xtrue" ; then
+      select_opt_p="[python] install tool_packages for core developer"
+      install_packages $python_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] install robot component runtime"
+      install_packages $python_runtime_pkgs
+    else
+      select_opt_p="[python] install robot component developer"
+      install_packages $python_dev_pkgs
+    fi
+  fi
+
+  if test "x$arg_java" = "xtrue" ; then
+    if test "x$OPT_CORE" = "xtrue" ; then
+      select_opt_j="[java] install tool_packages for core developer"
+      install_packages $java_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] install robot component runtime"
+      install_packages $java_runtime_pkgs
+    else
+      select_opt_j="[java] install robot component developer"
+      install_packages $java_dev_pkgs
+    fi
+  fi
+}
+
+#---------------------------------------
+# uninstall_branch
+#---------------------------------------
+uninstall_branch()
+{
+  if test "x$arg_cxx" = "xtrue" ; then
+    if test "x$OPT_CORE" = "xtrue" ; then
+      select_opt_c="[c++] uninstall tool_packages for core developer"
+      uninstall_packages `reverse $u_core_pkgs`
+    elif test "x$OPT_SRC" = "xtrue" ; then
+      select_opt_c="[c++] uninstall tool_packages for source packages"
+      uninstall_packages `reverse $u_src_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_c="[c++] uninstall robot component runtime"
+      uninstall_packages `reverse $u_runtime_pkgs`
+    else
+      select_opt_c="[c++] uninstall robot component developer"
+      uninstall_packages `reverse $u_dev_pkgs`
+    fi
+  fi
+
+  if test "x$arg_python" = "xtrue" ; then
+    if test "x$OPT_CORE" = "xtrue" ; then
+      select_opt_p="[python] uninstall tool_packages for core developer"
+      uninstall_packages `reverse $u_python_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] uninstall robot component runtime"
+      uninstall_packages `reverse $u_python_runtime_pkgs`
+    else
+      select_opt_p="[python] uninstall robot component developer"
+      uninstall_packages `reverse $u_python_dev_pkgs`
+    fi
+  fi
+
+  if test "x$arg_java" = "xtrue" ; then
+    if test "x$OPT_CORE" = "xtrue" ; then
+      select_opt_j="[java] uninstall tool_packages for core developer"
+      uninstall_packages `reverse $u_java_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] uninstall robot component runtime"
+      uninstall_packages `reverse $u_java_runtime_pkgs`
+    else
+      select_opt_j="[java] uninstall robot component developer"
+      uninstall_packages `reverse $u_java_dev_pkgs`
+    fi
+  fi
+}
+
+#---------------------------------------
+# print_option
+#---------------------------------------
+print_option()
+{
+  cat <<EOF
+
+=============================================
+ Selected options is ...
+=============================================
+EOF
+
+  if test ! "x$select_opt_c" = "x" ; then
+    echo $select_opt_c
+  fi
+  if test ! "x$select_opt_p" = "x" ; then
+    echo $select_opt_p
+  fi
+  if test ! "x$select_opt_j" = "x" ; then
+    echo $select_opt_j
+  fi
+}
+
+#---------------------------------------
+# install_result
+#---------------------------------------
+install_result()
+{
+  print_option
+  cat <<EOF
+
+=============================================
+ Install package is ...
+=============================================
+EOF
+  if [ $# -eq 0 ] && test "x$OPT_FLG" = "xfalse"; then
+    echo "There is no installation package."
+    return
+  fi
+
+  for p in $*; do
+    echo $p
+  done
+}
+
+#---------------------------------------
+# uninstall_result
+#---------------------------------------
+uninstall_result()
+{
+  cat <<EOF
+
+=============================================
+ Uninstall package is ...
+=============================================
+EOF
+  if [ $# -eq 0 ] && test "x$OPT_FLG" = "xtrue"; then
+    echo "There is no uninstall package."
+    return
+  fi
+
+  for p in $*; do
+    echo $p
+  done
+}
+
+#---------------------------------------
+# メイン
+#---------------------------------------
+init_param
+get_opt $@
+
+check_lang
+check_root
+#check_reposerver
+reposerver=$default_reposerver
+check_codename
+create_srclist
+update_source_list
+apt-get autoclean
+apt-get update
+
+if test "x$arg_all" = "xtrue" ; then
+  arg_cxx=true
+  arg_python=true
+  arg_java=true
+
+  if test "x$OPT_RT" != "xtrue" && 
+     test "x$OPT_DEV" != "xtrue" &&
+     test "x$OPT_SRC" != "xtrue" && 
+     test "x$OPT_CORE" != "xtrue" ; then
+    # set default option
+    OPT_DEV=true
+  fi
+fi
+
+if test "x$OPT_FLG" = "xtrue" ; then
+  install_branch
+else
+  uninstall_branch
+fi
+
+install_result $install_pkgs
+uninstall_result $uninstall_pkgs

Modified: branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_ubuntu.sh
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_ubuntu.sh	2017-12-10 06:03:23 UTC (rev 3104)
+++ branches/RELENG_1_2/OpenRTM-aist/build/pkg_install_ubuntu.sh	2017-12-10 06:05:44 UTC (rev 3105)
@@ -19,7 +19,7 @@
   Usage: 
 
     $(basename ${0}) [-l all/c++] [-r/-d/-s/-c] [-u]
-    $(basename ${0}) [-l python/java] [-d/-c] [-u]
+    $(basename ${0}) [-l python/java] [-r/-d/-c] [-u]
     $(basename ${0}) [-l openrtp/rtshell] [-d] [-u]                           
 
   Example:
@@ -50,11 +50,17 @@
 reposerver=""
 
 #--------------------------------------- C++
-autotools="autoconf libtool libtool-bin"
+res=`grep 14.04 /etc/lsb-release`
+if test ! "x$res" = "x" ; then
+  # 14.04
+  autotools="autoconf libtool"
+else
+  autotools="autoconf libtool libtool-bin"
+fi
 base_tools="bc iputils-ping net-tools"
 cxx_devel="gcc g++ make python-yaml"
-cmake_tools="cmake doxygen"
-build_tools="subversion"
+cmake_tools="cmake doxygen graphviz nkf"
+build_tools="subversion git"
 deb_pkg="uuid-dev libboost-filesystem-dev"
 pkg_tools="build-essential debhelper devscripts"
 omni_devel="libomniorb4-dev omniidl"
@@ -65,39 +71,44 @@
 runtime_pkgs="$omni_runtime $openrtm_runtime"
 u_runtime_pkgs=$runtime_pkgs
 
-src_pkgs="$cxx_devel $cmake_tools $deb_pkg $omni_runtime $omni_devel"
+src_pkgs="$cxx_devel $cmake_tools $deb_pkg $base_tools $omni_runtime $omni_devel"
 u_src_pkgs="$omni_runtime $omni_devel"
 
 dev_pkgs="$runtime_pkgs $src_pkgs $openrtm_devel"
 u_dev_pkgs="$u_runtime_pkgs $omni_devel $openrtm_devel"
 
-core_pkgs="$src_pkgs $autotools $base_tools $build_tools $pkg_tools"
+core_pkgs="$src_pkgs $autotools $build_tools $pkg_tools"
 u_core_pkgs="$u_src_pkgs"
 
 #--------------------------------------- Python
 omnipy="omniidl-python"
-python_devel="python python-pip python-pyorbit-omg"
+python_runtime="python python-pyorbit-omg"
+python_devel="python-pip $cmake_tools $base_tools $omnipy"
 openrtm_py_devel="openrtm-aist-python-doc"
 openrtm_py_runtime="openrtm-aist-python openrtm-aist-python-example"
 
-python_base="$python_devel $cmake_tools"
-python_omni="$omni_runtime $omnipy"
+python_runtime_pkgs="$omni_runtime $python_runtime $openrtm_py_runtime"
+u_python_runtime_pkgs="$omni_runtime $openrtm_py_runtime"
 
-python_dev_pkgs="$python_base $python_omni $openrtm_py_runtime $openrtm_py_devel"
-u_python_dev_pkgs="$python_omni $openrtm_py_runtime $openrtm_py_devel"
+python_dev_pkgs="$python_runtime_pkgs $python_devel $openrtm_py_devel"
+u_python_dev_pkgs="$u_python_runtime_pkgs $omnipy $openrtm_py_devel"
 
-python_core_pkgs="$python_base $python_omni $build_tools"
-u_python_core_pkgs="$python_omni"
+python_core_pkgs="$omni_runtime $python_runtime $python_devel $build_tools $pkg_tools"
+u_python_core_pkgs="$omni_runtime $omnipy"
 
 #--------------------------------------- Java
 java_devel="default-jdk"
-openrtm_java_devel="openrtm-aist-java-doc"
-openrtm_java_runtime="openrtm-aist-java openrtm-aist-java-example"
+java_build="ant"
+openrtm_j_devel="openrtm-aist-java-doc"
+openrtm_j_runtime="openrtm-aist-java openrtm-aist-java-example"
 
-java_dev_pkgs="$java_devel $omni_runtime $cmake_tools $openrtm_java_runtime $openrtm_java_devel"
-u_java_dev_pkgs="$omni_runtime $openrtm_java_runtime $openrtm_java_devel"
+java_runtime_pkgs="$omni_runtime $java_devel $openrtm_j_runtime"
+u_java_runtime_pkgs="$omni_runtime $openrtm_j_runtime"
 
-java_core_pkgs="$java_devel $omni_runtime $cmake_tools $build_tools"
+java_dev_pkgs="$java_runtime_pkgs $cmake_tools $base_tools $openrtm_j_devel"
+u_java_dev_pkgs="$omni_runtime $openrtm_j_runtime $openrtm_j_devel"
+
+java_core_pkgs="$omni_runtime $java_devel $cmake_tools $base_tools $build_tools $java_build $pkg_tools"
 u_java_core_pkgs="$omni_runtime"
 
 #--------------------------------------- OpenRTP
@@ -317,7 +328,7 @@
 install_packages () {
   for p in $*; do
     echo $msg9 $p
-    dpkg -l | grep $p > /dev/null 2>&1
+    echo $install_pkgs | grep $p > /dev/null 2>&1
     if [ $? -ne 0 ]; then
       tmp_pkg="$install_pkgs $p"
       install_pkgs=$tmp_pkg
@@ -352,9 +363,11 @@
 uninstall_packages () {
   for p in $*; do
     echo $msg11 $p
-    tmp_pkg="$uninstall_pkgs $p"
-    uninstall_pkgs=$tmp_pkg
-
+    echo $uninstall_pkgs | grep $p > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+      tmp_pkg="$uninstall_pkgs $p"
+      uninstall_pkgs=$tmp_pkg
+    fi
     apt-get --purge remove $p
     if test "$?" != 0; then
       apt-get purge $p
@@ -389,6 +402,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_p="[python] install tool_packages for core developer"
       install_packages $python_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] install robot component runtime"
+      install_packages $python_runtime_pkgs
     else
       select_opt_p="[python] install robot component developer"
       install_packages $python_dev_pkgs
@@ -399,6 +415,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_j="[java] install tool_packages for core developer"
       install_packages $java_core_pkgs
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] install robot component runtime"
+      install_packages $java_runtime_pkgs
     else
       select_opt_j="[java] install robot component developer"
       install_packages $java_dev_pkgs
@@ -412,7 +431,7 @@
 
   if test "x$arg_rtshell" = "xtrue" ; then
     select_opt_shl="[rtshell] install"
-    install_packages $python_devel
+    install_packages python-pip
     rtshell_ret=`pip install rtshell`
   fi
 }
@@ -442,6 +461,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_p="[python] uninstall tool_packages for core developer"
       uninstall_packages `reverse $u_python_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_p="[python] uninstall robot component runtime"
+      uninstall_packages `reverse $u_python_runtime_pkgs`
     else
       select_opt_p="[python] uninstall robot component developer"
       uninstall_packages `reverse $u_python_dev_pkgs`
@@ -452,6 +474,9 @@
     if test "x$OPT_CORE" = "xtrue" ; then
       select_opt_j="[java] uninstall tool_packages for core developer"
       uninstall_packages `reverse $u_java_core_pkgs`
+    elif test "x$OPT_RT" = "xtrue" ; then
+      select_opt_j="[java] uninstall robot component runtime"
+      uninstall_packages `reverse $u_java_runtime_pkgs`
     else
       select_opt_j="[java] uninstall robot component developer"
       uninstall_packages `reverse $u_java_dev_pkgs`
@@ -537,7 +562,7 @@
 =============================================
 EOF
   if [ $# -eq 0 ] && test "x$OPT_FLG" = "xtrue"; then
-    echo "There is no installation package."
+    echo "There is no uninstall package."
     return
   fi
 



More information about the openrtm-commit mailing list