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)
30 * Download:: YACASL2ファイルのダウンロード
31 * Verify:: YACASL2ファイルの検証
32 * Expand:: YACASL2ファイルの展開
33 * Build:: @file{casl2} @file{comet2} @file{dumpword}のビルド
34 * Simple Test:: @file{casl2}の実行テスト
35 * Detail Test:: 詳細なテスト
36 * Environment:: 環境変数の設定
41 @node Require, Download, Top, Top
44 YACASL2は、LinuxやMac OS Xなど、UNIX系のOS上で動作します。現在動作を確認しているのは、Ubuntu LinuxとVine Linux、Mac OS Xです。
46 インストール時に、@command{tar} @command{gcc} @command{make}が必要です。Linuxでは多くの場合、標準でインストールされています。Mac OS Xの場合、Xcodeの「Command Line Tools」に含まれます。
48 @node Download, Verify, Require, Top
49 @chapter YACASL2ファイルのダウンロード
51 @uref{http://www.j8takagi.net/yacasl2/, YACASL2のサイト}から、@file{tar.gz}または@file{tar.xz}ファイルと、対応する検証用ファイルをダウンロードします。@uref{http://github.com/j8takagi/YACASL2/downloads/, githubのダウンロードページ}から@file{tar.gz}などのファイルをダウンロードすることもできます。
53 @node Verify, Expand, Download, Top
54 @chapter YACASL2ファイルの検証
56 ダウンロードが完了したら、圧縮ファイルが改竄されていないか検証します。検証にはGnuPG分離署名か、MD5ハッシュ値を使います。
58 @section GnuPG分離署名での検証
60 GnuPGの@command{gpg}で圧縮ファイルを検証します。この検証を行うには、GnuPGがインストールされ、自分の秘密鍵と公開鍵のペアが作成されている必要があります。
63 $ @kbd{gpg --verify yacasl2.tar.xz.asc}
64 gpg: Signature made Sat Oct 27 02:17:16 2012 JST using RSA key ID 25B62DD1
65 gpg: Can't check signature: public key not found
66 $ @kbd{gpg --recv-keys 25B62DD1}
67 gpg: requesting key 25B62DD1 from hkp server keys.gnupg.net
68 gpg: key 25B62DD1: public key "j8takagi <j8takagi@@nifty.com>" imported
69 gpg: Total number processed: 1
70 gpg: imported: 1 (RSA: 1)
72 $ @kbd{gpg --lsign-key 25B62DD1}
74 pub 2048R/25B62DD1 created: 2012-09-29 expires: never usage: SC
75 trust: unknown validity: full
76 sub 2048R/92E25C29 created: 2012-09-29 expires: never usage: E
77 [ full ] (1). j8takagi <j8takagi@@nifty.com>
80 pub 2048R/25B62DD1 created: 2012-09-29 expires: never usage: SC
81 trust: unknown validity: full
82 Primary key fingerprint: ...
86 Are you sure that you want to sign this key with your
89 The signature will be marked as non-exportable.
91 Really sign? (y/N) @kbd{y}
93 You need a passphrase to unlock the secret key for
95 2048-bit RSA key, ID ........, created 20..-..-..
97 <input password> @kbd{password}
99 $ @kbd{gpg --verify yacasl2.tar.xz.asc}
100 gpg: Signature made Sat Oct 27 02:17:16 2012 JST using RSA key ID 25B62DD1
101 gpg: checking the trustdb
102 gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
103 gpg: depth: 0 valid: 1 signed: 4 trust: 0-, 0q, 0n, 0m, 0f, 1u
104 gpg: depth: 1 valid: 4 signed: 0 trust: 4-, 0q, 0n, 0m, 0f, 0u
105 gpg: Good signature from "j8takagi <j8takagi@@nifty.com>"
108 @section MD5ハッシュ値での検証
110 @command{openssl}と@command{diff}で圧縮ファイルを検証します。
113 $ @kbd{openssl md5 yacasl2.tar.gz | diff -s yacasl2.tar.gz.md5sum -}
114 Files yacasl2.tar.gz.md5sum and - are identical
117 @node Expand, Build, Verify, Top
118 @chapter YACASL2ファイルの展開
120 YACASL2ファイルをダウンロードしたら、@command{tar}コマンドで展開します。
123 $ @kbd{tar xvzf yacasl2.tar.gz}
126 @node Build, Simple Test, Expand, Top
127 @chapter @file{casl2} @file{comet2} @file{dumpword}のビルド
129 展開したら、@command{make}コマンドで@file{casl2} @file{comet2} @file{dumpword}をビルドします。
135 make[1]: Entering directory ‘/home/kazubito/yacasl2/src’
136 gcc -c -g -Wall -I ../include casl2.c
137 gcc -c -g -Wall -I ../include word.c
138 gcc -c -g -Wall -I ../include hash.c
139 gcc -c -g -Wall -I ../include cerr.c
140 gcc -c -g -Wall -I ../include struct.c
141 gcc -c -g -Wall -I ../include cmd.c
142 gcc -c -g -Wall -I ../include assemble.c
143 gcc -c -g -Wall -I ../include token.c
144 gcc -c -g -Wall -I ../include label.c
145 gcc -c -g -Wall -I ../include macro.c
146 gcc -c -g -Wall -I ../include exec.c
147 gcc -c -g -Wall -I ../include dump.c
148 gcc -g -Wall -I ../include -o ../casl2 casl2.o word.o hash.o cerr.o st
149 ruct.o cmd.o assemble.o token.o label.o macro.o exec.o dump.o
150 gcc -c -g -Wall -I ../include comet2.c
151 gcc -g -Wall -I ../include -o ../comet2 comet2.o word.o hash.o cerr.o
152 struct.o cmd.o exec.o dump.o
153 gcc -c -g -Wall -I ../include dumpword.c
154 gcc -g -Wall -I ../include -o ../dumpword dumpword.o word.o cerr.o
155 make[1]: Leaving directory ‘/home/kazubito/yacasl2/src’
158 @node Simple Test, Detail Test, Build, Top
159 @chapter @file{casl2}の実行テスト
161 ビルドしたら、次のコマンドが正常に実行できるかを確認します。
162 正常に実行された場合は、「Hello, World!」と表示されます。
165 $ @kbd{./casl2 as/hello.casl}
169 @node Detail Test, Environment, Simple Test, Top
172 次のコマンドを実行すると、正常にビルドできているかどうかを詳細にテストできます。
176 195 / 195 tests passed. Details in /home/username/yacasl2/test/integra
178 All tests are succeded.
179 149 / 149 tests passed. Details in /home/username/yacasl2/test/integra
181 All tests are succeded.
182 4 / 4 tests passed. Details in /home/username/yacasl2/test/integration
184 All tests are succeded.
187 @node Environment, , Detail Test, Top
190 環境変数@code{PATH}や@code{CASL2LIB}を設定することで、YACASL2が使いやすくなります。環境変数は、使っているシェルを確認してから設定します。
194 環境変数の設定方法は使っているシェルによって異なります。シェルは、次のコマンドで確認できます。
201 現在もっとも多く使われているシェルは、BASHでしょう。以下、BASHでの設定方法を説明します。
203 @section @code{PATH}にYACASL2のディレクトリを追加
205 @code{PATH}にYACASL2実行ファイルをインストールしたディレクトリを追加すると、ディレクトリの指定を省略して@command{casl2} @command{comet2} @command{dumpword}を実行できます。例えば、実行ファイルを@file{~/bin}にインストールしたときは、次のコマンドで設定できます。
208 $ @kbd{PATH=$PATH:~/bin && export PATH}
211 環境変数の設定は、シェルの初期設定ファイルに追加することでログインしたあと自動的に反映されるようになります。BASHではホームディレクトリにある@file{.bashrc}が初期設定ファイルです。次のコマンドで追加できます。
214 $ @kbd{echo ’PATH=$PATH:~/bin && export PATH’ >>~/.bashrc}
218 @section @code{CASL2LIB}の設定
220 環境変数@code{CASL2LIB}を設定しておけば、CASL IIプログラム作成時に共通ライブラリを呼び出す手間が小さくなります。例えば、CASL2LIBを@code{~/yacasl2/casl2lib}にインストールしたときは、次のコマンドで設定できます。
223 $ @kbd{CASL2LIB=~/yacasl2/casl2lib && export CASL2LIB}
226 BASHの初期設定ファイル@file{.bashrc}には、次のコマンドで追加できます。
229 $ @kbd{ echo 'CASL2LIB=~/yacasl2/casl2lib && export CASL2LIB' >>~/.bashrc}