システムファイルの簡易インストーラを作成したり、他のインストーラに「特定のパッケージがインストール済み」と検知させるダミーdebパッケージを作成したりする方法。
template controlファイルを作成する
パッケージのプロパティや、セットアップスクリプトを指定するtemplate controlファイルは、次のコマンドでテンプレートが自動作成される
$ equivs-control [新規作成するcontrolファイル名]
次のようなファイルが作成される
dummy.ctl
### Commented entries have reasonable defaults.
### Uncomment to edit them.
# Source: <source package name; defaults to package name>
Section: misc
Priority: optional
# Homepage: <enter URL here; no default>
Standards-Version: 3.9.2
Package: <package name; defaults to equivs-dummy>
# Version: <enter version here; defaults to 1.0>
# Maintainer: Your Name <yourname@example.com>
# Pre-Depends: <comma-separated list of packages>
# Depends: <comma-separated list of packages>
# Recommends: <comma-separated list of packages>
# Suggests: <comma-separated list of packages>
# Provides: <comma-separated list of packages>
# Replaces: <comma-separated list of packages>
# Architecture: all
# Multi-Arch: <one of: foreign|same|allowed>
# Copyright: <copyright file; defaults to GPL2>
# Changelog: <changelog file; defaults to a generic changelog>
# Readme: <README.Debian file; defaults to a generic one>
# Extra-Files: <comma-separated list of additional files for the doc directory>
# Links: <pair of space-separated paths; First is path symlink points at, second is filename of link>
# Files: <pair of space-separated paths; First is file to include, second is destination>
# <more pairs, if there's more than one file to include. Notice the starting space>
Description: <short description; defaults to some wise words>
long description and info
.
second paragraph
作成されたパッケージ内のファイルを確認する
$ dpkg-deb --contents dummy-grub2-common_2.06-2ubuntu7_amd64.deb
drwxr-xr-x root/root 0 2022-05-22 17:55 ./
drwxr-xr-x root/root 0 2022-05-22 17:55 ./usr/
drwxr-xr-x root/root 0 2022-05-22 17:55 ./usr/local/
drwxr-xr-x root/root 0 2022-05-22 17:55 ./usr/local/bin/
drwxr-xr-x root/root 0 2022-05-22 17:55 ./usr/local/bin/test/
-rwxr-xr-x root/root 38 2022-05-22 17:55 ./usr/local/bin/test/test04.sh
-rwxr-xr-x root/root 98 2022-05-22 17:55 ./usr/local/bin/test01.sh
-rw-r--r-- root/root 184 2022-05-22 17:55 ./usr/local/bin/test02.txt
-rw-r--r-- root/root 119 2022-05-22 17:55 ./usr/local/bin/test03.txt
drwxr-xr-x root/root 0 2022-05-22 17:55 ./usr/share/
drwxr-xr-x root/root 0 2022-05-22 17:55 ./usr/share/doc/
drwxr-xr-x root/root 0 2022-05-22 17:55 ./usr/share/doc/dummy-grub2-common/
-rw-r--r-- root/root 756 2022-05-22 17:55 ./usr/share/doc/dummy-grub2-common/README.Debian
-rw-r--r-- root/root 162 2022-05-22 17:55 ./usr/share/doc/dummy-grub2-common/changelog.Debian.gz
-rw-r--r-- root/root 936 2022-05-22 17:55 ./usr/share/doc/dummy-grub2-common/copyright
実際にインストールして、ファイル外としたとおりに作成されたか確認する
$ sudo dpkg --install dummy-grub2-common_2.06-2ubuntu7_amd64.deb
以前に未選択のパッケージ dummy-grub2-common:amd64 を選択しています。
(データベースを読み込んでいます ... 現在 293043 個のファイルとディレクトリがインストールされています。)
dummy-grub2-common_2.06-2ubuntu7_amd64.deb を展開する準備をしています ...
dummy-grub2-common:amd64 (2.06-2ubuntu7) を展開しています...
dummy-grub2-common:amd64 (2.06-2ubuntu7) を設定しています ...
$ ll /usr/local/bin/test*
-rwxr-xr-x 1 root root 98 2022-05-22 17:55:00 /usr/local/bin/test01.sh*
-rw-r--r-- 1 root root 184 2022-05-22 17:55:00 /usr/local/bin/test02.txt
-rw-r--r-- 1 root root 119 2022-05-22 17:55:00 /usr/local/bin/test03.txt
/usr/local/bin/test:
合計 12
drwxr-xr-x 2 root root 4096 2022-05-22 17:55:55 ./
drwxr-xr-x 4 root root 4096 2022-05-22 17:55:55 ../
-rwxr-xr-x 1 root root 38 2022-05-22 17:55:00 test04.sh*
省略された記事の残りの部分を表示する (Continue to read rest of this topic) »