首先,先確認您的 port 除了 pkg-plist
尚未搞定之外,其他都完成了。
接著,建立臨時目錄以供該 port 安裝,並且把所有相依套件都裝好 。
#
mkdir /var/tmp/$(make -V PORTNAME)
#
mtree -U -f $(make -V MTREE_FILE) -d -e -p /var/tmp/$(make -V PORTNAME)
#
make depends PREFIX=/var/tmp/$(make -V PORTNAME)
把這目錄架構存到新檔案。
#
(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort > OLD-DIRS
新增空的 pkg-plist
檔案:
#
:>pkg-plist
若該 port 有遵循 PREFIX
(也應該要遵循),
接著就可以安裝該 port 並產生檔案清單。
#
make install PREFIX=/var/tmp/$(make -V PORTNAME)
#
(cd /var/tmp/$(make -V PORTNAME) && find -d * \! -type d) | sort > pkg-plist
這時要記得把新建的目錄,也加到檔案清單內。
#
(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' >> pkg-plist
最後,您應該手動整理檔案清單(這不是全部自動化處理的)。Man page 則應該利用 MAN
的方式
寫在 port 的 n
Makefile
而不是寫在檔案清單中。
使用者設定檔應該移除,或更名為
。
The filename
.sampleinfo/dir
file should not be listed
and appropriate install-info
lines should
be added as noted in the info
files section. Any
libraries installed by the port should be listed as specified in the
shared libraries section.
Alternatively, use the plist
script in
/usr/ports/Tools/scripts/
to build the
package list automatically. The first step is the same as
above: take the first three lines, that is,
mkdir
, mtree
and
make depends
. Then build and install the
port:
#
make install PREFIX=/var/tmp/port-name
And let plist
create the
pkg-plist
file:
#
/usr/ports/Tools/scripts/plist -Md -m /etc/mtree/BSD.port-type
.dist /var/tmp/port-name
> pkg-plist
The packing list still has to be tidied up by hand as stated above.
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。