$ apt-get (パッケージ名) |
である.
制御ファイルが参照 → ファイルをコピー
■制御ファイル |
制御ファイルを見るためには以下のような操作をします.
$ dpkg -e (Debian パッケージ) (適当なディレクトリ)
例えば,とすると, ~/tmp 以下に以下のファイルが展開されます.
$ dpkg -e ssh_1.2.3-9.deb ~/tmp
$ ls ~/tmp
conffiles control postinst preinst config md5sums postrm prerm
これらのファイルの役目は以下の通りです. 赤字は必須. 黒字はパッケージに 依存します.
- control
- コントロールファイル. 依存関係やパッケージの紹介が書かれている.
- md5sum
- パッケージに含まれるファイルの MD5 チェックサム(ファイル固有の文字列) 情報が書かれている.
- conffiles
- 設定ファイルの置場が書かれている
- postinst, postrm
- インストール/削除 後に実行するスクリプト
- prerm, preinst
- インストール/削除 前に実行するスクリプト
- config
- スクリプト, 設定に使う(?)
■/(ルート)以下に格納するファイル群 |
パッケージに含まれるファイルを見るためには以下のような操作をします.
$ dpkg -c (Debian パッケージ)
$ dpkg -X (Debian パッケージ) (適当なディレクトリ)
例えば,とすると, 標準出力にファイル名が出力されます. これらはすべて /(ルート)ディレクトリ以下にコピーされます. また存在しないディレクトリがあった場合は自動で作成されます.
$ dpkg -c ssh_1.2.3-9.deb
drwxr-xr-x root/root 0 2000-07-12 19:52:37 ./ drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/ drwxr-xr-x root/root 0 2000-07-12 19:52:40 ./usr/bin/ -rwxr-xr-x root/root 107548 2000-07-12 19:52:40 ./usr/bin/ssh -rwxr-xr-x root/root 18556 2000-07-12 19:52:40 ./usr/bin/scp -rwxr-xr-x root/root 28380 2000-07-12 19:52:40 ./usr/bin/ssh-add -rwxr-xr-x root/root 20860 2000-07-12 19:52:40 ./usr/bin/ssh-agent -rwxr-xr-x root/root 30204 2000-07-12 19:52:40 ./usr/bin/ssh-keygen lrwxrwxrwx root/root 0 2000-07-12 19:52:33 ./usr/bin/slogin -> ssh -rwxr-xr-x root/root 1144 2000-07-12 19:52:33 ./usr/bin/ssh-copy-id -rwxr-xr-x root/root 21582 2000-07-12 19:52:33 ./usr/bin/make-ssh-known-hosts drwxr-xr-x root/root 0 2000-07-12 19:52:40 ./usr/sbin/ -rwxr-xr-x root/root 117596 2000-07-12 19:52:40 ./usr/sbin/sshd drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/lib/ drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/lib/ssh/ drwxr-xr-x root/root 0 2000-07-12 19:52:37 ./usr/share/ drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/share/man/ drwxr-xr-x root/root 0 2000-07-12 19:52:41 ./usr/share/man/man1/ -rw-r--r-- root/root 1209 2000-07-12 19:52:33 ./usr/share/man/man1/scp.1.gz -rw-r--r-- root/root 2065 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-agent.1.gz -rw-r--r-- root/root 2030 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-keygen.1.gz -rw-r--r-- root/root 1065 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-copy-id.1.gz lrwxrwxrwx root/root 0 2000-07-12 19:52:41 ./usr/share/man/man1/slogin.1.gz -> ssh.1.gz -rw-r--r-- root/root 10660 2000-07-12 19:52:33 ./usr/share/man/man1/ssh.1.gz -rw-r--r-- root/root 1498 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-add.1.gz -rw-r--r-- root/root 4623 2000-07-12 19:52:33 ./usr/share/man/man1/make-ssh-known-hosts.1.gz drwxr-xr-x root/root 0 2000-07-12 19:52:41 ./usr/share/man/man8/ -rw-r--r-- root/root 9721 2000-07-12 19:52:33 ./usr/share/man/man8/sshd.8.gz drwxr-xr-x root/root 0 2000-07-12 19:52:37 ./usr/share/doc/ drwxr-xr-x root/root 0 2000-07-12 19:52:41 ./usr/share/doc/ssh/ -rw-r--r-- root/root 3401 2000-03-07 20:40:57 ./usr/share/doc/ssh/README -rw-r--r-- root/root 22037 1999-10-27 12:42:43 ./usr/share/doc/ssh/RFC.nroff.gz -rw-r--r-- root/root 2513 2000-03-17 08:54:16 ./usr/share/doc/ssh/UPGRADING.gz -rw-r--r-- root/root 15341 2000-03-24 07:25:06 ./usr/share/doc/ssh/changelog.gz -rw-r--r-- root/root 3480 2000-07-12 19:17:52 ./usr/share/doc/ssh/README.Debian -rw-r--r-- root/root 4671 2000-07-12 19:52:38 ./usr/share/doc/ssh/copyrightdrwxr-xr-x root/root 0 2000-07-12 19:52:37 ./ drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/ drwxr-xr-x root/root 0 2000-07-12 19:52:40 ./usr/bin/ -rwxr-xr-x root/root 107548 2000-07-12 19:52:40 ./usr/bin/ssh -rwxr-xr-x root/root 18556 2000-07-12 19:52:40 ./usr/bin/scp -rwxr-xr-x root/root 28380 2000-07-12 19:52:40 ./usr/bin/ssh-add -rwxr-xr-x root/root 20860 2000-07-12 19:52:40 ./usr/bin/ssh-agent -rwxr-xr-x root/root 30204 2000-07-12 19:52:40 ./usr/bin/ssh-keygen lrwxrwxrwx root/root 0 2000-07-12 19:52:33 ./usr/bin/slogin -> ssh -rwxr-xr-x root/root 1144 2000-07-12 19:52:33 ./usr/bin/ssh-copy-id -rwxr-xr-x root/root 21582 2000-07-12 19:52:33 ./usr/bin/make-ssh-known-hosts drwxr-xr-x root/root 0 2000-07-12 19:52:40 ./usr/sbin/ -rwxr-xr-x root/root 117596 2000-07-12 19:52:40 ./usr/sbin/sshd drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/lib/ drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/lib/ssh/ drwxr-xr-x root/root 0 2000-07-12 19:52:37 ./usr/share/ drwxr-xr-x root/root 0 2000-07-12 19:52:32 ./usr/share/man/ drwxr-xr-x root/root 0 2000-07-12 19:52:41 ./usr/share/man/man1/ -rw-r--r-- root/root 1209 2000-07-12 19:52:33 ./usr/share/man/man1/scp.1.gz -rw-r--r-- root/root 2065 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-agent.1.gz -rw-r--r-- root/root 2030 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-keygen.1.gz -rw-r--r-- root/root 1065 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-copy-id.1.gz lrwxrwxrwx root/root 0 2000-07-12 19:52:41 ./usr/share/man/man1/slogin.1.gz -> ssh.1.gz -rw-r--r-- root/root 10660 2000-07-12 19:52:33 ./usr/share/man/man1/ssh.1.gz -rw-r--r-- root/root 1498 2000-07-12 19:52:33 ./usr/share/man/man1/ssh-add.1.gz -rw-r--r-- root/root 4623 2000-07-12 19:52:33 ./usr/share/man/man1/make-ssh-known-hosts.1.gz drwxr-xr-x root/root 0 2000-07-12 19:52:41 ./usr/share/man/man8/ -rw-r--r-- root/root 9721 2000-07-12 19:52:33 ./usr/share/man/man8/sshd.8.gz drwxr-xr-x root/root 0 2000-07-12 19:52:37 ./usr/share/doc/ drwxr-xr-x root/root 0 2000-07-12 19:52:41 ./usr/share/doc/ssh/ -rw-r--r-- root/root 3401 2000-03-07 20:40:57 ./usr/share/doc/ssh/README -rw-r--r-- root/root 22037 1999-10-27 12:42:43 ./usr/share/doc/ssh/RFC.nroff.gz -rw-r--r-- root/root 2513 2000-03-17 08:54:16 ./usr/share/doc/ssh/UPGRADING.gz -rw-r--r-- root/root 15341 2000-03-24 07:25:06 ./usr/share/doc/ssh/changelog.gz -rw-r--r-- root/root 3480 2000-07-12 19:17:52 ./usr/share/doc/ssh/README.Debian -rw-r--r-- root/root 4671 2000-07-12 19:52:38 ./usr/share/doc/ssh/copyright -rw-r--r-- root/root 2646 1999-11-21 16:31:57 ./usr/share/doc/ssh/OVERVIEW.gz -rw-r--r-- root/root 10243 1999-10-30 10:30:35 ./usr/share/doc/ssh/README.Ylonen.gz -rw-r--r-- root/root 4721 2000-07-12 19:11:13 ./usr/share/doc/ssh/changelog.Debian.gz drwxr-xr-x root/root 0 2000-07-12 19:52:33 ./etc/ drwxr-xr-x root/root 0 2000-07-12 19:52:33 ./etc/ssh/ -rw-r--r-- root/root 1412 2000-07-12 19:52:33 ./etc/ssh/ssh_config -rw-r--r-- root/root 1208 2000-07-12 19:52:33 ./etc/ssh/sshd_config drwxr-xr-x root/root 0 2000-07-12 19:52:38 ./etc/init.d/ -rwxr-xr-x root/root 1448 2000-06-13 08:25:04 ./etc/init.d/ssh drwxr-xr-x root/root 0 2000-07-12 19:52:33 ./etc/pam.d/ -rw-r--r-- root/root 727 2000-05-27 19:18:10 ./etc/pam.d/ssh
$ tar zxvf mksigen-1.0.0.tar.gz
$ cd mksigen-1.0.0 |
$ deb-make |
Email-Address : sugiyama@gfd-dennou.org Date used : Wed, 9 Aug 2000 11:33:13 +0900 Maintainer : SUGIYAMA Ko-ichiro Package Name : mksigen Version : 0.2 Email-address を変更したい場合は前もって EMAIL 環境変数を変更しておく. |
最後にコンパイルしてパッケージ化します.
- *.ex ファイル
- *.ex ファイルはより高度なパッケージを作るために必要. 今回の「とりあえず deb パッケージ化」には必要ない. 削除して良い.
- 追加するファイル
- postinst, postrm, etc. を新規作成する.
- copyright
- 著作権情報を記載する
- changelog
- バージョンアップに伴う変更点を記載する.
- control
- パッケージの依存関係やパッケージの説明を記載する.
Source: mksigen Section: misc Priority: optional Maintainer: SUGIYAMA Ko-ichiroStandards-Version: 3.1.1 Package: mksigen Architecture: all Depends: ${shlibs:Depends} Description: directory info db manager - dirs
- バイナリやドキュメントをインストールするディレクトリを列挙する. ここに不備があるとパッケージ化に失敗する.
usr/share/doc/mksigen usr/bin usr/sbin usr/man usr/man/man1 usr/man/man5 usr/man/man8 usr/man/ja usr/man/ja/man1 usr/man/ja/man5 usr/man/ja/man8- rules
- このファイル中で注意する必要があるのは "build" と "binary-arch" エントリ. ここを編集するためには Makefile を眺めてインストールの手順を熟知する必要がある. "build" には make する際の手順(例えば ./configure して make とか) "binary-arch" にはパッケージ作成のための仮インストール先となる debian/tmp 以下のディレクトリの作成・そのディレクトリへの インストールが指示されている.
$ cd ../ $ dpkg-buildpackage -rsudo |
裏技 # apt-get source (パッケージ名) とすると, そのディレクトリに (パッケージ名) のツリーができる. その中に debian というディレクトリがあるので, それを覗くと参考になる.
裏技 2 (RPM から deb の変換) # alien hoge.rpm hoge.deb