Show page source of Install/openSolaris #28021

= gnviewのインストール(openSolaris):作成中

== 1. 環境の準備
 1. 外部ネットワークへのアクセスができない場合は、設定を変更します
   2. メニューバーから![システム]-![システム管理]-![サービスの管理]を起動します
   2. "physical network interface autoconfiguration(network/physical:nwam)"のチェックを外し、OKを押します
   2. メニューバーから![システム]-![システム管理]-![Network]を起動します
   2. インターフェイスに適切な設定を行います(作者の場合、インターフェイスがdisableされていたので、有効にし、DHCPでアドレスを取得するようにしました)
   2. OKを押してウィンドウを閉じます
   2. 必要に応じてシステムを再起動します。(再起動しなくてもネットワークを有効にできるとは思いますが、作者はめんどくさかったので再起動しました)
   2. 再起動後、再度"physical network interface autoconfiguration(network/physical:nwam)"のチェックを入れ、OKを押します(作者はここでもう一度再起動し、再起動後にネットワークが使用できることを確認しました)
 1. メニューバーから![システム]-![システム管理]-![Package Manager]を起動します
 1. 以下のパッケージをインストールするようにチェックを入れ、Installボタンを押します
   * SUNWgcc
   * SUNWgnome-common-devel
   * SUNWxwinc
   * SUNWxorg-headers
 1. 依存性が自動的に解決され、関連するパッケージも同時にインストールされます
 1. インストールが終わったら、Package Managerのウィンドウを閉じます

== 2. ithreads対応perlの作成
openSolarisのパッケージになっているperlはithreadsに対応していないため、ithreads対応にビルドしたperlを別ディレクトリにインストールします。(以下の手順では/opt/local以下にインストールしています。パッケージに影響を及ぼさないディレクトリであればどこでも良いと思います)

 3. perlを公式サイトより取得します(作者は最新のstableである、5.10.0にしました)
{{{
 # wget http://www.cpan.org/src/perl-5.10.0.tar.gz
}}}
 4. 以下のようにperlを作成します
{{{
# mkdir -p /opt/local/bin
# gzcat perl-5.10.0.tar.gz |tar xvf -
# cd perl-5.10.0

# sh Configure
(以下は[ENTER]キー以外のタイプをする箇所を抜粋しています)

Installation prefix to use? (~name ok) [/usr/local] /opt/local

Build a threading Perl? [n] y

Use which C compiler? [cc] /usr/gnu/bin/cc

# make
# make test
# make install
# /opt/local/bin/perl -V


Summary of my perl5 (revision 5 version 10 subversion 0) configuration:

(中略)
    useithreads=define, usemultiplicity=define
    ^^^^^^^^^^^^^^^^^^<-これを確認
}}}

== 3. cpanの設定

 1. Bundle::CPANモジュールをインストールします
{{{
# /opt/local/bin/cpan
cpan> install Bundle::CPAN
cpan> q

}}}
   2. CPANからのデータが取得できない場合はConfig.pmを削除して初期設定をやり直します
{{{
(データが取得できなかった場合の表示)
Conld not fetch modules/03modlist.data.gz
Going to write /root/.cpan/Metadata
Warning: Cannot install Bundle::CPAN, don't know ehat it is.
Try the command

    i /Bundle::CPAN/

to find objects with matching identifiers.

cpan>

(cpanを終了)
cpan> q

(設定ファイルを削除)
# rm -rf ./.cpan
# cd /opt/local/lib/perl5/5.10.0/CPAN
# rm -f ./Config.pm*

(初期設定をやり直し)
# cd
# /opt/local/bin/cpan
}}}

== 4. perlモジュールのインストール

 2. 以下の手順で各モジュールをビルドします
{{{
# /opt/local/bin/cpan

Always commit changes to config variables to disk? [no] yes

(モジュールを順番にインストールします)
cpan[2]> install ExtUtils::Depends
cpan[3]> install HTML::TokeParser

(以下の表示(依存性解決)が出ますので、yesをタイプして依存するモジュールをインストールします)
----- Unsatisfied dependencirs detected during -----
-----       GAAS/HTML-Parser-3.56.tar.gz       -----
     HTML::Tagset [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes] <-- [ENTER]もしくはyes[ENTER]

cpan[4]> install ExtUtils::PkgConfig
cpan[5]> install Glib
cpan[6]> install Cairo

(以下の表示(依存性解決)が出ますので、yesをタイプして依存するモジュールをインストールします)
----- Unsatisfied dependencirs detected during -----
-----          TSCH/Cairo-1.044.tar.gz         -----
     Test::Number::Delta [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes] <-- [ENTER]もしくはyes[ENTER]

cpan[7]> install Gtk2

 (test時にエラーが出てインストールできないことがあります。(私の場合は必ずエラーになりました)
  force install Gtk2 で無理矢理インストールできますがgnviewが動かない場合が
  あります。自己責任でどうぞ)

cpan[8]> install Gtk2::GladeXML
cpan[9]> install HTTP::Date

(以下の表示(依存性解決)が出ますので、yesをタイプして依存するモジュールをインストールします)
----- Unsatisfied dependencirs detected during -----
-----       GAAS/libwww-perl-5.808.tar.gz      -----
     URI [requires]
Shall I follow them and prepend them to the queue
of modules we are processing right now? [yes] <-- [ENTER]もしくはyes[ENTER]

cpan[10]> q

#
}}}

== 5. gnviewのインストール

 1. [https://sourceforge.jp/projects/gnview/files/ gnviewのリリースページ]から最新のtarballを取得します
 2. 以下のようにインストールします
{{{
# gzcat gnview-0.8.5.tar.gz | tar xvf -
# cd gnview-0.8.5
# mkdir -p /usr/share/gnview
# cp -p gnview.glade 1pix* gnview_*.pl /usr/share/gnview
# cp -p gnview /usr/bin
# chmod 755 /usr/bin/gnview
(以下は必要に応じて)
# cp -p gnview.desktop /usr/share/applications
}}}
 3. /usr/bin/gnviewをエディタで開いて編集します
{{{
(変更前)
#!/usr/bin/perl -w
(変更後)
#!/opt/local/bin/perl -w
}}}