1 \input texinfo @c -*-texinfo-*-
4 @documentlanguage ja_JP
6 @setfilename yacasl2_install
7 @documentencoding UTF-8
8 @settitle YACASL2のインストール
9 @firstparagraphindent insert
17 Copyright @copyright{} 2010-2012 j8takagi
26 @node Top, Require, (dir), (dir)
27 @chapter YACASL2のインストール
31 * Download:: YACASL2ファイルのダウンロード
32 * Verify:: YACASL2ファイルの検証
33 * Expand:: YACASL2ファイルの展開
34 * Build:: @file{casl2} @file{comet2} @file{dumpword}のビルド
35 * Simple Test:: @file{casl2}の実行テスト
36 * Detail Test:: 詳細なテスト
38 * Environment:: 環境変数の設定
43 @node Require, Download, Top, Top
46 YACASL2は、LinuxやMac OS Xなど、UNIX系のOS上で動作します。現在動作を確認しているのは、Ubuntu LinuxとVine Linux、Mac OS Xです。
48 インストール時に、@command{tar} @command{gcc} @command{make}が必要です。Linuxでは多くの場合、標準でインストールされています。Mac OS Xの場合、Xcodeの「Command Line Tools」に含まれます。
50 @node Download, Verify, Require, Top
51 @section YACASL2ファイルのダウンロード
53 @uref{http://www.j8takagi.net/yacasl2/, YACASL2のサイト}から、@file{tar.gz}または@file{tar.xz}ファイルと、対応する検証用ファイルをダウンロードします。@uref{http://github.com/j8takagi/YACASL2/downloads/, githubのダウンロードページ}から@file{tar.gz}などのファイルをダウンロードすることもできます。
55 @node Verify, Expand, Download, Top
56 @section YACASL2ファイルの検証
58 ダウンロードが完了したら、圧縮ファイルが改竄されていないか検証します。検証にはGnuPG分離署名か、MD5ハッシュ値を使います。
60 @subsection GnuPG分離署名での検証
62 GnuPGの@command{gpg}で圧縮ファイルを検証します。この検証を行うには、GnuPGがインストールされ、自分の秘密鍵と公開鍵のペアが作成されている必要があります。
65 $ @kbd{gpg --verify yacasl2.tar.xz.asc}
66 gpg: Signature made Sat Oct 27 02:17:16 2012 JST using RSA key ID 25B62DD1
67 gpg: Can't check signature: public key not found
68 $ @kbd{gpg --recv-keys 25B62DD1}
69 gpg: requesting key 25B62DD1 from hkp server keys.gnupg.net
70 gpg: key 25B62DD1: public key "j8takagi <j8takagi@@nifty.com>" imported
71 gpg: Total number processed: 1
72 gpg: imported: 1 (RSA: 1)
74 $ @kbd{gpg --lsign-key 25B62DD1}
76 pub 2048R/25B62DD1 created: 2012-09-29 expires: never usage: SC
77 trust: unknown validity: full
78 sub 2048R/92E25C29 created: 2012-09-29 expires: never usage: E
79 [ full ] (1). j8takagi <j8takagi@@nifty.com>
82 pub 2048R/25B62DD1 created: 2012-09-29 expires: never usage: SC
83 trust: unknown validity: full
84 Primary key fingerprint: ...
88 Are you sure that you want to sign this key with your
91 The signature will be marked as non-exportable.
93 Really sign? (y/N) @kbd{y}
95 You need a passphrase to unlock the secret key for
97 2048-bit RSA key, ID ........, created 20..-..-..
99 <input password> @kbd{password}
101 $ @kbd{gpg --verify yacasl2.tar.xz.asc}
102 gpg: Signature made Sat Oct 27 02:17:16 2012 JST using RSA key ID 25B62DD1
103 gpg: checking the trustdb
104 gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
105 gpg: depth: 0 valid: 1 signed: 4 trust: 0-, 0q, 0n, 0m, 0f, 1u
106 gpg: depth: 1 valid: 4 signed: 0 trust: 4-, 0q, 0n, 0m, 0f, 0u
107 gpg: Good signature from "j8takagi <j8takagi@@nifty.com>"
110 @subsection MD5ハッシュ値での検証
112 @command{openssl}と@command{diff}で圧縮ファイルを検証します。
115 $ @kbd{openssl md5 yacasl2.tar.gz | diff -s yacasl2.tar.gz.md5sum -}
116 Files yacasl2.tar.gz.md5sum and - are identical
119 @node Expand, Build, Verify, Top
120 @section YACASL2ファイルの展開
122 YACASL2ファイルをダウンロードしたら、@command{tar}コマンドで展開します。
125 $ @kbd{tar xvzf yacasl2.tar.gz}
128 @node Build, Simple Test, Expand, Top
129 @section @file{casl2} @file{comet2} @file{dumpword}のビルド
131 展開したら、@command{make}コマンドで@file{casl2} @file{comet2} @file{dumpword}をビルドします。
137 make[1]: Entering directory ‘/home/kazubito/yacasl2/src’
138 gcc -c -g -Wall -I ../include casl2.c
139 gcc -c -g -Wall -I ../include word.c
140 gcc -c -g -Wall -I ../include hash.c
141 gcc -c -g -Wall -I ../include cerr.c
142 gcc -c -g -Wall -I ../include struct.c
143 gcc -c -g -Wall -I ../include cmd.c
144 gcc -c -g -Wall -I ../include assemble.c
145 gcc -c -g -Wall -I ../include token.c
146 gcc -c -g -Wall -I ../include label.c
147 gcc -c -g -Wall -I ../include macro.c
148 gcc -c -g -Wall -I ../include exec.c
149 gcc -c -g -Wall -I ../include dump.c
150 gcc -g -Wall -I ../include -o ../casl2 casl2.o word.o hash.o cerr.o st
151 ruct.o cmd.o assemble.o token.o label.o macro.o exec.o dump.o
152 gcc -c -g -Wall -I ../include comet2.c
153 gcc -g -Wall -I ../include -o ../comet2 comet2.o word.o hash.o cerr.o
154 struct.o cmd.o exec.o dump.o
155 gcc -c -g -Wall -I ../include dumpword.c
156 gcc -g -Wall -I ../include -o ../dumpword dumpword.o word.o cerr.o
157 make[1]: Leaving directory ‘/home/kazubito/yacasl2/src’
160 @node Simple Test, Detail Test, Build, Top
161 @section @file{casl2}の実行テスト
163 ビルドしたら、次のコマンドが正常に実行できるかを確認します。
164 正常に実行された場合は、「Hello, World!」と表示されます。
167 $ @kbd{./casl2 as/hello.casl}
171 @node Detail Test, Install, Simple Test, Top
174 @command{make check}コマンドを実行すると、正常にビルドできているかどうかを詳細にテストできます。
179 195 / 195 tests passed. Details in /home/username/yacasl2/test/integra
181 All tests are succeded.
182 149 / 149 tests passed. Details in /home/username/yacasl2/test/integra
184 All tests are succeded.
185 4 / 4 tests passed. Details in /home/username/yacasl2/test/integration
187 All tests are succeded.
190 @node Install, Environment, Detail Test, Top
193 ビルドが成功したら、@command{make install}コマンドで必要なファイルをインストールできます。
194 初期設定では、ホームディレクトリー以下にYACASL2のファイルがインストールされます。
200 コマンド実行時にオプションを指定することで、インストール先のディレクトリーを変更できます。
201 例えば、@file{/usr/local}以下にファイルをインストールするには、
205 $ @kbd{sudo make install prefix=/usr/local}
210 @multitable @columnfractions .20 .50 .30
211 @headitem オプション @tab 説明 @tab 初期設定
212 @item @var{prefix} @tab インストール時のルートファイル @tab @file{~}
213 @item @var{bindir} @tab 実行ファイルのインストール先 @tab @file{$prefix/bin}
214 @item @var{infodir} @tab infoファイルのインストール先 @tab @file{$prefix/info}
215 @item @var{casl2libdir} @tab CASL II ライブラリファイルのインストール先 @tab @file{$prefix/lib/yacasl2}
218 @node Environment, , Install, Top
221 環境変数@code{PATH}や@code{CASL2LIB}を設定することで、YACASL2が使いやすくなります。環境変数は、使っているシェルを確認してから設定します。
223 @unnumberedsubsec シェルの確認
225 環境変数の設定方法は使っているシェルによって異なります。シェルは、次のコマンドで確認できます。
232 現在もっとも多く使われているシェルは、BASHでしょう。以下、BASHでの設定方法を説明します。
234 @subsection @code{PATH}の設定
236 @code{PATH}にYACASL2の実行ファイルのインストール先を追加すると、ディレクトリーの指定を省略して@command{casl2} @command{comet2} @command{dumpword}を実行できます。例えば、初期設定のまま実行ファイルを@file{~/bin}にインストールしたときは、次のコマンドで設定できます。
239 $ @kbd{PATH=$PATH:~/bin && export PATH}
242 環境変数の設定は、シェルの初期設定ファイルに追加することでログインしたあと自動的に反映されるようになります。BASHでは@file{~/.bashrc}が初期設定ファイルです。次のコマンドで追加できます。
245 $ @kbd{echo ’PATH=$PATH:~/bin && export PATH’ >>~/.bashrc}
248 @subsection @code{INFOPATH}の設定
250 @code{INFOPATH}にYACASL2のInfoファイルをインストールしたディレクトリーを追加すると、ディレクトリーの指定を省略して@command{casl2} @command{comet2} @command{dumpword}を実行できます。例えば、初期設定のままInfoファイルを@file{~/share/info}にインストールしたときは、次のコマンドで設定できます。
253 $ @kbd{INFOPATH=$INFOPATH:~/share && export INFOPATH}
256 @file{~/.bashrc}には次のコマンドで追加できます。
259 $ @kbd{echo 'INFOPATH=$INFOPATH:~/share/info && export INFOPATH' >>~/.bashrc}
262 @subsection @code{CASL2LIB}の設定
264 環境変数@code{CASL2LIB}を設定しておけば、CASL IIプログラム作成時に共通ライブラリを呼び出す手間が小さくなります。例えば、CASL2LIBを@code{~/yacasl2/casl2lib}にインストールしたときは、次のコマンドで設定できます。
267 $ @kbd{CASL2LIB=~/yacasl2/casl2lib && export CASL2LIB}
270 @file{~/.bashrc}には次のコマンドで追加できます。
273 $ @kbd{ echo 'CASL2LIB=~/yacasl2/casl2lib && export CASL2LIB' >>~/.bashrc}