本節主要介紹如何來快速打造 port,然而實際應用時這快速方法可能不足,完整的 “慢速打造 Port” 的步驟在 章 4, Slow Porting 詳述。
首先取得該應用程式的原始程式碼壓縮檔(tarball),並把它放到 DISTDIR
,預設路徑應該是 /usr/ports/distfiles
.
這些步驟假設軟體可以直接編譯。也就是不需要任何修改就可以直接在 FreeBSD 上執行。如果需要修改,請參見章 4, Slow Porting。
It is recommended to set the DEVELOPER
make(1) variable in /etc/make.conf
before getting into porting.
#
echo DEVELOPER=yes >> /etc/make.conf
This setting enables the “developer mode”
that displays deprecation warnings and activates some further
quality checks on calling make
.
最簡單的 Makefile
大概是像這樣:
# $FreeBSD: head/zh_TW.UTF-8/books/porters-handbook/book.xml 48496 2016-03-29 01:37:53Z kevlo $ PORTNAME= oneko PORTVERSION= 1.1b CATEGORIES= games MASTER_SITES= ftp://ftp.cs.columbia.edu/archives/X11R5/contrib/ MAINTAINER= youremail@example.com COMMENT= Cat chasing a mouse all over the screen .include <bsd.port.mk>
In some cases, the Makefile
of an
existing port may contain additional lines in the header,
such as the name of the port and the date it was created.
This additional information has been declared obsolete, and
is being phased out.
嗯,大致就是這樣,看看你已經領略多少了呢? 看到 $FreeBSD: head/zh_TW.UTF-8/books/porters-handbook/book.xml 48496 2016-03-29 01:37:53Z kevlo $
這一行的話,別想太多 ,當該 port 正式進入 port tree 時, Subversion 就會自動轉換為相關字串囉。 有關這點的細節部份,可以參閱 sample Makefile 章節。
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。