Messages in cipher reflected in the looking glass
[ Yasuhiro Fujitsuki's Weblog ]
http://blogs.sun.com/thaniwa/date/20050509 2005年 5月 09日 月曜日

(JA) LG3D rpm build Part2

LG3Dのrpmは /opt/lg3d 以下にインストールを行います。
/opt/lg3dのディレクトリ構造、配置されるファイルは tar.gz版との違いはありません。

また、rpmを利用してLG3Dをインストールした場合、 /usr/bin/lg3d-dev, /usr/bin/lg3d-session, /usr/sbin/lg3d-setup という3つのファイルもインストールされます。 これは、tar.gzリリースには含まれていない、rpm版独自のファイルです。

rpmでは依存関係の設定ができるため、本来はインストール時点で、 JDK/JRE 1.5,JAI,Java3Dがインストールされているかどうかを確認することができます。
本来は、これを用いるべきなのですが、現在のrpmではそのチェックを行わないようにしています。 (JDKのディレクトリがバージョン毎に変わる、Java3D等はrpm化されていないなど、 様々な理由によります。)
そのため、lg3d-devは、JAVA_HOME環境変数を設定しないと実行はできませんが、 その手間を軽減するために、/usr/sbin/lg3d-setupというコマンドを追加しました。

/usr/sbin/lg3d-setupはJDK/JRE, JAI, Java3Dがインストールされているかどうかを確認し、 そのディレクトリをJAVA_HOMEとして、/usr/bin/lg3d-dev,/usr/lg3d-sessionをアップデートする というスクリプトです。

/usr/sbin/lg3d-setupでは、/usr/java以下にインストールされているJDK/JREのみをチェックします。
JDK/JREのデフォルトでのディレクトリ名を考慮し、最新版を優先するように一応配慮しています。 (ただし、現状ではJava3D,JAIはインストールは確認しますが、バージョンまでは確認しません。)

ただ、β版のJava3D等を利用するため、別のディレクトリにJDK/JREをインストールしている 場合もあるかもしれません。そのような場合は、/usr/sbin/lg3d-setupを実行する前に、
export JAVA_HOME /home/hoge/jdk1.5.0
のようにJAVA_HOMEを設定しておけば、そのディレクトリを検索対象とするようにしています。
ただし、JAVA_HOMEで設定してあるディレクトリに、Java3D等が見つからなかった場合には、 /usr/java以下を別途検索するようなことはしません。

rpm版に追加されている /usr/sbin/lg3d-setupコマンドは、 cvsでソースコードをダウンロードした場合、 lg3d-core/rpm/SOURCES/lg3d-setupにありますので、rpm版で無くても利用、参照は可能です。

/usr/sbin/lg3d-setupはbashスクリプトを利用しています。
「~をこう直したら良くなるよ?」とか、「~をこうして欲しい」等ありましたら、 ご意見いただければ、できる範囲で改善しようと思います。
とりあえずは、filesセクションのconfigでしょうか…。
あと、今わかっていることは、/usr/bin/lg3d-dev, /usr/bin/lg3d-sessionにpkillを入れているので、 Vine Linuxを利用した場合、終了時にエラーが出ることでしょうか…。

(EN) LG3D rpm build Part2

LG3D rpm install binaries into /opt/lg3d directory
Files in /opt/lg3d are same as tar.gz release of LG3D.
And, /usr/bin/lg3d-dev, /usr/bin/lg3d-session, /usr/bin/lg3d-setup is installed when LG3D rpm is installed.
These files is in rpm version only.

Rpm can include informations of package/file dependencies, but current lg3d rpm do not include dependencies, JDK/JRE 1.5, JAI, and Java3D,
so LG3D rpm can install when linux has no JDK/JRE 1.5 or JAI or Java3D.

/usr/sbin/lg3d-setup is a bash script to make /usr/bin/lg3d-dev and /usr/bin/lg3d-session. /usr/sbin/lg3d-setup find directory under /usr/java, which has java command(JDK/JRE 1.5) with Java3D and JAI.
/usr/sbin/lg3d-setup also make /usr/bin/lg3d-dev and /usr/bin/lg3d-session, and write JAVA_HOME environment into these files.
When /usr/sbin/lg3d-setup found no JDK/JRE with JAI and Java3D, /usr/sbin/lg3d-setup do not write JAVA_HOME environment to /usr/bin/lg3d-dev and /usr/bin/lg3d-session.
Search directory of /usr/sbin/lg3d-setup is under /usr/java only. So, /usr/sbin/lg3d-setup cannot find JDK/JRE in other directory.(e.g. JDK on home directory)
In this case, set JAVA_HOME environment before run /usr/sbin/lg3d-setup. /usr/sbin/lg3d-setup search $JAVA_HOME directory instead of /usr/java directory.

When you download source codes via cvs, you can find lg3d-core/rpm/SOURCES/lg3d-setup script, this script and /usr/sbin/lg3d-setup in LG3D rpm are same files.
So, you can use/refers lg3d-setup without rpm version.