--- title: 第18章 パッキングリストの自動生成 prev: books/porters-handbook/porting-samplem next: books/porters-handbook/changes showBookMenu: true weight: 18 params: path: "/books/porters-handbook/porting-autoplist/" --- [[porting-autoplist]] = パッキングリストの自動生成 :doctype: book :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :sectnumoffset: 18 :partnums: :source-highlighter: rouge :experimental: :images-path: books/porters-handbook/ ifdef::env-beastie[] ifdef::backend-html5[] :imagesdir: ../../../../images/{images-path} endif::[] ifndef::book[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] toc::[] endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] toc::[] include::../../../../../shared/asciidoctor.adoc[] endif::[] まず、あなたの port に [.filename]#pkg-plist# がないことを除けば完成していることを確認してください。 次に、あなたの port をインストールする一時ディレクトリを作成して、 依存するものをすべてインストールしてください。 _port-type_ は X アプリケーションではない port については `local`、 XFree86 4 またはそれより前の XFree86 のディレクトリ階層にインストールする ports については、それぞれ `x11-4` または `x11` にすべきです。 [source,shell] .... # mkdir /var/tmp/port-name # mtree -U -f /etc/mtree/BSD.port-type.dist -d -e -p /var/tmp/port-name # make depends PREFIX=/var/tmp/port-name .... このディレクトリ構造を新しいファイルに保存してください。 [source,shell] .... # (cd /var/tmp/port-name && find -d * -type d) | sort > OLD-DIRS .... 空の [.filename]#pkg-plist# ファイルを作成してください。 [source,shell] .... # touch pkg-plist .... もしあなたの port が `PREFIX` にちゃんと従うなら、 ここで port をインストールしてパッキングリストを作ることができます。 [source,shell] .... # make install PREFIX=/var/tmp # (cd /var/tmp/port-name && find -d * \! -type d) | sort > pkg-plist .... 新しく生成されたディレクトリはすべてパッキングリストに追加する必要があります。 [source,shell] .... # (cd /var/tmp/port-name && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' >> pkg-plist .... 最後にパッキングリストを手で整える必要があります; __すべて__が自動化されているわけではありません。 マニュアルはパッキングリストに記述するのではなく、 port の [.filename]#Makefile# 中の `MAN_n_` に 記述しなければなりません。 ユーザ設定ファイルは削除するか [.filename]#filename.sample# としてインストールされなければなりません。 また [.filename]#info/dir# ファイルはリストに含めず、 <>に記述されているように、 適切な [.filename]#install-info# 行に追加しなければなりません。 port によってインストールされるライブラリは、 <> のセクションで示したように記載されるべきです。 または、[.filename]#/usr/ports/Tools/scripts/# にある `plist` スクリプトを使ってパッキングリストを自動的に生成してください。