Linux環境の作り方入門 vol.3 | 16.78MHz

Linux環境の作り方入門 vol.3

(前回の記事はこちら)
今回はひたすら基本的なコマンドをインストールしていく単調な作業。
まずはcoreutilsをインストールする。coreutilsは無いと話にならないdd、cp、lnといった基本的なコマンドをひとまとめにしたもの。とりあえずこれがあれば最低限のファイル操作くらいは出来るようになる。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/coreutils/coreutils-8.5.tar.xz
$ tar xf coreutils-8.5.tar.xz
$ cd coreutils-8.5
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var --exec-prefix=/
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

検索関連のコマンド(といいつつ密かにgrepは入っていない)をまとめたfindutilsをインストールする。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/findutils/findutils-4.4.2.tar.gz
$ tar xf findutils-4.4.2.tar.gz
$ cd findutils-4.4.2
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

C言語のできそこないawkのインタプリタgawkを入れる。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/gawk/gawk-3.1.8.tar.bz2
$ tar xf gawk-3.1.8.tar.bz2
$ cd gawk-3.1.8
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

autotoolsのルールの記述に使われているm4を入れる。(ひょっとするとこれはchroot後でもいいかもしれない)
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/m4/m4-1.4.15.tar.xz
$ tar xf m4-1.4.15.tar.xz
$ cd m4-1.4.15
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

構文解析器bisonを入れる。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/bison/bison-2.4.3.tar.bz2
$ tar xf bison-2.4.3
$ cd bison-2.4.3
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

roffドキュメント(つまるところマニュアルページ)を読むための文書整形コマンドgroffをインストールする。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/groff/groff-1.20.1.tar.gz
$ tar xf groff-1.20.1.tar.gz
$ cd groff-1.20.1
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

ストリームエディタことsedを入れる。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/sed/sed-4.2.1.tar.bz2
$ tar xf sed-4.2.1.tar.bz2
$ cd sed-4.2.1
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

国際化のためのライブラリgettextを入れる。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/gettext/gettext-0.18.1.1.tar.gz
$ tar xf gettext-0.18.1.1.tar.gz
$ cd gettext-0.18.1.1
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

マニュアルページと並んで歴史あるinfoページを整形するためにtexinfoを入れる。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/texinfo/texinfo-4.13a.tar.gz
$ tar xf texinfo-4.13a.tar.gz
$ cd texinfo-4.13a
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

様々な種類のライブラリのビルド手順と動的ロード手順を抽象化するlibtoolをインストールする。
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/libtool/libtool-2.4.tar.xz
$ tar xf libtool-2.4.tar.xz
$ cd libtool-2.4
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

ファイル同士を比較するdiffコマンドと関連コマンドからなるdiffutilsインストールする
$ cd ${SYSTEM_BUILD_DIR}/usr/src
$ wget http://ftp.yz.yamagata-u.ac.jp/pub/GNU/diffutils/diffutils-3.0.tar.xz
$ tar xf diffutils-3.0.tar.xz
$ cd diffutils-3.0
$ mkdir build
$ cd build
$ ../configure --prefix=/usr --disable-debug --enable-shared --sysconfdir=/etc --localstatedir=/var
$ make
$ DESTDIR=${SYSTEM_BUILD_DIR} make install

(つづく!)