[openrtm-commit:02481] r801 - in trunk/OpenRTM-aist-Python: . install_scripts

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 2月 22日 (水) 17:01:11 JST


Author: kawauchi
Date: 2017-02-22 17:01:11 +0900 (Wed, 22 Feb 2017)
New Revision: 801

Added:
   trunk/OpenRTM-aist-Python/install_scripts/
   trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh
   trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh
   trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh
   trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh
Log:
[compat,bugfix,->RELENG_1_2] Install_scripts deleted with r767 has been restored.

Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh	                        (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_debian.sh	2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,204 @@
+#!/bin/sh
+#
+# @file pkg_install_debian.sh
+# @brief OpenRTM-aist dependent packages install script for Debian-sarge
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#         Shinji Kurihara
+#         Tetsuo Ando
+#         Harumi Miyamoto
+#         Nobu Kawauchi
+#         Saburo Takahashi
+#
+
+# Usage: sudo pkg_install_python_debian.sh [-u -y -h]
+# option -u            : Uninstall tool_packages.
+# option -y            : When yes/no prompt for installing would be presente    d, assume that the user entered "yes".
+# option -h            : Display a brief help message.
+#
+
+
+#---------------------------------------
+# パッケージリスト
+#---------------------------------------
+set_package_list()
+{
+	omnipy="python-omniorb-omg python-omniorb omniidl-python"
+	devel="python"
+	openrtm="openrtm-aist-python openrtm-aist-python-example"
+	packages="$devel $omnipy $openrtm"
+	u_packages="$omnipy $openrtm "
+}
+
+#---------------------------------------
+# ロケールの言語確認
+#---------------------------------------
+check_lang()
+{
+lang="en"
+
+locale | grep ja_JP > /dev/null && lang="jp"
+
+if test "$lang" = "jp" ;then
+    msg1="ディストリビューションを確認してください。\nDebian以外のOSの可能性があります。"
+    msg2="コードネーム : "
+    msg3="このOSはサポートされておりません。"
+    msg4=" OpenRTM-aistのリポジトリが登録されていません。"
+    msg5="Source.listにOpenrRTM-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 OpenrRTM-aist: "
+    msg6="Do you want to add the repository entry for OpenrRTM-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="sarge etch lenny squeeze 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
+}
+
+#---------------------------------------
+# リポジトリサーバ
+#---------------------------------------
+create_srclist () {
+    openrtm_repo="deb http://openrtm.org/pub/Linux/debian/ $code_name main"
+}
+
+#---------------------------------------
+# ソースリスト更新関数の定義
+#---------------------------------------
+update_source_list () {
+    rtmsite=`grep openrtm /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
+	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
+	apt-get install $p $force_yes
+	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
+	aptitude remove $p
+	echo $msg10
+	echo ""
+    done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+    cat << EOF
+Usage: sudo $0 [-u -y -h]
+       option -u            : Uninstall tool_packages.
+       option -y            : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+       option -h            : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# メイン
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+    howto_usage
+    exit 1
+fi
+
+check_lang
+check_root
+check_codename
+set_package_list
+
+if test "x$1" = "x-y" ; then
+    force_yes="-y --force-yes"
+fi
+
+if test "x$1" = "x-u" ; then
+    uninstall_packages `reverse $u_packages`
+else
+    create_srclist
+    update_source_list
+    apt-get update
+    install_packages $packages
+fi
+

Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh	                        (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_fedora.sh	2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,191 @@
+#!/bin/sh
+#
+# @file pkg_install_fedora.sh
+# @brief OpenRTM-aist dependent packages install script for Fedora
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#         Shinji Kurihara
+#         Tetsuo Ando
+#         Nobu Kawauchi
+#         Saburo Takahashi
+#
+# このシェルスクリプトは、aceおよびomniORBのパッケージをインストールし、
+# fedoraの開発環境を構築します。
+#
+# $Id$
+#
+
+# Usage: sudo pkg_install_python_fedora.sh [-u -y -h]
+# option -u            : Uninstall tool_packages.
+# option -y            : When yes/no prompt for installing would be presente    d, assume that the user entered "yes".
+# option -h            : Display a brief help message.
+#
+
+
+#---------------------------------------
+# パッケージリスト
+#---------------------------------------
+version_num=`cat /etc/fedora-release | awk '/Fedora/{print $3}' -`
+if [ $version_num -le 19 ]; then
+    omnipy="omniORB-servers omniORBpy omniORBpy-devel omniORBpy-standard"
+else
+    omnipy="omniORB-servers python-omniORB omniORBpy-devel"
+fi
+devel="python"
+openrtm="OpenRTM-aist-Python OpenRTM-aist-Python-example"
+packages="$devel $omnipy $openrtm"
+u_packages="$omnipy $openrtm "
+
+#---------------------------------------
+# yum / dnf コマンド切替え
+#---------------------------------------
+if [ $version_num -ge 22 ]; then
+    COMMAND="dnf"
+else
+    COMMAND="yum"
+fi
+
+#----------------------------------------
+# root かどうかをチェック
+#----------------------------------------
+check_root () {
+    if test ! `id -u` = 0 ; then
+	echo ""
+	echo "This script should be run by root user."
+	echo "Abort."
+	echo ""
+	exit 1
+    fi
+}
+
+#---------------------------------------
+# インストール済パッケージリスト
+#---------------------------------------
+rpm_qa="/tmp/yum_list.txt"
+get_pkg_list () {
+    rpm -qa > $rpm_qa
+}
+clean_pkg_list () {
+    rm -f $rpm_qa
+}
+
+#---------------------------------------
+# リポジトリサイト設定ファイルを生成
+#---------------------------------------
+openrtm_repo () {
+cat <<EOF
+[openrtm]
+name=Fedora \$releasever - \$basearch
+failovermethod=priority
+baseurl=http://openrtm.org/pub/Linux/Fedora/releases/\$releasever/Fedora/\$basearch/os/Packages
+enabled=1
+gpgcheck=0
+gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora file:///etc/pki/rpm-gpg/RPM-GPG-KEY
+EOF
+} 
+create_repo() {
+    repo="/etc/yum.repos.d/openrtm.repo"
+    if test ! -f $repo ; then
+	echo "OpenRTM-aist のリポジトリが登録されていません。"
+	echo "OpenRTM-aist のリポジトリ: "
+	echo "  http://www.openrtm.org/pub/Linux/Fedora/"
+	read -p "を追加します。よろしいですか? (y/n) [y] " kick_shell
+
+	if test "x$kick_shell" = "xn" ; then
+	    echo "中断します。"
+	    exit 0
+	else
+	    openrtm_repo > /etc/yum.repos.d/openrtm.repo
+	fi
+    fi
+}
+
+#----------------------------------------
+# パッケージインストール関数
+#----------------------------------------
+install_packages () {
+    for p in $*; do
+	if test "x$p" = "x0.4.2" || test "x$p" = "x0.4.2" ; then
+	    :
+	else
+	    if echo "$p" | grep -q '=0.4.2' ; then
+		str=`echo "$p" |sed 's/=0.4.2//'`
+	    else
+		str="$p"
+	    fi
+
+	    ins=`rpm -qa $str`
+
+	    if test "x$ins" = "x"; then
+		echo "Now installing: " $p
+		$COMMAND install $p $force_yes
+		echo "done."
+		echo ""
+	    else
+		if echo "$ins" |grep -q '0.4.2-0' ; then
+			$COMMAND install $p
+			echo "done."
+			echo ""
+	       else
+ 		    echo $ins
+		    echo $str "is already installed."
+		    echo ""
+		fi
+	    fi
+	fi
+    done
+}
+
+
+#------------------------------------------------------------
+# リストを逆順にする
+#------------------------------------------------------------
+reverse () {
+    for i in $*; do
+	echo $i
+    done | sed '1!G;h;$!d'
+}
+
+#----------------------------------------
+# パッケージをアンインストールする
+#----------------------------------------
+uninstall_packages () {
+    for p in $*; do
+	echo "Now uninstalling: " $p
+	$COMMAND erase $p
+	echo "done."
+	echo ""
+    done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+    cat << EOF
+Usage: sudo $0 [-u -y -h]
+       option -u            : Uninstall tool_packages.
+       option -y            : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+       option -h            : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# メイン
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+    howto_usage
+    exit 1
+fi
+
+check_root
+
+if test "x$1" = "x-y" ; then
+    force_yes="-y"
+fi
+
+if test "x$1" = "x-u" ; then
+    uninstall_packages `reverse $u_packages`
+else
+    create_repo
+    install_packages $packages
+fi

Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh	                        (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_ubuntu.sh	2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,216 @@
+#!/bin/sh
+#
+# @file pkg_install_ubuntu.sh
+# @brief OpenRTM-aist dependent packages install script for Debian-sarge
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#         Shinji Kurihara
+#         Tetsuo Ando
+#         Harumi Miyamoto
+#         Nobu Kawauchi
+#         Saburo Takahashi
+#
+
+# Usage: sudo pkg_install_python_ubuntu.sh [-u -y -h]
+# option -u            : Uninstall tool_packages.
+# option -y            : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+# option -h            : Display a brief help message.
+#
+
+this_file=${0##*/}
+
+rtm_ver=`echo "$this_file" | sed -e "s/pkg_install_python_ubuntu-//g" -e "s/\.sh//g"`
+
+if test "$rtm_ver" = "pkg_install_python_ubuntu";then
+	rtm_ver=""
+else
+	rtm_ver="=$rtm_ver"
+fi
+
+echo "rtm_ver is $rtm_ver"
+
+#---------------------------------------
+# パッケージリスト
+#---------------------------------------
+set_package_list()
+{
+	omnipy="python-pyorbit-omg omniidl-python"
+	devel="python"
+	openrtm="openrtm-aist-python$rtm_ver openrtm-aist-python-example$rtm_ver"
+	packages="$devel $omnipy $openrtm"
+	u_packages="$omnipy $openrtm "
+}
+
+#---------------------------------------
+# ロケールの言語確認
+#---------------------------------------
+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 OpenrRTM-aist: "
+    msg6="Do you want to add new repository entry for OpenrRTM-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 () {
+    codename=`sed -n /DISTRIB_CODENAME=/p /etc/lsb-release`
+    cnames=`echo "$codename" | sed 's/DISTRIB_CODENAME=//'`
+    #cnames="sarge edgy feisty gutsy hardy intrepid"
+    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
+}
+
+#---------------------------------------
+# リポジトリサーバ
+#---------------------------------------
+create_srclist () {
+    openrtm_repo="deb http://openrtm.org/pub/Linux/ubuntu/ $code_name main"
+}
+
+#---------------------------------------
+# ソースリスト更新関数の定義
+#---------------------------------------
+update_source_list () {
+    rtmsite=`grep openrtm /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
+	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
+	apt-get install $p $force_yes
+	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
+	aptitude remove $p
+	echo $msg10
+	echo ""
+    done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+    cat << EOF
+Usage: sudo $0 [-u -y -h]
+       option -u            : Uninstall tool_packages.
+       option -y            : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+       option -h            : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# メイン
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+    howto_usage
+    exit 1
+fi
+
+check_lang
+check_root
+check_codename
+set_package_list
+
+if test "x$1" = "x-y" ; then
+    force_yes="-y --force-yes"
+fi
+
+if test "x$1" = "x-u" ; then
+    uninstall_packages `reverse $u_packages`
+else
+    create_srclist
+    update_source_list
+    apt-get update
+    install_packages $packages
+fi
+

Added: trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh
===================================================================
--- trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh	                        (rev 0)
+++ trunk/OpenRTM-aist-Python/install_scripts/pkg_install_python_vine.sh	2017-02-22 08:01:11 UTC (rev 801)
@@ -0,0 +1,163 @@
+#!/bin/sh
+#
+# @file pkg_install_vine.sh
+# @brief OpenRTM-aist dependent packages installation script for Vine Linux
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#         Shinji Kurihara
+#         Tetsuo Ando
+#         Saburo Takahashi
+#
+# このシェルスクリプトは、aceおよびomniORBのパッケージをインストールし、
+# Vine Linuxの開発環境を構築します。
+#
+# Usage: sudo pkg_install_python_vine.sh [-u -y -h]
+# option -u            : Uninstall tool_packages.
+# option -y            : When yes/no prompt for installing would be presente    d, assume that the user entered "yes".
+# option -h            : Display a brief help message.
+#
+
+#---------------------------------------
+# Vineバージョン特定
+#---------------------------------------
+vinever=`cat /etc/vine-release | sed 's/.*\([0-9].[0-9]\).*/\1/'`
+
+#---------------------------------------
+# リポジトリサーバ
+#---------------------------------------
+openrtm_repo="rpm     http://www.openrtm.org/pub/Linux/Vine/apt $vinever/\$(ARCH) main"
+
+#---------------------------------------
+# パッケージリスト
+#---------------------------------------
+omnipy="python omniORB-servers omniORBpy omniORBpy-devel omniORBpy-standard"
+openrtm="OpenRTM-aist-Python OpenRTM-aist-Python-example"
+packages="$omnipy $openrtm"
+
+
+
+
+#----------------------------------------
+# root かどうかをチェック
+#----------------------------------------
+check_root () {
+    if test ! `id -u` = 0 ; then
+	echo ""
+	echo "This script should be run by root user."
+	echo "Abort."
+	echo ""
+	exit 1
+    fi
+}
+
+#---------------------------------------
+# ソースリスト更新関数の定義
+#---------------------------------------
+update_source_list () {
+    rtmsite=`grep openrtm /etc/apt/sources.list`
+    if test "x$rtmsite" = "x" ; then
+	echo "OpenRTM-aist のリポジトリが登録されていません。"
+	echo "Source.list に OpenRTM-aist のリポジトリ: "
+	echo "  " $openrtm_repo
+	read -p "を追加します。よろしいですか? (y/n) [y] " kick_shell
+
+	if test "x$kick_shell" = "xn" ; then
+	    echo "中断します。"
+	    exit 0
+	else
+	    echo $openrtm_repo >> /etc/apt/sources.list
+	fi
+    fi
+}
+
+#----------------------------------------
+# パッケージをインストールする
+#----------------------------------------
+install_packages () {
+    for p in $*; do
+	if test "x$p" = "x0.4.2" ; then
+	    :
+	else
+	    if echo "$p" | grep -q '=0.4.2' ; then
+		str=`echo "$p" |sed 's/=0.4.2//'`
+	    else
+		str="$p"
+	    fi
+
+	    ins=`rpm -qa $str`
+
+	    if test "x$ins" = "x"; then
+		echo "Now installing: " $p
+		apt-get install $p $force_yes
+		echo "done."
+		echo ""
+	    else
+		if echo "$ins" |grep -q '0.4.2-0' ; then
+			apt-get install $p $force_yes
+			echo "done."
+			echo ""
+	       else
+ 		    echo $ins
+		    echo $str "is already installed."
+		    echo ""
+		fi
+	    fi
+	fi
+    done
+}
+
+
+#------------------------------------------------------------
+# リストを逆順にする
+#------------------------------------------------------------
+reverse () {
+    for i in $*; do
+	echo $i
+    done | sed '1!G;h;$!d'
+}
+
+#----------------------------------------
+# パッケージをアンインストールする
+#----------------------------------------
+uninstall_packages () {
+    for p in $*; do
+	echo "Now uninstalling: " $p
+	rpm -e $p
+	echo "done."
+	echo ""
+    done
+}
+
+#---------------------------------------
+# USAGE
+#---------------------------------------
+howto_usage(){
+    cat << EOF
+Usage: sudo $0 [-u -y -h]
+       option -u            : Uninstall tool_packages.
+       option -y            : When yes/no prompt for installing would be presented, assume that the user entered "yes".
+       option -h            : Display a brief help message.
+EOF
+}
+
+#---------------------------------------
+# メイン
+#---------------------------------------
+if test "x$1" = "x-h" ; then
+    howto_usage
+    exit 1
+fi
+
+check_root
+
+if test "x$1" = "x-y" ; then
+    force_yes="-y --force-yes"
+fi
+
+if test "x$1" = "x-u" ; then
+    uninstall_packages `reverse $packages`
+else
+    update_source_list
+    apt-get update
+    install_packages $packages
+fi
+



openrtm-commit メーリングリストの案内