aboutsummaryrefslogtreecommitdiff
path: root/zh_TW.Big5/books
diff options
context:
space:
mode:
authorChin-San Huang <chinsan@FreeBSD.org>2007-09-02 14:31:00 +0000
committerChin-San Huang <chinsan@FreeBSD.org>2007-09-02 14:31:00 +0000
commitf5e220485c43ba4b7c2f619f265d474382fb3dd7 (patch)
tree2340b80868893d100e578ead78c91a58388ad7f6 /zh_TW.Big5/books
parent5793c1611334737fbab48523e52a0df9960f9d14 (diff)
downloaddoc-f5e220485c43ba4b7c2f619f265d474382fb3dd7.tar.gz
doc-f5e220485c43ba4b7c2f619f265d474382fb3dd7.zip
- MFen: 1.675 -> 1.868
Obtained from: The FreeBSD Traditional Chinese Project
Notes
Notes: svn path=/head/; revision=30718
Diffstat (limited to 'zh_TW.Big5/books')
-rw-r--r--zh_TW.Big5/books/porters-handbook/book.sgml4357
1 files changed, 3267 insertions, 1090 deletions
diff --git a/zh_TW.Big5/books/porters-handbook/book.sgml b/zh_TW.Big5/books/porters-handbook/book.sgml
index 38d644889c..74b48001b6 100644
--- a/zh_TW.Big5/books/porters-handbook/book.sgml
+++ b/zh_TW.Big5/books/porters-handbook/book.sgml
@@ -2,8 +2,7 @@
The FreeBSD Documentation Project
$FreeBSD$
- Original Revision: 1.675
- Chased Revision: 1.733
+ Original Revision: 1.868
-->
<!DOCTYPE BOOK PUBLIC "-//FreeBSD//DTD DocBook V4.1-Based Extension//EN" [
@@ -29,6 +28,7 @@
<year>2004</year>
<year>2005</year>
<year>2006</year>
+ <year>2007</year>
<holder role="mailto:doc@FreeBSD.org">FreeBSD 文件計劃</holder>
</copyright>
@@ -41,65 +41,67 @@
<title>楔子</title>
<para>幾乎每個 FreeBSD 愛用者都是透過 FreeBSD Ports Collection
- 來裝各式應用程式("ports")。如同 FreeBSD 的其他部分一樣,
- 這些 ports 都主要來自許多志工的努力成果,所以在閱讀這份文件時,
- 請務必感恩在心。</para>
+ 來裝各式應用程式("ports")。如同 FreeBSD 的其他部分一樣,
+ 這些 ports 都主要來自許多志工的努力成果,所以在閱讀這份文件時,
+ 請務必感恩在心。</para>
<para>在 FreeBSD 上面,每個人都可以提交新的 port,
- 或假如該 port 並沒有人維護的話,可以自願維護 &mdash;
- 這點並不需要任何 commit 的權限,就可以來做這件事情。</para>
+ 或假如該 port 並沒有人維護的話,可以自願維護 &mdash;
+ 這點並不需要任何 commit 的權限,就可以來做這件事情。</para>
</chapter>
<chapter id="own-port">
<title>自行打造 port</title>
- <para>那麼,開始對自行製作 port 或更新現有 port
- 有一些興趣了嗎?太好囉!</para>
+ <para>那麼,開始對自行製作 port 或更新現有 port 有一些興趣了嗎?太好囉!</para>
<para>下面將介紹一些建立 port 時該注意的事項。如果是想升級現有的 port
- ,那麼也請參閱 <xref linkend="port-upgrading"> 說明。</para>
+ ,那麼也請參閱 <xref linkend="port-upgrading"> 說明。</para>
- <para>因為這份文件可能講得不是十分詳細,可能需要參考
- <filename>/usr/ports/Mk/bsd.port.mk</filename>
- 這檔是所有 port 的 Makefile 檔都會用到的。就算你不是每天不斷 hacking Makefiles
- ,也都可以藉由它來對整個 port 機制、Makefile 更瞭解,裡面的註釋相當詳細。
- 此外,若有其他特定 port 的問題,也可以到 &a.ports; 來獲得答案。</para>
+ <para>因為這份文件可能講得不是十分詳細,可能需要參考
+ <filename>/usr/ports/Mk/bsd.port.mk</filename> 這檔是所有 port 的
+ Makefile 檔都會用到的。 就算你不是每天不斷 hacking Makefiles
+ ,也都可以藉由它來對整個 port 機制、Makefile 更瞭解,
+ 裡面的註釋相當詳細。 此外,若有其他特定 port 的問題,也可以到
+ &a.ports; 來獲得答案。</para>
<note>
- <para>本文內所提及的環境變數(<makevar><replaceable>VAR</replaceable></makevar>)部份,
- 只有一些可以替換(overridden)。大部份的環境變數(非全部)通常都會寫在
- <filename>/usr/ports/Mk/bsd.port.mk</filename> 內,其他的也是差不多。
- 請注意:該檔並非使用一般的 tab 設定值,而是採用 1 個 tab 等於 4 個 space:
- <application>Emacs</application> 與
- <application>Vim</application> 應該都會在載入該檔時順便讀取相關設定值。
- &man.vi.1; 及
- &man.ex.1; 這兩個程式也都可以打 <command>:set tabstop=4</command> 以修改設定值。</para>
+ <para>本文內所提及的環境變數
+ (<makevar><replaceable>VAR</replaceable></makevar>)部份,
+ 只有一些可以替換(overridden)。大部份的環境變數(非全部)通常都會寫在
+ <filename>/usr/ports/Mk/bsd.port.mk</filename> 內,其他的也是差不多。
+ 請注意:該檔並非使用一般的 tab 設定值,而是採用 1 個 tab 等於 4 個
+ space。
+ :<application>Emacs</application> 與 <application>Vim</application>
+ 應該都會在載入該檔時順便讀取相關設定值。
+ &man.vi.1; 及 &man.ex.1; 這兩個程式也都可以打
+ <command>:set tabstop=4</command> 以修改設定值。</para>
</note>
</chapter>
<chapter id="quick-porting">
<title>打造 Port 快速上手篇</title>
- <para>本節主要介紹如何來快速打造 port,然而,很多時候這些內容並不是很夠用,
- 建議閱讀本文件中更深奧的地方。</para>
+ <para>本節主要介紹如何來快速打造 port,然而,
+ 很多時候這些內容並不是很夠用,建議閱讀本文件中更深奧的地方。</para>
<para>首先取得該應用程式的原始程式碼壓縮檔(tarball),並把它放到
<makevar>DISTDIR</makevar>,預設路徑應該是
- <filename>/usr/ports/distfiles</filename>。</para>
+ <filename>/usr/ports/distfiles</filename>。</para>
<note>
- <para>下面的例子,是假設並不需要再修改該應用程式的原始碼,就可以在
- FreeBSD 上編譯成功的;假如還需要另外修改才能成功編譯的話,那麼請參考下一章的說明。
- </para>
+ <para>下面的例子,是假設並不需要再修改該應用程式的原始碼,就可以在
+ FreeBSD 上編譯成功的;假如還需要另外修改才能成功編譯的話,
+ 那麼請參考下一章的說明。</para>
</note>
<sect1 id="porting-makefile">
- <title>編寫 <filename>Makefile</filename></title>
+ <title>編寫 <filename>Makefile</filename></title>
- <para>最簡單的 <filename>Makefile</filename> 大概是像這樣:</para>
+ <para>最簡單的 <filename>Makefile</filename> 大概是像這樣:</para>
- <programlisting># New ports collection makefile for: oneko
+ <programlisting># New ports collection makefile for: oneko
# Date created: 5 December 1994
# Whom: asami
#
@@ -120,33 +122,40 @@ USE_IMAKE= yes
.include &lt;bsd.port.mk&gt;</programlisting>
- <para>嗯,大致就是這樣,看看你已經領略多少了呢?看到 <literal>&dollar;FreeBSD&dollar;</literal>
- 這一行的話,別想太多,它是 CVS ID tag 用途,當該 port 正式進入 port tree 時,就會自動轉換為相關字串囉。
- 有關這點的細節部份,可以參閱 <link linkend="porting-samplem">sample Makefile</link> 章節。</para>
+ <para>嗯,大致就是這樣,看看你已經領略多少了呢?
+ 看到 <literal>&dollar;FreeBSD&dollar;</literal> 這一行的話,別想太多
+ ,它是 RCS ID 用途,當該 port 正式進入 port tree 時,
+ CVS 就會自動轉換為相關字串囉。 有關這點的細節部份,可以參閱 <link
+ linkend="porting-samplem">sample Makefile</link> 章節。</para>
</sect1>
<sect1 id="porting-desc">
- <title>撰寫該軟體的說明檔</title>
+ <title>撰寫該軟體的說明檔</title>
- <para>無論是否打算再加工做成 package,有 2 個檔案是任何實體 port (Slave port則不一定)都必須要具備的。
- 這 2 個檔分別是 <filename>pkg-descr</filename> 檔及
- <filename>pkg-plist</filename> 檔。這兩個檔案檔名前面都有 <filename>pkg-</filename>
+ <para>無論是否打算再加工做成 package,有 2 個檔案是任何實體 port (Slave
+ port則不一定)都必須要具備的。 這 2 個檔分別是
+ <filename>pkg-descr</filename> 檔及 <filename>pkg-plist</filename>
+ 檔。 這兩個檔案檔名前面都有 <filename>pkg-</filename>
以跟其他檔案做區別。</para>
<sect2>
<title><filename>pkg-descr</filename></title>
- <para>這是此 port 的詳細說明檔,請用一段或幾段文字來說明該 port 的作用,並附上 WWW
- 網址(若有的話)</para>
+ <para>這是此 port 的詳細說明檔,請用一段或幾段文字來說明該 port
+ 的作用,並附上 WWW 網址(若有的話)。</para>
- <note><para>請注意,這檔絕非「該軟體的說明手冊」或是「如何編譯、使用該 port 的說明」。
- 若是從該軟體的 <filename>README</filename> 或 manpage 直接複製過來的話,
- 請注意,因為它們通常都寫得太詳細、格式較特別(比如 manpage 會自動調整空白),
- 請儘量避免這些冗長贅詞或採用特殊格式。若該軟體有官方版首頁的話,請在此列出來。
- 每個網址請用 <literal>WWW:</literal> 作為開頭,這樣子相關工具程式就會自動處理完畢。<para>
+ <note>
+ <para>請注意,這檔絕非「該軟體的說明手冊」或是「如何編譯、使用該
+ port 的說明」。 若是從該軟體的 <filename>README</filename>
+ 或 manpage 直接複製過來的話,請注意,因為它們通常都寫得太詳細、
+ 格式較特別(比如 manpage 會自動調整空白),
+ 請儘量避免這些冗長贅詞或採用特殊格式。若該軟體有官方版首頁的話,
+ 請在此列出來。 每個網址請用 <literal>WWW:</literal> 作為開頭,
+ 這樣子相關工具程式就會自動處理完畢。</para>
</note>
- <para>該 port 的 <filename>pkg-descr</filename> 內容,大致如下面例子:</para>
+ <para>該 port 的 <filename>pkg-descr</filename> 內容,大致如下面例子
+ :</para>
<programlisting>This is a port of oneko, in which a cat chases a poor mouse all over
the screen.
@@ -159,18 +168,23 @@ WWW: http://www.oneko.org/</programlisting>
<sect2>
<title><filename>pkg-plist</filename></title>
- <para>這是該 port 所會裝的所有檔案清單,另外因為 package 會由這清單所產生,因此也被稱為『packing list
- (打包清單)』。 以 <literal>${PREFIX}</literal> 為基準點,而用相對路徑表示。
- (<literal>${PREFIX}</literal> 通常是 <filename>/usr/local</filename> 或
- <filename>/usr/X11R6</filename>) 但是如果該程式有安裝 man page 的話,則要以類似
- <makevar>MAN<replaceable>n</replaceable>=</makevar> 的方式寫在
- <filename>Makefile</filename> 內,不能列在 <filename>pkg-plist</filename> 哦。
- 除了列出檔案以外,也要把該 port 所會建立的目錄也列進去,方式有兩種:一種是寫在
- <filename>pkg-plist</filename> 內的方式,比如:
- <literal>@dirrm</literal> 。至於另外一種方式,則是寫在 <filename>Makefile</filename> 內,比如
- :<literal>PLIST_FILES=</literal> 之類的方式。</para>
-
- <para>該 port 的 <filename>pkg-plist</filename> 內容,大致如下面例子:</para>
+ <para>這是該 port 所會裝的所有檔案清單,另外因為 package
+ 會由這清單所產生,因此也被稱為『packing list
+ (打包清單)』。 以 <literal>${PREFIX}</literal> 為基準點,
+ 而用相對路徑表示。(<literal>${PREFIX}</literal> 通常是
+ <filename>/usr/local</filename> 或 <filename>/usr/X11R6</filename>)
+ 但是如果該程式有安裝 man page 的話,則要以類似
+ <makevar>MAN<replaceable>n</replaceable>=</makevar> 的方式寫在
+ <filename>Makefile</filename> 內,不能列在
+ <filename>pkg-plist</filename> 哦。
+ 除了列出檔案以外,也要把該 port 所會建立的目錄也列進去,
+ 方式有兩種:一種是寫在 <filename>pkg-plist</filename> 內的方式,
+ 比如:<literal>@dirrm</literal>。 至於另外一種方式,則是寫在
+ <filename>Makefile</filename> 內,比如:
+ <literal>PLIST_FILES=</literal> 之類的方式。</para>
+
+ <para>該 port 的 <filename>pkg-plist</filename> 內容,
+ 大致如下面例子:</para>
<programlisting>bin/oneko
lib/X11/app-defaults/Oneko
@@ -179,23 +193,28 @@ lib/X11/oneko/cat2.xpm
lib/X11/oneko/mouse.xpm
@dirrm lib/X11/oneko</programlisting>
- <para>關於 packing list 方面,可以參閱 &man.pkg.create.1; 會有詳解。</para>
+ <para>關於 packing list 方面,可以參閱 &man.pkg.create.1; 會有詳解
+ 。</para>
<note>
- <para>建議清單內的檔名,依照字母順序作排序,那麼下次要升級時,會比較清楚、方便來更新這份清單。 </para>
+ <para>建議清單內的檔名,依照字母順序作排序,那麼下次要升級時,
+ 會比較清楚、方便來更新這份清單。 </para>
</note>
<note>
- <para>手動生這份清單實在太苦了。尤其若該 port 會裝一大堆檔案的話,請多善用 <link
- linkend="plist-autoplist">自動產生 packing list</link> 會比較省時省力唷。</para>
+ <para>手動生這份清單實在太苦了。尤其若該 port 會裝一大堆檔案的話,
+ 請多善用 <link linkend="plist-autoplist">自動產生 packing
+ list</link> 會比較省時省力唷。</para>
</note>
- <para>只有在一種情況下可以省略不用生 <filename>pkg-plist</filename> 檔:
- 若安裝的 port 相當單純,只有裝一些檔案,以及都在同一目錄下的話,
- 那麼可以在 <filename>Makefile</filename> 內改用 <makevar>PLIST_FILES</makevar> 及
+ <para>只有在一種情況下可以省略不用生 <filename>pkg-plist</filename>
+ 檔: 若安裝的 port 相當單純,只有裝一些檔案,
+ 以及都在同一目錄下的話,那麼可以在 <filename>Makefile</filename>
+ 內改用 <makevar>PLIST_FILES</makevar> 及
<makevar>PLIST_DIRS</makevar> 來取代。
- 比如,可以在上述的 <filename>oneko</filename> port 內不必附上
- <filename>pkg-plist</filename> ,而只需在 <filename>Makefile</filename> 內加入下列幾行:</para>
+ 比如,可以在上述的 <filename>oneko</filename> port 內不必附上
+ <filename>pkg-plist</filename> ,而只需在
+ <filename>Makefile</filename> 內加入下列幾行:</para>
<programlisting>PLIST_FILES= bin/oneko \
lib/X11/app-defaults/Oneko \
@@ -204,44 +223,52 @@ lib/X11/oneko/mouse.xpm
lib/X11/oneko/mouse.xpm
PLIST_DIRS= lib/X11/oneko</programlisting>
- <para>當然,若該 port 並無安裝自屬的目錄的話,就不必設 <makevar>PLIST_DIRS</makevar> 囉。</para>
+ <para>當然,若該 port 並無安裝自屬的目錄的話,就不必設
+ <makevar>PLIST_DIRS</makevar> 囉。</para>
<para>然而,使用 <makevar>PLIST_FILES</makevar> 、<makevar>PLIST_DIRS</makevar> 是必須付出代價:
不能使用 &man.pkg.create.1; 內所說的 command sequences。
因此,這招僅適用於較簡單的 port ,以及簡化該 port 的作法。
此外,這招還有一個好處:可以減少 ports collection 的整體檔案總數。
- 所以,在考慮是否一定要用 <filename>pkg-plist</filename> 之前,可以先斟酌這個替代方案看看。</para>
+ 所以,在考慮是否一定要用 <filename>pkg-plist</filename> 之前,
+ 可以先斟酌這個替代方案看看。</para>
- <para>後面會介紹到如何運用 <filename>pkg-plist</filename>、<makevar>PLIST_FILES</makevar>
- 這些技巧以因應 <link linkend="plist">更複雜的狀況</link>。</para>
+ <para>後面會介紹到如何運用 <filename>pkg-plist</filename>、
+ <makevar>PLIST_FILES</makevar> 這些技巧以因應 <link
+ linkend="plist">更複雜的狀況</link>。</para>
</sect2>
</sect1>
<sect1 id="porting-checksum">
<title>產生 checksum 用途的 distinfo 檔</title>
- <para>只要打『<command>make makesum</command>』就好了,接下來就會自動產生相對應的
- <filename>distinfo</filename> 檔了唷。</para>
+ <para>只要打『<command>make makesum</command>』就好了,
+ 接下來就會自動產生相對應的 <filename>distinfo</filename> 檔了唷
+ 。</para>
- <para>若抓下來的檔案,它的 checksum 會經常變更,而你也很確信所抓的來源是正確無誤的話,
- (比如:來源是光碟或是每天自動產生的文件),那麼可以設定那些檔案為 <makevar>IGNOREFILES</makevar> 。
- 如此一來,在打 <command>make makesum</command> 的時候就不會計算那些檔案的 checksum,而自動改為
- <literal>IGNORE</literal> 囉。</para>
+ <para>若抓下來的檔案,它的 checksum 會經常變更,
+ 而你也很確認所抓的來源是正確無誤的話,
+ (比如:來源是光碟或是每天自動產生的文件),那麼可以設定那些檔案為
+ <makevar>IGNOREFILES</makevar> 。 如此一來,在打
+ <command>make makesum</command> 的時候就不會計算那些檔案的 checksum
+ ,而自動改為 <literal>IGNORE</literal> 囉。</para>
</sect1>
<sect1 id="porting-testing">
<title>檢驗 port 是否完整、可行</title>
- <para>接下來,必須檢驗是否有符合 port 的遊戲規則,包括打包該 port 為 package。
- 以下有幾個需要確認的重要地方:</para>
+ <para>接下來,必須檢驗是否有符合 port 的遊戲規則,包括打包該 port
+ 為 package。 以下有幾個需要確認的重要地方:</para>
<itemizedlist>
<listitem>
- <para>若該 port 沒裝的東西,不要列在 <filename>pkg-plist</filename> 內。</para>
+ <para>若該 port 沒裝的東西,不要列在 <filename>pkg-plist</filename>
+ 內。</para>
</listitem>
<listitem>
- <para>若該 port 有裝的東西,請務必列在 <filename>pkg-plist</filename> 內。</para>
+ <para>若該 port 有裝的東西,請務必列在
+ <filename>pkg-plist</filename> 內。</para>
</listitem>
<listitem>
@@ -249,7 +276,8 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
</listitem>
<listitem>
- <para>該 port 在移除之後,確定都可 <link linkend="plist-cleaning">cleans up</link>。</para>
+ <para>該 port 在移除之後,確定都可 <link
+ linkend="plist-cleaning">cleans up</link>。</para>
</listitem>
</itemizedlist>
@@ -286,19 +314,28 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
</step>
</procedure>
- <para>確認在 <maketarget>package</maketarget> 和 <maketarget>deinstall</maketarget>
- 這兩個階段都沒有任何錯誤訊息出現。
- 完成第三步驟之後,檢查一下是否所裝的檔案、目錄都有移除完畢。此外,第四步驟完成後,也檢查一下以 package
- 裝的該軟體,是否都能正常運作。</para>
+ <para>確認在 <maketarget>package</maketarget> 和
+ <maketarget>deinstall</maketarget> 這兩個階段都沒有任何錯誤訊息出現。
+ 完成第三步驟之後,檢查一下是否所裝的檔案、目錄都有移除完畢。 此外,
+ 第四步驟完成後,也檢查一下以 package 裝的該軟體,是否都能正常運作
+ 。</para>
+
+ <para>最周密的自動方式就是透過裝
+ <application>ports tinderbox</application>。 它會建立
+ <literal>jails</literal> 並管理之,以便您可以測試上述所有步驟,
+ 而不會真正影響您本身的作業系統。 詳情請參考
+ <filename>ports/ports-mgmt/tinderbox</filename>。</para>
</sect1>
<sect1 id="porting-portlint">
<title>以 <command>portlint</command> 來作檢驗</title>
- <para>請用 <command>portlint</command> 來檢查該 port 是否有遵循上述遊戲規則。 說到這 <filename role="package">
- devel/portlint</filename> 它是 ports collection 的其中一個套件。
- 它主要可以用來檢驗 <link linkend="porting-samplem">Makefile</link> 內容是否正確以及
- <link linkend="porting-pkgname">package</link> 是否有正確命名。</para>
+ <para>請用 <command>portlint</command> 來檢查該 port
+ 是否有遵循上述遊戲規則。 說到這
+ <filename role="package">ports-mgmt/portlint</filename>,它是
+ ports collection 的其中一個套件。 它主要可以用來檢驗 <link
+ linkend="porting-samplem">Makefile</link> 內容是否正確以及 <link
+ linkend="porting-pkgname">package</link> 是否有正確命名。</para>
</sect1>
<sect1 id="porting-submitting">
@@ -307,16 +344,22 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
<para>首先,請確認是否有瞭解 <link
linkend="porting-dads">DOs and DON'Ts</link> 該章部分。</para>
- <para>現在你很高興終於打造出 port 來囉,唯一剩下要做的就是把它正式放到 FreeBSD ports tree
- 內,才能讓每個人都能分享使用這個 port。請先拿掉 <filename>work</filename> 目錄或檔名像是
- <filename>pkgname.tgz</filename> 的 package 可以砍掉。接著,只要用 <command>shar `find
- port_dir`</command> 來產生 shar 格式,並配合 &man.send-pr.1; 程式以提交出去。
- (&man.send-pr.1; 的部分可以參閱 <ulink url="&url.articles.contributing;/contrib-how.html#CONTRIB-GENERAL">
- 錯誤報告和意見發表</ulink>) </para>
-
- <para>記得在填寫 PR 時『分類(Category)』選 <literal>ports</literal>,還有『種類(Class)』填 <literal>change-request</literal>
- (千萬別傻傻地把該 PR 的『Confidential(機密)』設為 yes!),此外在『描述(<quote>Description</quote>)』
- 那邊寫上該程式的簡潔說明,而 shar 檔則附在『修正(<quote>Fix</quote>)』欄位內。</para>
+ <para>現在你很高興終於打造出 port 來囉,唯一剩下要做的就是把它正式放到
+ FreeBSD ports tree 內,才能讓每個人都能分享使用這個 port。 請先拿掉
+ <filename>work</filename> 目錄或檔名像是
+ <filename>pkgname.tgz</filename> 的 package 可以砍掉。 接著,
+ 只要用 <command>shar `find port_dir`</command> 來產生 shar 格式,
+ 並配合 &man.send-pr.1; 程式以提交出去。(&man.send-pr.1;
+ 的部分可以參閱 <ulink
+ url="&url.articles.contributing;/contrib-how.html#CONTRIB-GENERAL">
+ 錯誤報告和意見發表</ulink>)</para>
+
+ <para>記得在填寫 PR 時『分類(Category)』選 <literal>ports</literal>,
+ 還有『種類(Class)』填 <literal>change-request</literal>
+ (千萬別傻傻地把該 PR 的『Confidential(機密)』設為 yes!),
+ 此外在『描述(<quote>Description</quote>)』
+ 那邊寫上該程式的簡潔說明,而 shar 檔則附在『修正(<quote>Fix</quote>)
+ 』欄位內。</para>
<note>
<para>若 Synopsis 欄清楚描述該 PR 重點的話,那麼會讓整個流程更為順暢。
@@ -328,15 +371,18 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
若你也採用這樣的格式的話,那麼會被受理的機會就會越高囉。</para>
</note>
- <para>再次強調一點:<emphasis>不必附上原始 source 的 distfile,也就是 <filename>work</filename> 目錄。
- 同時,也不必附上 <command>make package</command> 時產生的 package。</emphasis>.</para>
+ <para>再次強調一點:<emphasis>不必附上原始 source 的 distfile
+ ,也就是 <filename>work</filename> 目錄。 同時,也不必附上
+ <command>make package</command> 時產生的 package</emphasis>。</para>
- <para>送出 port 之後,請耐心等候佳音。有時候可能需要等個幾天或幾個月時間,才會在 FreeBSD ports tree 上正式出現。
- 此外,隨時可以查閱 <ulink
+ <para>送出 port 之後,請耐心等候佳音。
+ 有時候可能需要等個幾天或幾個月時間,才會在 FreeBSD ports tree
+ 上正式出現。 此外,隨時可以查閱 <ulink
url="http://www.FreeBSD.org/cgi/query-pr-summary.cgi?category=ports">
等待 committed to FreeBSD 的 port</ulink> 列表。</para>
- <para>一旦我們開始處理你送來的 port 之後,如果有一些意見需要溝通的話,那麼會先 feedback 給你,
+ <para>一旦我們開始處理你送來的 port 之後,如果有一些意見需要溝通的話,
+ 那麼會先 feedback 給你,
之後確定都沒問題,就會放到 port tree 內囉!
你的大名會被記在 <ulink url="&url.articles.contributors;/contrib-additional.html">Additional FreeBSD Contributors</ulink>
列表上,以及其他檔案。聽起來,挺不賴的不是嗎!? <!-- smiley
@@ -347,14 +393,17 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
<chapter id="slow">
<title>Slow Porting</title>
- <para>Ok...事實上並不太可能這麼簡單,port 方面可能需要作些修改才能正常使用。
- 因此,本節將一步一步來介紹如何修改上一章的樣本以正常使用。</para>
+ <para>Ok...事實上並不太可能這麼簡單,port
+ 方面可能需要作些修改才能正常使用。 因此,
+ 本節將一步一步來介紹如何修改上一章的樣本以正常使用。</para>
<sect1 id="slow-work">
<title>How things work</title>
- <para>首先,先介紹一下在你所作的 port 目錄內打 <command>make</command> 時,所會作哪些事情的順序吧。
- 你可以另開一窗來看 <filename>bsd.port.mk</filename> 內容,以便瞭解我們下面在講什麼。</para>
+ <para>首先,先介紹一下在你所作的 port 目錄內打 <command>make</command>
+ 時,所會作哪些事情的順序吧。
+ 你可以另開一窗來看 <filename>bsd.port.mk</filename>
+ 內容,以便瞭解我們下面在講什麼。</para>
<para>但別太擔心是否完全看懂
<filename>bsd.port.mk</filename> 在做啥,很多人都還沒完全看完...
@@ -366,32 +415,40 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
<para>首先,進行 <maketarget>fetch</maketarget> 階段。
<maketarget>fetch</maketarget> 是確認 tarball 檔有沒有已在
<makevar>DISTDIR</makevar> 內了?若 <maketarget>fetch</maketarget>
- 在 <makevar>DISTDIR</makevar> 找不到的話,它會搜尋 Makefile 內的 <makevar>MASTER_SITES</makevar> URL
+ 在 <makevar>DISTDIR</makevar> 找不到的話,它會搜尋 Makefile
+ 內的 <makevar>MASTER_SITES</makevar> URL
,或者是主 FTP 站專門放備份 distfiles 的目錄 <ulink
- url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/"></ulink>。
- 假設都找不到的話,但是網路有接上 Internet 的話,它會試著用 <makevar>FETCH</makevar> 來抓所指定的檔案。
- 抓到之後,它會把檔案存到 <makevar>DISTDIR</makevar> 以便開始使用或日後運用。</para>
+ url="ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/"></ulink>
+ 。 假設都找不到的話,但是網路有接上 Internet 的話,它會試著用
+ <makevar>FETCH</makevar> 來抓所指定的檔案。
+ 抓到之後,它會把檔案存到 <makevar>DISTDIR</makevar>
+ 以便開始使用或日後運用。</para>
</step>
<step>
- <para>其次,進行 <maketarget>extract</maketarget> 階段,它會從 <makevar>DISTDIR</makevar> 內找出該 port
- 所需的檔案(通常是 gzip 格式的 tarball),然後解壓縮到 <makevar>WRKDIR</makevar> 所設定的臨時目錄名稱
- (預設是 <filename>work</filename> 目錄)內。</para>
+ <para>其次,進行 <maketarget>extract</maketarget> 階段,它會從
+ <makevar>DISTDIR</makevar> 內找出該 port 所需的檔案(通常是 gzip
+ 格式的 tarball),然後解壓縮到 <makevar>WRKDIR</makevar>
+ 所設定的臨時目錄名稱(預設是 <filename>work</filename> 目錄)內。</para>
</step>
<step>
- <para>之後,進行 <maketarget>patch</maketarget> 階段,一開始會先套用 <makevar>PATCHFILES</makevar>
- 指定的任何 patch 檔。
- 接著,是 <makevar>PATCHDIR</makevar>(預設是 <filename>files</filename> 子目錄) 內的檔名為
- <filename>patch-<replaceable>*</replaceable></filename> 之類的檔案,會以字母順序而逐一套用 patch。</para>
+ <para>之後,進行 <maketarget>patch</maketarget> 階段,
+ 一開始會先套用 <makevar>PATCHFILES</makevar> 所指定的任何 patch
+ 檔。 接著是 <makevar>PATCHDIR</makevar>(預設是
+ <filename>files</filename> 子目錄) 內的檔名為
+ <filename>patch-<replaceable>*</replaceable></filename>
+ 之類的檔案,會以字母順序而逐一套用 patch。</para>
</step>
<step>
- <para>接著是 <maketarget>configure</maketarget> 階段,可以照 port 的類型來作各種不同設定以調整,比如:</para>
+ <para>接著是 <maketarget>configure</maketarget> 階段,可以照 port
+ 的類型來作各種不同設定以調整,比如:</para>
<orderedlist>
<listitem>
- <para>若有放 <filename>scripts/configure</filename> 的話,那麼就會跑裡面的設定。</para>
+ <para>若有放 <filename>scripts/configure</filename> 的話,
+ 那麼就會跑裡面的設定。</para>
</listitem>
<listitem>
@@ -410,9 +467,10 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
<step>
<para>最後是 <maketarget>build</maketarget> 階段,它會在該
- port 的 working directory(由 <makevar>WRKSRC</makevar> 所設定) 內開始編譯。
- 若有設 <makevar>USE_GMAKE</makevar> 的話,那麼就會改用 GNU <command>make</command>
- 來編譯,否則就用系統本身的 <command>make</command> 來編譯。</para>
+ port 的 working directory(由 <makevar>WRKSRC</makevar> 所設定)
+ 內開始編譯。 若有設 <makevar>USE_GMAKE</makevar> 的話,
+ 那麼就會改用 GNU <command>make</command> 來編譯,
+ 否則就用系統本身的 <command>make</command> 來編譯。</para>
</step>
</procedure>
@@ -423,18 +481,23 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
或者把這些檔名的 script 丟到 <filename>scripts</filename> 子目錄去,
這樣子它們就會在各預設階段的之前、之後進行囉。</para>
- <para>舉例來說,若在 <filename>Makefile</filename> 內設定 <maketarget>post-extract</maketarget>
- ,而且在 <filename>scripts</filename> 子目錄內又有 <filename>pre-build</filename> 檔的話,
- 那麼在作解壓縮之後,就會開始 <maketarget>post-extract</maketarget> 階段以進行解壓縮後的後續動作,
- 而在跑 build 階段之前,就會先執行 <filename>pre-build</filename> 這隻 script 作先期準備。
- 通常較簡單的修改動作,建議直接放在 <filename>Makefile</filename>
- 內就好了,因為這樣會比較方便加上這些原本沒有的階段,同時也方便他人協助除錯。</para>
-
- <para>預設的各階段動作都是照
- <filename>bsd.port.mk</filename> 內的
- <maketarget>do-<replaceable>something</replaceable></maketarget> 之類所定義的。
- 舉例:<maketarget>do-extract</maketarget> 就是定義怎麼把檔案解壓縮的。
- 若對預設方式覺得不妥的話,都可以在該 port 的 <filename>Makefile</filename> 重新定義。</para>
+ <para>舉例來說,若在 <filename>Makefile</filename> 內設定
+ <maketarget>post-extract</maketarget>,而且在
+ <filename>scripts</filename> 子目錄內又有
+ <filename>pre-build</filename> 檔的話,那麼在作解壓縮之後,就會開始
+ <maketarget>post-extract</maketarget> 階段以進行解壓縮後的後續動作,
+ 而在跑 build 階段之前,就會先執行 <filename>pre-build</filename>
+ 這隻 script 作先期準備。 通常較簡單的修改動作,建議直接放在
+ <filename>Makefile</filename> 內就好了,
+ 因為這樣會比較方便加上這些原本沒有的階段,同時也方便他人協助除錯
+ 。</para>
+
+ <para>預設的各階段動作都是照 <filename>bsd.port.mk</filename> 內的
+ <maketarget>do-<replaceable>something</replaceable></maketarget>
+ 之類所定義的。 舉例:<maketarget>do-extract</maketarget>
+ 就是定義怎麼把檔案解壓縮的。
+ 若對預設方式覺得不妥的話,都可以在該 port 的
+ <filename>Makefile</filename> 重新定義。</para>
<note>
<para>The <quote>main</quote> targets (e.g.,
@@ -447,72 +510,83 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
the way <maketarget>extract</maketarget> operates!</para>
</note>
- <para>現在,你已經知道打 <command>make</command> 到底會作些什麼事囉,接下來會教你如何作更完美的
- port。</para>
+ <para>現在,你已經知道打 <command>make</command> 到底會作些什麼事囉,
+ 接下來會教你如何作更完美的 port。</para>
</sect1>
<sect1 id="slow-sources">
<title>取得原始的 source 檔</title>
- <para>取得原始的 source 檔(通常檔名是 <filename><replaceable>foo</replaceable>.tar.gz</filename>
- 或 <filename><replaceable>foo</replaceable>.tar.Z</filename> 之類的壓縮檔),
- 然後會把抓下來的檔案放在 <makevar>DISTDIR</makevar> 內。
- 記得:抓的時候,儘量使用『該軟體主要的正式網站』上面的來源檔,以確保檔案有效、可信。</para>
+ <para>取得原始的 source 檔(通常檔名是
+ <filename><replaceable>foo</replaceable>.tar.gz</filename>
+ 或 <filename><replaceable>foo</replaceable>.tar.Z</filename>
+ 之類的壓縮檔),然後會把抓下來的檔案放在 <makevar>DISTDIR</makevar>
+ 內。 記得:抓的時候,儘量使用『該軟體主要的正式網站』上面的來源檔
+ ,以確保檔案有效、可信。</para>
- <para>需要設 <makevar>MASTER_SITES</makevar> 以指定原始檔案是放在何處。相關網址在
- <filename>bsd.sites.mk</filename> 內有一些方便的速記表可以使用。 請盡可能多用對應這些網址的變數,
+ <para>需要設 <makevar>MASTER_SITES</makevar> 以指定原始檔案是放在何處。
+ 相關網址在 <filename>bsd.sites.mk</filename>
+ 內有一些方便的速記表可以使用。 請盡可能多用對應這些網址的變數,
以避免同樣的一堆網址有重複很多次出現在 port tree 內。
否則,這些網址只要一有改變的話,那麼就會成為維護 port 的夢魘。</para>
- <para>如果該檔並沒有放在公開的 FTP 站或網站(HTTP)上,或者該檔並非一般標準格式的話,
- 那麼可以考慮複製該檔,然後放到你可掌握、可信任的 FTP 站或網站(HTTP)上,比如:你自己的網頁空間。</para>
+ <para>如果該檔並沒有放在公開的 FTP 站或網站(HTTP)上,
+ 或者該檔並非一般標準格式的話,
+ 那麼可以考慮複製該檔,然後放到你可掌握、可信任的 FTP 站或網站(HTTP)
+ 上,比如:你自己的網頁空間。</para>
<para>若找不到地方(方便、可信任)來放檔案的話,
- 那麼可以 <quote>house(暫放)</quote> 在 <hostid>ftp.FreeBSD.org</hostid> 上的 committer 自屬空間內;
+ 那麼可以 <quote>house(暫放)</quote> 在
+ <hostid>ftp.FreeBSD.org</hostid> 上的 committer 自屬空間內;
然而,這是最不理想的解法。
- 檔案要放到該 committer 的 <hostid>freefall</hostid> 上的 <filename>~/public_distfiles/</filename> 目錄內才可以。
- 請與協助 commit 你的 port 的那位 committer 聯繫,以便把檔案放到他的目錄內。
+ 檔案要放到該 committer 的 <hostid>freefall</hostid> 上的
+ <filename>~/public_distfiles/</filename> 目錄內才可以。
+ 請與協助 commit 你的 port 的那位 committer 聯繫,
+ 以便把檔案放到他的目錄內。
那位 committer 同時也會把 <makevar>MASTER_SITES</makevar> 設為
<makevar>MASTER_SITE_LOCAL</makevar>,並且把
<makevar>MASTER_SITE_SUBDIR</makevar> 設為他自己的
<hostid>freefall</hostid> 帳號名稱。</para>
<para>若該 port 的原始檔打包會經常重包,但原作者卻沒更新版號的話,
- 請考慮把該檔改放到自己的網頁空間,並且把自己網頁空間列為 <makevar>MASTER_SITES</makevar> 的第一順位。
- 或者請與原作者聯繫:請他不要這樣做(不斷重包同樣的檔案);如此一來,才有助於建立一定程度的 source code 版本控制。
- 把檔案另外複製一份放到自屬網頁空間的話,不但可有效防止使用者會發生 <errorname>checksum mismatch(檔案經檢查有問題)</errorname>
- 的錯誤訊息,也可降低我們 FTP 站維護者的工作量。此外,若該 port 的檔案僅有一個主要網址,
- 那麼建議:請在自屬網站上放上備份檔,並修改 <makevar>MASTER_SITES</makevar> 把你的網址列為第二順位。</para>
+ 請考慮把該檔改放到自己的網頁空間,並且把自己網頁空間列為
+ <makevar>MASTER_SITES</makevar> 的第一順位。
+ 或者請與原作者聯繫:請他不要這樣做(不斷重包同樣的檔案);如此一來,
+ 才有助於建立一定程度的 source code 版本控制。
+ 把檔案另外複製一份放到自屬網頁空間的話,不但可有效防止使用者會發生
+ <errorname>checksum mismatch(檔案經檢查有問題)</errorname>
+ 的錯誤訊息,也可降低我們 FTP 站維護者的工作量。此外,若該 port
+ 的檔案僅有一個主要網址,
+ 那麼建議:請在自屬網站上放上備份檔,並修改
+ <makevar>MASTER_SITES</makevar> 把你的網址列為第二順位。</para>
<para>若該 port 需要一些額外 `patches'(可透過 Internet 下載),並放在
- <makevar>DISTDIR</makevar> 內,不必擔心這些 patch 檔是否得都跟原始檔一樣來自同一網站,
+ <makevar>DISTDIR</makevar> 內,不必擔心這些 patch
+ 檔是否得都跟原始檔一樣來自同一網站,
這些情況有另外的解法(請看下面的 <link
- linkend="porting-patchfiles">PATCHFILES</link> 介紹部分)。</para>
+ linkend="porting-patchfiles">PATCHFILES</link> 介紹部分)。</para>
</sect1>
<sect1 id="slow-modifying">
- <title>Modifying the port</title>
-
- <para>Unpack a copy of the tarball in a private directory and make
- whatever changes are necessary to get the port to compile properly
- under the current version of FreeBSD. Keep <emphasis>careful
- track</emphasis> of everything you do, as you will be automating
- the process shortly. Everything, including the deletion, addition,
- or modification of files should be doable using an automated script
- or patch file when your port is finished.</para>
-
- <para>If your port requires significant user interaction/customization
- to compile or install, you should take a look at one of Larry Wall's
- classic <application>Configure</application> scripts and perhaps do
- something similar yourself. The goal of the new ports collection is
- to make each port as <quote>plug-and-play</quote> as possible for the
- end-user while using a minimum of disk space.</para>
+ <title>量身打造 port</title>
+
+ <para>解開壓縮檔,然後開始逐一修改,使該 port 在目前所用的 FreeBSD
+ 版本上得以順利編譯。
+ 所做的每個動作請都 <emphasis>仔細記錄</emphasis>,
+ 如此一來才能迅速自動套用這些修改。
+ 在完成 port 之後,每項動作包括:對於檔案的刪除、增加、修改,
+ 要記得存為自動化的 script 或者 patch 檔形式,以利他人直接套用。</para>
+
+ <para>若該 port 需要使用者的互動、自訂功能來編譯、安裝的話,
+ 那麼建議揣摩看看 Larry Wall 的經典之作
+ <application>Configure</application> scripts 來完成類似效果。
+ Ports collection 的目的之一,就是讓每個 port 儘量用最小空間,
+ 來做出軟體的 <quote>plug-and-play(即插即用)</quote>。</para>
<note>
- <para>Unless explicitly stated, patch files, scripts, and other
- files you have created and contributed to the FreeBSD ports
- collection are assumed to be covered by the standard BSD copyright
- conditions.</para>
+ <para>除非有明確聲明,否則你所提交給 FreeBSD ports collection 的
+ patch 檔、相關 script 檔及其他檔案,都會假設是以標準的 BSD
+ 版權形式來發佈。</para>
</note>
</sect1>
@@ -588,7 +662,16 @@ PLIST_DIRS= lib/X11/oneko</programlisting>
<filename>Makefile</filename>. A list of files to convert can
be specified:</para>
- <programlisting>USE_DOS2UNIX= util.c util.h</programlisting>
+ <programlisting>USE_DOS2UNIX= util.c util.h</programlisting>
+
+ <para>若想要轉換所有子目錄內的某類別檔案,可以使用
+ <makevar>DOS2UNIX_REGEX</makevar>。 它的參數是
+ <command>find</command> 相容的正規表達式。 相關格式可參閱
+ &man.re.format.7;。 對於所指定副檔名的檔案之轉換而言,這相當好用,
+ 舉例來說,只動所有原始碼部分而不改 binary 檔案:</para>
+
+ <programlisting>USE_DOS2UNIX= yes
+DOS2UNIX_REGEX= .*\.(c|cpp|h)</programlisting>
</sect1>
<sect1 id="slow-configure">
@@ -923,6 +1006,27 @@ PORTEPOCH= 1</programlisting>
them part of <makevar>PORTNAME</makevar>.</para>
</sect2>
+ <sect2>
+ <title><makevar>LATEST_LINK</makevar></title>
+
+ <para>在某些情況,可能會同時存在有不同版本的同一程式。
+ 由於它們可能會有同樣的 <makevar>PORTNAME</makevar>、
+ <makevar>PKGNAMEPREFIX</makevar>,甚至
+ <makevar>PKGNAMESUFFIX</makevar> 也相同,所以得讓這些程式有所不同,
+ 才能讓 port 的 index 以及 package 能順利產生。 遇到這類情況,
+ the optional <makevar>LATEST_LINK</makevar> variable should be set to
+ a different value for all ports except the <quote>main</quote>
+ one &mdash; see the <filename>editors/vim5</filename> and
+ <filename>editors/vim</filename> ports, and the
+ <filename>www/apache*</filename> family for examples of its use.
+ Note that how to choose a <quote>main</quote> version &mdash;
+ <quote>most popular</quote>, <quote>best supported</quote>,
+ <quote>least patched</quote>, and so on &mdash; is outside the
+ scope of this handbook's recommendations; we only tell you how to
+ specify the other ports' versions after you have picked a
+ <quote>main</quote> one.</para>
+ </sect2>
+
<sect2 id="porting-pkgname">
<title>Package Naming Conventions</title>
@@ -959,17 +1063,33 @@ PORTEPOCH= 1</programlisting>
</listitem>
<listitem>
- <para>The first letter of <filename>name</filename> part
- should be lowercase. (The rest of the name can contain
+ <para>The first letter of the <filename>name</filename> part
+ should be lowercase. (The rest of the name may contain
capital letters, so use your own discretion when you are
converting a software name that has some capital letters in it.)
- There is a tradition of naming <literal>perl 5</literal> modules by
+ There is a tradition of naming <literal>Perl 5</literal> modules by
prepending <literal>p5-</literal> and converting the double-colon
separator to a hyphen; for example, the
<literal>Data::Dumper</literal> module becomes
- <literal>p5-Data-Dumper</literal>. If the software in question
- has numbers, hyphens, or underscores in its name, you may include
- them as well (like <literal>kinput2</literal>).</para>
+ <literal>p5-Data-Dumper</literal>.</para>
+ </listitem>
+
+ <listitem>
+ <para>Make sure that the port's name and version are clearly
+ separated and placed into the <makevar>PORTNAME</makevar> and
+ <makevar>PORTVERSION</makevar> variables. The only reason for
+ <makevar>PORTNAME</makevar> to contain a version part is if
+ the upstream distribution is really named that way, as in
+ the <filename>textproc/libxml2</filename> or
+ <filename>japanese/kinput2-freewnn</filename> ports. Otherwise,
+ the <makevar>PORTNAME</makevar> should not contain any
+ version-specific information. It is quite normal for several
+ ports to have the same <makevar>PORTNAME</makevar>, as the
+ <filename>www/apache*</filename> ports do; in that case,
+ different versions (and different index entries) are
+ distinguished by the <makevar>PKGNAMEPREFIX</makevar>,
+ <makevar>PKGNAMESUFFIX</makevar>, and
+ <makevar>LATEST_LINK</makevar> values.</para>
</listitem>
<listitem>
@@ -1041,15 +1161,6 @@ PORTEPOCH= 1</programlisting>
</row>
<row>
- <entry>XFree86-3.3.6</entry>
- <entry>(empty)</entry>
- <entry>XFree86</entry>
- <entry>(empty)</entry>
- <entry>3.3.6</entry>
- <entry>No changes required</entry>
- </row>
-
- <row>
<entry>EmiClock-1.0.2</entry>
<entry>(empty)</entry>
<entry>emiclock</entry>
@@ -1363,13 +1474,19 @@ PORTEPOCH= 1</programlisting>
<row>
<entry><filename>games</filename></entry>
- <entry>Games.</entry>
+ <entry>遊戲。</entry>
+ <entry></entry>
+ </row>
+
+ <row>
+ <entry><filename>geography*</filename></entry>
+ <entry>地理圖資相關的軟體。</entry>
<entry></entry>
</row>
<row>
<entry><filename>german</filename></entry>
- <entry>German language support.</entry>
+ <entry>德文相關支援。</entry>
<entry></entry>
</row>
@@ -1383,7 +1500,13 @@ PORTEPOCH= 1</programlisting>
<row>
<entry><filename>graphics</filename></entry>
- <entry>Graphics utilities.</entry>
+ <entry>圖形處理的工具軟體。</entry>
+ <entry></entry>
+ </row>
+
+ <row>
+ <entry><filename>gnustep*</filename></entry>
+ <entry>GNUstep 桌面環境相關的軟體。</entry>
<entry></entry>
</row>
@@ -1447,6 +1570,12 @@ PORTEPOCH= 1</programlisting>
</row>
<row>
+ <entry><filename>kld*</filename></entry>
+ <entry>Kernel loadable modules。</entry>
+ <entry></entry>
+ </row>
+
+ <row>
<entry><filename>korean</filename></entry>
<entry>Korean language support.</entry>
<entry></entry>
@@ -1573,6 +1702,11 @@ PORTEPOCH= 1</programlisting>
</row>
<row>
+ <entry><filename>ports-mgmt</filename></entry>
+ <entry>FreeBSD ports 及 packages 的管理、安裝、開發。</entry>
+ </row>
+
+ <row>
<entry><filename>portuguese</filename></entry>
<entry>Portuguese language support.</entry>
<entry></entry>
@@ -1637,20 +1771,26 @@ PORTEPOCH= 1</programlisting>
</row>
<row>
+ <entry><filename>spanish*</filename></entry>
+ <entry>西班牙文的相關支援。</entry>
+ <entry></entry>
+ </row>
+
+ <row>
<entry><filename>sysutils</filename></entry>
<entry>System utilities.</entry>
<entry></entry>
</row>
<row>
- <entry><filename>tcl80*</filename></entry>
- <entry>Ports that use Tcl version 8.0 to run.</entry>
+ <entry><filename>tcl*</filename></entry>
+ <entry>使用 Tcl 語言的軟體。</entry>
<entry></entry>
</row>
<row>
- <entry><filename>tcl81*</filename></entry>
- <entry>Ports that use Tcl version 8.1 to run.</entry>
+ <entry><filename>tcl80*</filename></entry>
+ <entry>Ports that use Tcl version 8.0 to run.</entry>
<entry></entry>
</row>
@@ -1680,6 +1820,12 @@ PORTEPOCH= 1</programlisting>
</row>
<row>
+ <entry><filename>tk*</filename></entry>
+ <entry>使用 Tk 語言的程式。</entry>
+ <entry></entry>
+ </row>
+
+ <row>
<entry><filename>tk80*</filename></entry>
<entry>Ports that use Tk version 8.0 to run.</entry>
<entry></entry>
@@ -1755,6 +1901,12 @@ PORTEPOCH= 1</programlisting>
</row>
<row>
+ <entry><filename>x11-drivers</filename></entry>
+ <entry>X11 驅動程式。</entry>
+ <entry></entry>
+ </row>
+
+ <row>
<entry><filename>x11-fm</filename></entry>
<entry>X11 file managers.</entry>
<entry></entry>
@@ -1792,9 +1944,8 @@ PORTEPOCH= 1</programlisting>
<row>
<entry><filename>xfce*</filename></entry>
- <entry>Ports relating to the
- <ulink url="http://www.xfce.org/">Xfce</ulink> desktop
- environment.</entry>
+ <entry><ulink url="http://www.xfce.org/">Xfce</ulink>
+ 桌面環境的相關軟體。</entry>
<entry></entry>
</row>
@@ -1861,6 +2012,12 @@ PORTEPOCH= 1</programlisting>
</listitem>
<listitem>
+ <para>會安裝 kernel loadable modules 的 port 請在
+ <makevar>CATEGORIES</makevar> 內加上 <filename>kld</filename>
+ 這個虛擬目錄。</para>
+ </listitem>
+
+ <listitem>
<para><filename>misc</filename>
should not appear with any other non-virtual category.
If you have <literal>misc</literal> with something else in
@@ -1987,7 +2144,7 @@ PORTEPOCH= 1</programlisting>
the above but much less involved, since no ports will
actually have to move. In this case, the only patches to
include in the PR would be those to add the new category to the
- <makevar>CATEGORIES</makevar>s of the affected ports.</para>
+ <makevar>CATEGORIES</makevar> of the affected ports.</para>
</sect2>
<sect2 id="proposing-reorg">
@@ -2103,8 +2260,9 @@ PORTEPOCH= 1</programlisting>
archives such as X-contrib, GNU, or Perl CPAN, you may be able
refer to those sites in an easy compact form using
<makevar>MASTER_SITE_<replaceable>*</replaceable></makevar>
- (e.g., <makevar>MASTER_SITE_XCONTRIB</makevar> and
- <makevar>MASTER_SITE_PERL_GNU</makevar>). Simply set
+ (比如:<makevar>MASTER_SITE_XCONTRIB</makevar>、
+ <makevar>MASTER_SITE_GNU</makevar>、
+ <makevar>MASTER_SITE_PERL_CPAN</makevar>)。 Simply set
<makevar>MASTER_SITES</makevar> to one of these variables and
<makevar>MASTER_SITE_SUBDIR</makevar> to the path within the
archive. Here is an example:</para>
@@ -3185,19 +3343,6 @@ ALWAYS_KEEP_DISTFILES= yes
same as <makevar>DEPENDS_TARGET</makevar>.</para>
</sect2>
- <sect2>
- <title><makevar>DEPENDS</makevar></title>
-
- <para>If there is a dependency that does not fall into either of the
- above categories, or your port requires having the source of
- the other port extracted in addition to having it installed,
- then use this variable. This is a list of
- <replaceable>dir</replaceable><optional><replaceable>:target</replaceable></optional>,
- as there is nothing to check, unlike the previous four. The
- <replaceable>target</replaceable> part can be omitted if it is the
- same as <makevar>DEPENDS_TARGET</makevar>.</para>
- </sect2>
-
<sect2 id="use-vars">
<title><makevar>USE_<replaceable>*</replaceable></makevar></title>
@@ -3259,6 +3404,17 @@ ALWAYS_KEEP_DISTFILES= yes
</row>
<row>
+ <entry><makevar>USE_CDRTOOLS</makevar></entry>
+
+ <entry>該 port 需要 <application>cdrecord</application>,
+ 無論是 <filename
+ role="package">sysutils/cdrtools</filename> 或 <filename
+ role="package">sysutils/cdrtools-cjk</filename> 哪一種的
+ <application>cdrecord</application> 皆可,視使用者偏好而定
+ 。</entry>
+ </row>
+
+ <row>
<entry><makevar>USE_GCC</makevar></entry>
<entry>The port requires a specific version of
@@ -3269,9 +3425,7 @@ ALWAYS_KEEP_DISTFILES= yes
the base system is used when it satisfies the requested
version, otherwise an appropriate <command>gcc</command> is
compiled from ports and the <makevar>CC</makevar> and
- <makevar>CXX</makevar> variables are adjusted.
- <makevar>USE_GCC</makevar> can't be used together with
- <makevar>USE_AUTOTOOLS=libtool:<replaceable>XX</replaceable></makevar>.</entry>
+ <makevar>CXX</makevar> variables are adjusted.</entry>
</row>
</tbody>
@@ -3295,8 +3449,10 @@ ALWAYS_KEEP_DISTFILES= yes
and PEAR modules. <application>Python</application> is discussed
in <xref linkend="using-python">, while
<application>Ruby</application> in <xref linkend="using-ruby">.
- Finally, <xref linkend="using-sdl"> provides variables used for
- <application>SDL</application> applications.</para>
+ <xref linkend="using-sdl"> provides variables used for
+ <application>SDL</application> applications and finally,
+ <xref linkend="using-xfce"> contains information on
+ <application>Xfce</application>.</para>
</sect2>
@@ -3304,7 +3460,8 @@ ALWAYS_KEEP_DISTFILES= yes
<title>Minimal version of a dependency</title>
<para>A minimal version of a dependency can be specified in any
- <makevar>*_DEPENDS</makevar> variable using the following
+ <makevar>*_DEPENDS</makevar> variable except
+ <makevar>LIB_DEPENDS</makevar> using the following
syntax:</para>
<programlisting>p5-Spiffy>=0.26:${PORTSDIR}/devel/p5-Spiffy</programlisting>
@@ -3346,15 +3503,6 @@ ALWAYS_KEEP_DISTFILES= yes
<programlisting>BUILD_DEPENDS= ${NONEXISTENT}:${PORTSDIR}/graphics/jpeg:extract</programlisting>
will always descend to the <literal>jpeg</literal> port and extract it.</para>
-
- <para>Do not use <makevar>DEPENDS</makevar> unless there is no other
- way the behavior you want can be accomplished. It will cause the
- other port to always be built (and installed, by default), and the
- dependency will go into the packages as well. If this is really
- what you need, you should probably write it as
- <literal>BUILD_DEPENDS</literal> and
- <literal>RUN_DEPENDS</literal> instead&mdash;at least the
- intention will be clear.</para>
</sect2>
<sect2>
@@ -3406,8 +3554,8 @@ PKGNAMESUFFIX= ${RESOLUTION}
RESOLUTION?= 300
.if ${RESOLUTION} != 118 && ${RESOLUTION} != 240 && \
${RESOLUTION} != 300 && ${RESOLUTION} != 400
- @${ECHO} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
- @${ECHO} "Possible values are: 118, 240, 300 (default) and 400."
+ @${ECHO_MSG} "Error: invalid value for RESOLUTION: \"${RESOLUTION}\""
+ @${ECHO_MSG} "Possible values are: 118, 240, 300 (default) and 400."
@${FALSE}
.endif</programlisting>
@@ -3473,7 +3621,7 @@ MASTERDIR= ${.CURDIR}/../xdvi300
it unless the default is not suitable for your port.</para>
<para>If your port anchors its man tree somewhere other than
- <makevar>PREFIX</makevar>, you can use the
+ <makevar>MANPREFIX</makevar>, you can use the
<makevar>MANPREFIX</makevar> to set it. Also, if only manpages in
certain sections go in a non-standard place, such as some <literal>perl</literal> modules
ports, you can set individual man paths using
@@ -3498,18 +3646,33 @@ MANCOMPRESSED= yes</programlisting>
<para>This states that six files are installed by this port;</para>
- <programlisting>${PREFIX}/man/man1/foo.1.gz
-${PREFIX}/man/ja/man1/foo.1.gz
+ <programlisting>${MANPREFIX}/man/man1/foo.1.gz
+${MANPREFIX}/man/ja/man1/foo.1.gz
${PREFIX}/share/foobar/man/man3/bar.3.gz
${PREFIX}/share/foobar/man/ja/man3/bar.3.gz
-${PREFIX}/man/man4/baz.4.gz
-${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
+${MANPREFIX}/man/man4/baz.4.gz
+${MANPREFIX}/man/ja/man4/baz.4.gz</programlisting>
- <para>Additionally <filename>${PREFIX}/man/man8/alt-name.8.gz</filename>
+ <para>Additionally <filename>${MANPREFIX}/man/man8/alt-name.8.gz</filename>
may or may not be installed by your port. Regardless, a
symlink will be made to join the foo(1) manpage and
alt-name(8) manpage.</para>
+ <para>If only some manpages are translated, you can use several variables
+ dynamically created from <makevar>MANLANG</makevar> content:</para>
+
+ <programlisting>MANLANG= "" de ja
+MAN1= foo.1
+MAN1_EN= bar.1
+MAN3_DE= baz.3</programlisting>
+
+ <para>This translates into this list of files:</para>
+
+ <programlisting>${MANPREFIX}/man/man1/foo.1.gz
+${MANPREFIX}/man/de/man1/foo.1.gz
+${MANPREFIX}/man/ja/man1/foo.1.gz
+${MANPREFIX}/man/man1/bar.1.gz
+${MANPREFIX}/man/de/man3/baz.3.gz</programlisting>
</sect1>
<sect1 id="makefile-info">
@@ -3517,9 +3680,22 @@ ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
<para>If your package needs to install GNU info files, they should be
listed in the <makevar>INFO</makevar> variable (without the trailing
- <literal>.info</literal>), and appropriate installation/de-installation
- code will be automatically added to the temporary
- <filename>pkg-plist</filename> before package registration.</para>
+ <literal>.info</literal>), one entry per document. These files
+ are assumed to be installed to
+ <filename><makevar>PREFIX</makevar>/<makevar>INFO_PATH</makevar></filename>.
+ You can change <makevar>INFO_PATH</makevar> if your package uses
+ a different location. However, this is not recommended. These entries
+ contain just the path relative to
+ <filename><makevar>PREFIX</makevar>/<makevar>INFO_PATH</makevar></filename>.
+ For example, <filename role="package">lang/gcc33</filename> installs
+ info files to
+ <filename><makevar>PREFIX</makevar>/<makevar>INFO_PATH</makevar>/gcc33</filename>,
+ and <makevar>INFO</makevar> will be something like this:
+ <programlisting>INFO= gcc33/cpp gcc33/cppinternals gcc33/g77 ...
+</programlisting>
+ Appropriate installation/de-installation code will be automatically
+ added to the temporary <filename>pkg-plist</filename> before package
+ registration.</para>
</sect1>
<sect1 id="makefile-options">
@@ -3537,7 +3713,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
price of one.</para>
<sect2>
- <title><makevar>KNOBS</makevar></title>
+ <title>Knobs</title>
<sect3>
<title><makevar>WITH_<replaceable>*</replaceable></makevar> and
@@ -3585,9 +3761,9 @@ ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
<entry><makevar>WITH_APACHE2</makevar></entry>
<entry>If set, use
- <filename role="package">www/apache2</filename>
+ <filename role="package">www/apache20</filename>
instead of the default of
- <filename role="package">www/apache</filename>.</entry>
+ <filename role="package">www/apache13</filename>.</entry>
</row>
<row>
@@ -3612,7 +3788,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
set to values such as 323, 40, 41, or 50.</entry>
</row>
- <row>
+ <row id="knobs-without-nls">
<entry><makevar>WITHOUT_NLS</makevar></entry>
<entry>If set, says that internationalization is not
@@ -3630,7 +3806,7 @@ ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
<entry><makevar>WITH_OPENSSL_PORT</makevar></entry>
<entry>Use the version of OpenSSL from
- <filename role="package">security/openssh</filename>,
+ <filename role="package">security/openssl</filename>,
overwriting the version that was originally installed
in the base system.</entry>
</row>
@@ -3698,6 +3874,11 @@ ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
<filename>options</filename> file is saved and the selected
variables will be used when building the port.</para>
+ <para>If a new version of the port adds new
+ <makevar>OPTIONS</makevar>, the dialog will be presented to the
+ user, with the saved values of old <makevar>OPTIONS</makevar>
+ prefilled.</para>
+
<para>Use <command>make showconfig</command> to see the saved
configuration. Use <command>make rmconfig</command> to remove the
saved configuration.</para>
@@ -3718,12 +3899,8 @@ ${PREFIX}/man/ja/man4/baz.4.gz</programlisting>
the inclusion of <filename>bsd.port.pre.mk</filename>.
The <makevar>WITH_*</makevar> and <makevar>WITHOUT_*</makevar>
variables can only be tested after the inclusion of
- <filename>bsd.port.pre.mk</filename>. Due to a deficiency
- in the infrastructure, you can only test
- <makevar>WITH_*</makevar> variables for options, which are
- <literal>OFF</literal> by default, and
- <makevar>WITHOUT_*</makevar> variables for options, which
- defaults to <literal>ON</literal>.</para>
+ <filename>bsd.port.pre.mk</filename>.</para>
+ </sect3>
<sect3>
<title>Example</title>
@@ -3746,7 +3923,49 @@ RUN_DEPENDS+= bar:${PORTSDIR}/bar/bar
.include &lt;bsd.port.post.mk&gt;</programlisting></para>
</example>
+ </sect3>
+
+ </sect2>
+
+ <sect2>
+ <title>Feature auto-activation</title>
+
+ <para>When using a GNU configure script, keep an eye on which optional
+ features are activated by auto-detection. Explicitly disable
+ optional features you do not wish to be used by passing respective
+ <literal>--without-xxx</literal> or <literal>--disable-xxx</literal>
+ in <makevar>CONFIGURE_ARGS</makevar>.</para>
+
+ <example>
+ <title>Wrong handling of an option</title>
+ <programlisting>.if defined(WITH_FOO)
+LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo
+CONFIGURE_ARGS+= --enable-foo
+.endif</programlisting>
+ </example>
+ <para>In the example above, imagine a library libfoo is installed on
+ the system. User does not want this application to use libfoo, so he
+ toggled the option off in the <literal>make config</literal> dialog.
+ But the application's configure script detects the library present in
+ the system and includes its support in the resulting executable. Now
+ when user decides to remove libfoo from the system, the ports system
+ does not protest (no dependency on libfoo was recorded) but the
+ application breaks.</para>
+
+ <example>
+ <title>Correct handling of an option</title>
+ <programlisting>.if defined(WITH_FOO)
+LIB_DEPENDS+= foo.0:${PORTSDIR}/devel/foo
+CONFIGURE_ARGS+= --enable-foo
+.else
+CONFIGURE_ARGS+= --disable-foo
+.endif</programlisting>
+ </example>
+
+ <para>In the second example, the library libfoo is explicitly disabled.
+ The configure script does not enable related features in the
+ application, despite library's presence in the system.</para>
</sect2>
</sect1>
@@ -3816,6 +4035,271 @@ PORTVERSION= 1.0</programlisting>
<makevar>IGNORE</makevar>, which is more fully documented
in <xref linkend="dads-noinstall">.</para>
</note>
+
+ <para>When removing one of several conflicting ports, it is advisable to
+ retain the <makevar>CONFLICTS</makevar> entries in those other ports
+ for a few months to cater for users who only update once in a
+ while.</para>
+ </sect1>
+
+ <sect1 id="install">
+ <title>Installing files</title>
+
+ <sect2 id="install-macros">
+ <title>INSTALL_* macros</title>
+
+ <para>Do use the macros provided in <filename>bsd.port.mk</filename>
+ to ensure correct modes and ownership of files in your own
+ <maketarget>*-install</maketarget> targets.</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><makevar>INSTALL_PROGRAM</makevar> is a command to install
+ binary executables.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>INSTALL_SCRIPT</makevar> is a command to install
+ executable scripts.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>INSTALL_DATA</makevar> is a command to install
+ sharable data.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>INSTALL_MAN</makevar> is a command to install
+ manpages and other documentation (it does not compress
+ anything).</para>
+ </listitem>
+ </itemizedlist>
+
+ <para>These are basically the <command>install</command> command with
+ all the appropriate flags.</para>
+ </sect2>
+
+ <sect2 id="install-strip">
+ <title>Stripping Binaries</title>
+
+ <para>Do not strip binaries manually unless you have to. All binaries
+ should be stripped, but the <maketarget>INSTALL_PROGRAM</maketarget>
+ macro will install and strip a binary at the same time (see the next
+ section).</para>
+
+ <para>If you need to strip a file, but do not wish to use the
+ <makevar>INSTALL_PROGRAM</makevar> macro,
+ <makevar>${STRIP_CMD}</makevar> will strip your program. This is
+ typically done within the <literal>post-install</literal>
+ target. For example:</para>
+
+ <programlisting>post-install:
+ ${STRIP_CMD} ${PREFIX}/bin/xdl</programlisting>
+
+ <para>Use the &man.file.1; command on the installed executable to
+ check whether the binary is stripped or not. If it does not say
+ <literal>not stripped</literal>, it is stripped. Additionally,
+ &man.strip.1; will not strip a previously stripped program; it
+ will instead exit cleanly.</para>
+ </sect2>
+
+ <sect2 id="install-copytree">
+ <title>Installing a whole tree of files</title>
+
+ <para>Sometimes, there is a need to install a big number of files,
+ preserving their hierarchical organization, ie. copying over a whole
+ directory tree from <makevar>WRKSRC</makevar> to a target directory
+ under <makevar>PREFIX</makevar>.</para>
+
+ <para>Two macros exists for this situation. The advantage of using
+ these macros instead of <command>cp</command> is that they guarantee
+ proper file ownership and permissions on target files. First macro,
+ <makevar>COPYTREE_BIN</makevar>, will set all the installed files to
+ be executable, thus being suitable for installing into
+ <filename><makevar>PREFIX</makevar>/bin</filename>. The second
+ macro, <makevar>COPYTREE_SHARE</makevar>, does not set executable
+ permissions on files, and is therefore suitable for installing files
+ under <filename><makevar>PREFIX</makevar>/share</filename>
+ target.</para>
+
+ <programlisting>post-install:
+ ${MKDIR} ${EXAMPLESDIR}
+ (cd ${WRKSRC}/examples/ && ${COPYTREE_SHARE} \* ${EXAMPLESDIR})</programlisting>
+
+ <para>This example will install the contents of
+ <filename>examples</filename> directory in the vendor distfile to the
+ proper examples location of your port.</para>
+
+ <programlisting>post-install:
+ ${MKDIR} ${DATADIR}/summer
+ (cd ${WRKSRC}/temperatures/ && ${COPYTREE_SHARE} "June July August" ${DATADIR}/summer/)</programlisting>
+
+ <para>And this example will install the data of summer months to the
+ <filename>summer</filename> subdirectory of a
+ <filename><makevar>DATADIR</makevar></filename>.</para>
+
+ <para>Additional <command>find</command> arguments can be passed via
+ the third argument to the <makevar>COPYTREE_*</makevar> macros.
+ For example, to install all files from the first example except
+ Makefiles, one can use the following command.</para>
+
+ <programlisting>post-install:
+ ${MKDIR} ${EXAMPLESDIR}
+ (cd ${WRKSRC}/examples/ && \
+ ${COPYTREE_SHARE} \* ${EXAMPLESDIR} "! -name Makefile")</programlisting>
+
+ <para>Note that these macros does not add the installed files to
+ <filename>pkg-plist</filename>. You still need to list them.</para>
+ </sect2>
+
+ <sect2 id="install-documentation">
+ <title>Install additional documentation</title>
+
+ <para>If your software has some documentation other than the standard
+ man and info pages that you think is useful for the user, install it
+ under <filename><makevar>PREFIX</makevar>/share/doc</filename>.
+ This can be done, like the previous item, in the
+ <maketarget>post-install</maketarget> target.</para>
+
+ <para>Create a new directory for your port. The directory name should
+ reflect what the port is. This usually means
+ <makevar>PORTNAME</makevar>. However, if you
+ think the user might want different versions of the port to be
+ installed at the same time, you can use the whole
+ <makevar>PKGNAME</makevar>.</para>
+
+ <para>Make the installation dependent on the variable
+ <makevar>NOPORTDOCS</makevar> so that users can disable it in
+ <filename>/etc/make.conf</filename>, like this:</para>
+
+ <programlisting>post-install:
+.if !defined(NOPORTDOCS)
+ ${MKDIR} ${DOCSDIR}
+ ${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${DOCSDIR}
+.endif</programlisting>
+
+ <para>Here are some handy variables and how they are expanded
+ by default when used
+ in the <filename>Makefile</filename>:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><makevar>DATADIR</makevar> gets expanded to
+ <filename><makevar>PREFIX</makevar>/share/<makevar>PORTNAME</makevar></filename>.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>DATADIR_REL</makevar> gets expanded to
+ <filename>share/<makevar>PORTNAME</makevar></filename>.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>DOCSDIR</makevar> gets expanded to
+ <filename><makevar>PREFIX</makevar>/share/doc/<makevar>PORTNAME</makevar></filename>.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>DOCSDIR_REL</makevar> gets expanded to
+ <filename>share/doc/<makevar>PORTNAME</makevar></filename>.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>EXAMPLESDIR</makevar> gets expanded to
+ <filename><makevar>PREFIX</makevar>/share/examples/<makevar>PORTNAME</makevar></filename>.</para>
+ </listitem>
+
+ <listitem>
+ <para><makevar>EXAMPLESDIR_REL</makevar> gets expanded to
+ <filename>share/examples/<makevar>PORTNAME</makevar></filename>.</para>
+ </listitem>
+ </itemizedlist>
+
+ <note>
+ <para><makevar>NOPORTDOCS</makevar> only controls additional
+ documentation installed in <makevar>DOCSDIR</makevar>. It does not
+ apply to standard man pages and info pages. Things installed in
+ <makevar>DATADIR</makevar> and <makevar>EXAMPLESDIR</makevar>
+ are controlled by <makevar>NOPORTDATA</makevar> and
+ <makevar>NOPORTEXAMPLES</makevar>, respectively.</para>
+ </note>
+
+ <para>These variables are exported to <makevar>PLIST_SUB</makevar>.
+ Their values will appear there as pathnames relative to
+ <filename><makevar>PREFIX</makevar></filename> if possible.
+ That is, <filename>share/doc/<makevar>PORTNAME</makevar></filename>
+ will be substituted for <literal>%%DOCSDIR%%</literal>
+ in the packing list by default, and so on.
+ (See more on <filename>pkg-plist</filename> substitution
+ <link linkend="plist-sub">here</link>.)</para>
+
+ <para>All conditionally installed documentation files and directories should
+ be included in <filename>pkg-plist</filename> with the
+ <literal>%%PORTDOCS%%</literal> prefix, for example:</para>
+
+ <programlisting>%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
+%%PORTDOCS%%%%DOCSDIR%%/CONTACT
+%%PORTDOCS%%@dirrm %%DOCSDIR%%</programlisting>
+
+ <para>As an alternative to enumerating the documentation files
+ in <filename>pkg-plist</filename>, a port can set the variable
+ <makevar>PORTDOCS</makevar> to a list of file names and shell
+ glob patterns to add to the final packing list.
+ The names will be relative to <makevar>DOCSDIR</makevar>.
+ Therefore, a port that utilizes <makevar>PORTDOCS</makevar> and
+ uses a non-default location for its documentation should set
+ <makevar>DOCSDIR</makevar> accordingly.
+ If a directory is listed in <makevar>PORTDOCS</makevar>
+ or matched by a glob pattern from this variable,
+ the entire subtree of contained files and directories will be
+ registered in the final packing list. If <makevar>NOPORTDOCS</makevar>
+ is defined then files and directories listed in
+ <makevar>PORTDOCS</makevar> would not be installed and neither
+ would be added to port packing list.
+ Installing the documentation at <makevar>PORTDOCS</makevar>
+ as shown above remains up to the port itself.
+ A typical example of utilizing <makevar>PORTDOCS</makevar>
+ looks as follows:</para>
+
+ <programlisting>PORTDOCS= README.* ChangeLog docs/*</programlisting>
+
+ <note>
+ <para>The equivalents of <makevar>PORTDOCS</makevar> for files
+ installed under <makevar>DATADIR</makevar> and
+ <makevar>EXAMPLESDIR</makevar> are <makevar>PORTDATA</makevar>
+ and <makevar>PORTEXAMPLES</makevar>, respectively.</para>
+
+ <para>You can also use the <filename>pkg-message</filename> file to
+ display messages upon installation. See <link
+ linkend="porting-message">the section on using
+ <filename>pkg-message</filename></link> for details.
+ The <filename>pkg-message</filename> file does not need to be
+ added to <filename>pkg-plist</filename>.</para>
+ </note>
+ </sect2>
+
+ <sect2 id="install-subdirs">
+ <title>Subdirectories under PREFIX</title>
+
+ <para>Try to let the port put things in the right subdirectories of
+ <makevar>PREFIX</makevar>. Some ports lump everything and put it in
+ the subdirectory with the port's name, which is incorrect. Also,
+ many ports put everything except binaries, header files and manual
+ pages in a subdirectory of <filename>lib</filename>, which does
+ not work well with the BSD paradigm. Many of the files should be
+ moved to one of the following: <filename>etc</filename>
+ (setup/configuration files), <filename>libexec</filename>
+ (executables started internally), <filename>sbin</filename>
+ (executables for superusers/managers), <filename>info</filename>
+ (documentation for info browser) or <filename>share</filename>
+ (architecture independent files). See &man.hier.7; for details;
+ the rules governing
+ <filename>/usr</filename> pretty much apply to
+ <filename>/usr/local</filename> too. The exception are ports
+ dealing with USENET <quote>news</quote>. They may use
+ <filename><makevar>PREFIX</makevar>/news</filename> as a destination
+ for their files.</para>
+ </sect2>
+
</sect1>
</chapter>
@@ -3830,7 +4314,7 @@ PORTVERSION= 1.0</programlisting>
<title>Shared Libraries</title>
<para>If your port installs one or more shared libraries, define a
- <makevar>INSTALLS_SHLIB</makevar> make variable, which will instruct
+ <makevar>USE_LDCONFIG</makevar> make variable, which will instruct
a <filename>bsd.port.mk</filename> to run
<literal>&dollar;{LDCONFIG} -m</literal> on the directory where the
new library is installed (usually
@@ -3845,9 +4329,11 @@ PORTVERSION= 1.0</programlisting>
de-installation will not cause the system to still believe the
library is there.</para>
- <para>If you need, you can override the default location where the new
- library is installed by defining the <makevar>LDCONFIG_DIRS</makevar>
- make variable, which should contain a list of directories into which
+ <programlisting>USE_LDCONFIG= yes</programlisting>
+
+ <para>If you need, you can override the default directory
+ by setting the <makevar>USE_LDCONFIG</makevar>
+ value to a list of directories into which
shared libraries are to be installed. For example if your port
installs shared libraries into
<filename><makevar>PREFIX</makevar>/lib/foo</filename> and
@@ -3855,13 +4341,9 @@ PORTVERSION= 1.0</programlisting>
you could use the following in your
<filename>Makefile</filename>:</para>
- <programlisting>INSTALLS_SHLIB= yes
-LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
+ <programlisting>USE_LDCONFIG= ${PREFIX}/lib/foo ${PREFIX}/lib/bar</programlisting>
- <para>Remember that non-standard directories will not be passed to
- &man.ldconfig.8; on (re-)boot! If any port really
- needs this to work, install a startup-script as
- <filename role="package">x11/kdelibs3</filename> does. Please
+ <para>Please
double-check, often this is not necessary at all or can be avoided
through <literal>-rpath</literal> or setting <envar>LD_RUN_PATH</envar>
during linking (see <filename role="package">lang/moscow_ml</filename>
@@ -3869,13 +4351,8 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
<makevar>LD_LIBRARY_PATH</makevar> before invoking the binary, like
<filename role="package">www/mozilla</filename> does.</para>
- <para>Note that content of <makevar>LDCONFIG_DIRS</makevar> is passed
- through &man.sed.1; just like the rest of <filename>pkg-plist</filename>,
- so <makevar>PLIST_SUB</makevar> substitutions also apply here. It is
- recommended that you use <literal>%%PREFIX%%</literal> for
- <makevar>PREFIX</makevar>, <literal>%%LOCALBASE%%</literal> for
- <makevar>LOCALBASE</makevar> and <literal>%%X11BASE%%</literal> for
- <makevar>X11BASE</makevar>.</para>
+ <para>When installing 32-bit libraries on 64-bit system, use
+ <makevar>USE_LDCONFIG32</makevar> instead.</para>
<para>Try to keep shared library version numbers in the
<filename>libfoo.so.0</filename> format. Our runtime linker only
@@ -3888,117 +4365,117 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
</sect1>
- <sect1 id="porting-restrictions">
- <title>Ports with distribution restrictions</title>
-
- <para>Licenses vary, and some of them place restrictions on how the
- application can be packaged, whether it can be sold for profit, and so
- on.</para>
-
- <important>
- <para>It is your responsibility as a porter to read the licensing
- terms of the software and make sure that the FreeBSD project will
- not be held accountable for violating them by redistributing the
- source or compiled binaries either via FTP/HTTP or CD-ROM. If in doubt,
- please contact the &a.ports;.</para>
- </important>
-
- <para>In situations like this, the variables described in the following
- sections can be set.</para>
-
- <sect2>
- <title><makevar>NO_PACKAGE</makevar></title>
-
- <para>This variable indicates that we may not generate a binary
- package of the application. For instance, the license may
- disallow binary redistribution, or it may prohibit distribution
- of packages created from patched sources.</para>
-
- <para>However, the port's <makevar>DISTFILES</makevar> may be
- freely mirrored on FTP/HTTP. They may also be distributed on
- a CD-ROM (or similar media) unless <makevar>NO_CDROM</makevar>
- is set as well.</para>
-
- <para><makevar>NO_PACKAGE</makevar> should also be used if the binary
- package is not generally useful, and the application should always
- be compiled from the source code. For example, if the application
- has configuration information that is site specific hard coded in to
- it at compile time, set <makevar>NO_PACKAGE</makevar>.</para>
-
- <para><makevar>NO_PACKAGE</makevar> should be set to a string
- describing the reason why the package should not be
- generated.</para>
- </sect2>
-
- <sect2>
- <title><makevar>NO_CDROM</makevar></title>
-
- <para>This variable alone indicates that, although we are allowed
- to generate binary packages, we may put neither those packages
- nor the port's <makevar>DISTFILES</makevar> onto a CD-ROM (or
- similar media) for resale. However, the binary packages and
- the port's <makevar>DISTFILES</makevar> will still be available
- via FTP/HTTP.</para>
-
- <para> If this variable is set along with
- <makevar>NO_PACKAGE</makevar>, then only the port's
- <makevar>DISTFILES</makevar> will be available, and only via
- FTP/HTTP.</para>
-
- <para><makevar>NO_CDROM</makevar> should be set to a string
- describing the reason why the port cannot be redistributed
- on CD-ROM. For instance, this should be used if the port's license
- is for <quote>non-commercial</quote> use only.</para>
- </sect2>
-
- <sect2>
- <title><makevar>NOFETCHFILES</makevar></title>
-
- <para>Files defined in the <makevar>NOFETCHFILES</makevar>
- variable are not fetchable from any of the
- <makevar>MASTER_SITES</makevar>. An example of such a
- file is when the file is supplied on CD-ROM by the
- vendor.</para>
+ <sect1 id="porting-restrictions">
+ <title>Ports with distribution restrictions</title>
- <para>Tools which check for the availability of these files
- on the <makevar>MASTER_SITES</makevar> should ignore these
- files and not report about them.</para>
- </sect2>
+ <para>Licenses vary, and some of them place restrictions on how the
+ application can be packaged, whether it can be sold for profit, and so
+ on.</para>
- <sect2>
- <title><makevar>RESTRICTED</makevar></title>
-
- <para>Set this variable alone if the application's license permits
- neither mirroring the application's <makevar>DISTFILES</makevar>
- nor distributing the binary package in any way.</para>
-
- <para><makevar>NO_CDROM</makevar> or <makevar>NO_PACKAGE</makevar>
- should not be set along with <makevar>RESTRICTED</makevar>
- since the latter variable implies the former ones.</para>
-
- <para><makevar>RESTRICTED</makevar> should be set to a string
- describing the reason why the port cannot be redistributed.
- Typically, this indicates that the port contains proprietary
- software and that the user will need to manually download the
- <makevar>DISTFILES</makevar>, possibly after registering for the
- software or agreeing to accept the terms of an
- <acronym>EULA</acronym>.</para>
- </sect2>
+ <important>
+ <para>It is your responsibility as a porter to read the licensing
+ terms of the software and make sure that the FreeBSD project will
+ not be held accountable for violating them by redistributing the
+ source or compiled binaries either via FTP/HTTP or CD-ROM. If in doubt,
+ please contact the &a.ports;.</para>
+ </important>
- <sect2>
- <title><makevar>RESTRICTED_FILES</makevar></title>
+ <para>In situations like this, the variables described in the following
+ sections can be set.</para>
- <para>When <makevar>RESTRICTED</makevar> or <makevar>NO_CDROM</makevar>
- is set, this variable defaults to <literal>${DISTFILES}
- ${PATCHFILES}</literal>, otherwise it is empty. If only some of the
- distribution files are restricted, then set this variable to list
- them.</para>
+ <sect2>
+ <title><makevar>NO_PACKAGE</makevar></title>
+
+ <para>This variable indicates that we may not generate a binary
+ package of the application. For instance, the license may
+ disallow binary redistribution, or it may prohibit distribution
+ of packages created from patched sources.</para>
+
+ <para>However, the port's <makevar>DISTFILES</makevar> may be
+ freely mirrored on FTP/HTTP. They may also be distributed on
+ a CD-ROM (or similar media) unless <makevar>NO_CDROM</makevar>
+ is set as well.</para>
+
+ <para><makevar>NO_PACKAGE</makevar> should also be used if the binary
+ package is not generally useful, and the application should always
+ be compiled from the source code. For example, if the application
+ has configuration information that is site specific hard coded in to
+ it at compile time, set <makevar>NO_PACKAGE</makevar>.</para>
+
+ <para><makevar>NO_PACKAGE</makevar> should be set to a string
+ describing the reason why the package should not be
+ generated.</para>
+ </sect2>
- <para>Note that the port committer should add an entry to
- <filename>/usr/ports/LEGAL</filename> for every listed distribution
- file, describing exactly what the restriction entails.</para>
- </sect2>
- </sect1>
+ <sect2>
+ <title><makevar>NO_CDROM</makevar></title>
+
+ <para>This variable alone indicates that, although we are allowed
+ to generate binary packages, we may put neither those packages
+ nor the port's <makevar>DISTFILES</makevar> onto a CD-ROM (or
+ similar media) for resale. However, the binary packages and
+ the port's <makevar>DISTFILES</makevar> will still be available
+ via FTP/HTTP.</para>
+
+ <para>If this variable is set along with
+ <makevar>NO_PACKAGE</makevar>, then only the port's
+ <makevar>DISTFILES</makevar> will be available, and only via
+ FTP/HTTP.</para>
+
+ <para><makevar>NO_CDROM</makevar> should be set to a string
+ describing the reason why the port cannot be redistributed
+ on CD-ROM. For instance, this should be used if the port's license
+ is for <quote>non-commercial</quote> use only.</para>
+ </sect2>
+
+ <sect2>
+ <title><makevar>NOFETCHFILES</makevar></title>
+
+ <para>Files defined in the <makevar>NOFETCHFILES</makevar>
+ variable are not fetchable from any of the
+ <makevar>MASTER_SITES</makevar>. An example of such a
+ file is when the file is supplied on CD-ROM by the
+ vendor.</para>
+
+ <para>Tools which check for the availability of these files
+ on the <makevar>MASTER_SITES</makevar> should ignore these
+ files and not report about them.</para>
+ </sect2>
+
+ <sect2>
+ <title><makevar>RESTRICTED</makevar></title>
+
+ <para>Set this variable alone if the application's license permits
+ neither mirroring the application's <makevar>DISTFILES</makevar>
+ nor distributing the binary package in any way.</para>
+
+ <para><makevar>NO_CDROM</makevar> or <makevar>NO_PACKAGE</makevar>
+ should not be set along with <makevar>RESTRICTED</makevar>
+ since the latter variable implies the former ones.</para>
+
+ <para><makevar>RESTRICTED</makevar> should be set to a string
+ describing the reason why the port cannot be redistributed.
+ Typically, this indicates that the port contains proprietary
+ software and that the user will need to manually download the
+ <makevar>DISTFILES</makevar>, possibly after registering for the
+ software or agreeing to accept the terms of an
+ <acronym>EULA</acronym>.</para>
+ </sect2>
+
+ <sect2>
+ <title><makevar>RESTRICTED_FILES</makevar></title>
+
+ <para>When <makevar>RESTRICTED</makevar> or <makevar>NO_CDROM</makevar>
+ is set, this variable defaults to <literal>${DISTFILES}
+ ${PATCHFILES}</literal>, otherwise it is empty. If only some of the
+ distribution files are restricted, then set this variable to list
+ them.</para>
+
+ <para>Note that the port committer should add an entry to
+ <filename>/usr/ports/LEGAL</filename> for every listed distribution
+ file, describing exactly what the restriction entails.</para>
+ </sect2>
+ </sect1>
<sect1 id="building">
<title>Building mechanisms</title>
@@ -4069,6 +4546,8 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
<literal>GNU_CONFIGURE=yes</literal>. If you want to give extra
arguments to the <command>configure</command> script (the default
argument is <literal>--prefix=&dollar;{PREFIX}
+ --infodir=&dollar;{PREFIX}/&dollar;{INFO_PATH}
+ --mandir=&dollar;{MANPREFIX}/man
&dollar;{CONFIGURE_TARGET}</literal>), set those
extra arguments in <makevar>CONFIGURE_ARGS</makevar>. Extra
environment variables can be passed using
@@ -4223,14 +4702,11 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
them all on a single line, or using the <literal>+=</literal>
Makefile construct.</para>
- <para>Before proceeding any further, it cannot be stressed highly
- enough that the constructs discussed here are for use ONLY in
- building other ports. For cross-development work, the
- <literal>devel/gnu-{automake,autoconf,libtool}</literal> ports
- should be used, such as within an IDE. <filename
- role="package">devel/anjuta</filename> and <filename
- role="package">devel/kdevelop</filename> (GNOME and KDE
- respectively) are good examples of how to achieve this.</para>
+ <para>Finally, there is the special tool, called
+ <literal>autotools</literal>, which is a convenience function
+ to bring in all available versions of the autotools to allow
+ for cross-development work. This can also be accomplished
+ by installing the <literal>devel/autotools</literal> port.</para>
</sect2>
@@ -4240,62 +4716,25 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
<para>Shared libraries using the GNU building framework usually use
<command>libtool</command> to adjust the compilation and
installation of shared libraries to match the specifics of the
- underlying operating system. The Ports Collection provides a
- number of versions of <command>libtool</command> modified for use by
- &os;.</para>
+ underlying operating system. The usual practice is to use copy of
+ <command>libtool</command> bundled with the application. In case
+ you need to use external <command>libtool</command>, you can use
+ the version provided by The Ports Collection:</para>
- <programlisting>USE_AUTOTOOLS= libtool:<replaceable>version</replaceable>[:inc|:env]</programlisting>
+ <programlisting>USE_AUTOTOOLS= libtool:<replaceable>version</replaceable>[:env]</programlisting>
<para>With no additional operations,
<literal>libtool:<replaceable>version</replaceable></literal> tells
- the building framework that the port uses
- <command>libtool</command>, implying
- <makevar>GNU_CONFIGURE</makevar>. The configure script will be
- patched with the system-installed copy of
- <command>libtool</command>. Further, a number of make and shell
+ the building framework to patch the configure script with the
+ system-installed copy of <command>libtool</command>.
+ The <makevar>GNU_CONFIGURE</makevar> is implied.
+ Further, a number of make and shell
variables will be assigned for onward use by the port. See
<filename>bsd.autotools.mk</filename> for details.</para>
- <para>With the <literal>:inc</literal> operation, the environment
- will be set up, and a slightly different set of patching will be
- performed.</para>
-
<para>With the <literal>:env</literal> operation, only the
environment will be set up.</para>
- <informaltable frame="none">
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Previously</entry>
-
- <entry><makevar>USE_AUTOTOOLS</makevar> construct</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>USE_LIBTOOL_VER=13</literal></entry>
-
- <entry><literal>libtool:13</literal></entry>
- </row>
-
- <row>
- <entry><literal>USE_INC_LIBTOOL_VER=15</literal></entry>
-
- <entry><literal>libtool:15:inc</literal></entry>
- </row>
-
- <row>
- <entry><literal>WANT_LIBTOOL_VER=15</literal></entry>
-
- <entry><literal>libtool:15:env</literal></entry>
- </row>
-
- </tbody>
- </tgroup>
- </informaltable>
-
<para>Finally, <makevar>LIBTOOLFLAGS</makevar> and
<makevar>LIBTOOLFILES</makevar> can be optionally set to override
the most likely arguments to, and files patched by,
@@ -4323,27 +4762,6 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
outside of the <makevar>USE_AUTOTOOLS</makevar> framework. There
are no optional operations for this tool.</para>
- <informaltable frame="none">
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Previously</entry>
-
- <entry><makevar>USE_AUTOTOOLS</makevar> construct</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>USE_LIBLTDL=YES</literal></entry>
-
- <entry><literal>libltdl:15</literal></entry>
- </row>
-
- </tbody>
- </tgroup>
- </informaltable>
-
</sect2>
<sect2 id="using-autoconf">
@@ -4371,40 +4789,6 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
environment for further use. Without it, patching and
reconfiguration of the port is carried out.</para>
- <informaltable frame="none">
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Previously</entry>
-
- <entry><makevar>USE_AUTOTOOLS</makevar> construct</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>USE_AUTOCONF_VER=213</literal></entry>
-
- <entry><literal>autoconf:213</literal></entry>
- </row>
-
- <row>
- <entry><literal>WANT_AUTOCONF_VER=259</literal></entry>
-
- <entry><literal>autoconf:259:env</literal></entry>
- </row>
-
- <row>
- <entry><literal>USE_AUTOHEADER_VER=253</literal></entry>
-
- <entry><literal>autoheader:253</literal> (implies
- <literal>autoconf:253</literal>)</entry>
- </row>
-
- </tbody>
- </tgroup>
- </informaltable>
-
<para>The additional optional variables
<makevar>AUTOCONF_ARGS</makevar> and
<makevar>AUTOHEADER_ARGS</makevar> can be overridden by the port
@@ -4452,40 +4836,6 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
for further use. Without it, reconfiguration of the port is
carried out.</para>
- <informaltable frame="none">
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Previously</entry>
-
- <entry><makevar>USE_AUTOTOOLS</makevar> construct</entry>
- </row>
- </thead>
-
- <tbody>
- <row>
- <entry><literal>USE_AUTOMAKE_VER=14</literal></entry>
-
- <entry><literal>automake:14</literal></entry>
- </row>
-
- <row>
- <entry><literal>WANT_AUTOMAKE_VER=15</literal></entry>
-
- <entry><literal>automake:15:env</literal></entry>
- </row>
-
- <row>
- <entry><literal>USE_ACLOCAL_VER=19</literal></entry>
-
- <entry><literal>aclocal:19</literal> (implies
- <literal>automake:19</literal>)</entry>
- </row>
-
- </tbody>
- </tgroup>
- </informaltable>
-
<para>As with
<command>autoconf</command> and <command>autoheader</command>, both
<command>automake</command> and <command>aclocal</command> have
@@ -4495,11 +4845,133 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
required.</para>
</sect2>
+ </sect1>
+
+ <sect1 id="using-gettext">
+ <title>Using GNU <literal>gettext</literal></title>
+
+ <sect2>
+ <title>Basic usage</title>
+
+ <para>If your port requires <literal>gettext</literal>,
+ just set <makevar>USE_GETTEXT</makevar> to <literal>yes</literal>,
+ and your port will grow the dependency on <filename
+ role="package">devel/gettext</filename>. The value of
+ <makevar>USE_GETTEXT</makevar> can also specify the required
+ version of the <literal>libintl</literal> library, the basic
+ part of <literal>gettext</literal>, but using this
+ feature is <emphasis>strongly discouraged</emphasis>:
+ Your port should work with just the current version of
+ <filename role="package">devel/gettext</filename>.</para>
+
+ <para>A rather common case is a port using
+ <literal>gettext</literal> and <command>configure</command>.
+ Generally, GNU <command>configure</command> should be
+ able to locate <literal>gettext</literal> automatically.
+ If it ever fails to, hints at the location of
+ <literal>gettext</literal> can be passed in
+ <envar>CPPFLAGS</envar> and <envar>LDFLAGS</envar> as
+ follows:</para>
+
+ <programlisting>USE_GETTEXT= yes
+CPPFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" \
+ LDFLAGS="${LDFLAGS}"</programlisting>
+
+ <para>Of course, the code can be more compact if there are no
+ more flags to pass to <command>configure</command>:</para>
+
+ <programlisting>USE_GETTEXT= yes
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
+ LDFLAGS="-L${LOCALBASE}/lib"</programlisting>
+
+ </sect2>
+
+ <sect2>
+ <title>Optional usage</title>
+
+ <para>Some software products allow for disabling NLS,
+ e.g., through passing <option>--disable-nls</option> to
+ <command>configure</command>. In that case, your port
+ should use <literal>gettext</literal> conditionally,
+ depending on the status of <link
+ linkend="knobs-without-nls"><makevar>WITHOUT_NLS</makevar></link>.
+ For ports of low to medium complexity, you can rely on the
+ following idiom:</para>
+
+ <programlisting>GNU_CONFIGURE= yes
+
+.if !defined(WITHOUT_NLS)
+USE_GETTEXT= yes
+PLIST_SUB+= NLS=""
+.else
+CONFIGURE_ARGS+= --disable-nls
+PLIST_SUB+= NLS="@comment "
+.endif</programlisting>
+
+ <para>The next item on your to-do list is to arrange so that
+ the message catalog files are included in the packing list
+ conditionally. The <filename>Makefile</filename> part of
+ this task is already provided by the idiom. It is explained
+ in the section on <link linkend="plist-sub">advanced
+ <filename>pkg-plist</filename> practices</link>. In a
+ nutshell, each occurrence of <literal>%%NLS%%</literal> in
+ <filename>pkg-plist</filename> will be replaced by
+ <quote><literal>@comment&nbsp;</literal></quote> if NLS is
+ disabled, or by a null string if NLS is enabled. Consequently,
+ the lines prefixed by <literal>%%NLS%%</literal> will become
+ mere comments in the final packing list if NLS is off;
+ otherwise the prefix will be just left out. All you need
+ to do now is insert <literal>%%NLS%%</literal> before each
+ path to a message catalog file in <filename>pkg-plist</filename>.
+ For example:</para>
+
+ <programlisting>%%NLS%%share/locale/fr/LC_MESSAGES/foobar.mo
+%%NLS%%share/locale/no/LC_MESSAGES/foobar.mo</programlisting>
+
+ <para>In high complexity cases, you may need to use more advanced
+ techniques than the recipe given here, such as <link
+ linkend="plist-dynamic">dynamic packing list generation</link>.</para>
+ </sect2>
+
+ <sect2>
+ <title>Handling message catalog directories</title>
+
+ <para>There is a point to note about installing message catalog
+ files. The target directories for them, which reside under
+ <filename><makevar>LOCALBASE</makevar>/share/locale</filename>,
+ should rarely be created and removed by your port. The
+ most popular languages have their respective directories
+ listed in <filename>/etc/mtree/BSD.local.dist</filename>;
+ that is, they are a part of the base system. The directories
+ for many other languages are governed by the <filename
+ role="package">devel/gettext</filename> port. You may want
+ to consult its <filename>pkg-plist</filename> and see whether
+ your port is going to install a message catalog file for a
+ unique language.</para>
+ </sect2>
</sect1>
<sect1 id="using-perl">
<title>Using <literal>perl</literal></title>
+ <para>If <makevar>MASTER_SITES</makevar> is set to
+ <makevar>MASTER_SITE_PERL_CPAN</makevar>, then preferred value of
+ <makevar>MASTER_SITE_SUBDIR</makevar> is top-level hierarchy name.
+ For example, the recommend value for <literal>p5-Module-Name</literal>
+ is <literal>Module</literal>. The top-level hierarchy can be examined
+ at <ulink url="http://cpan.org/modules/by-module/">cpan.org</ulink>.
+ This keeps the port working when the author of the module
+ changes.</para>
+
+ <para>The exception to this rule is when the relevant directory does not
+ exist or the distfile does not exist in the directory. In such case, using
+ author's id as <makevar>MASTER_SITE_SUBDIR</makevar> is allowed.</para>
+
<table frame="none">
<title>Variables for ports that use <literal>perl</literal></title>
@@ -4611,10 +5083,11 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
</table>
<note>
- <para>Ports of Perl modules, which do not have an official website,
- should link <hostid>cpan.org</hostid> in the WWW line of a
- <filename>pkg-descr</filename> file. The suggested URL scheme is
- <literal>http://search.cpan.org/dist/Module-Name</literal>.</para>
+ <para>Perl 模組的 port,由於沒有正式的網站,所以
+ <filename>pkg-descr</filename> 內的 WWW 應該指向至
+ <hostid>cpan.org</hostid>。 比較好的 URL 格式是
+ <literal>http://search.cpan.org/dist/Module-Name/</literal>
+ (包括結尾的 / 斜線符號)。</para>
</note>
</sect1>
@@ -4623,7 +5096,45 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
<title>Using X11</title>
<sect2 id="x11-variables">
- <title>Variable definitions</title>
+ <title>X.Org components</title>
+
+ <para>The X11 implementation available in The Ports Collection is X.Org.
+ If your application depends on X components, set
+ <makevar>USE_XORG</makevar> to the list of required components.
+ Available components, at the time of writing, are:</para>
+
+ <para><literal>bigreqsproto compositeproto damageproto dmx dmxproto
+ evieproto fixesproto fontcacheproto fontenc fontsproto fontutil
+ glproto ice inputproto kbproto libfs oldx printproto randrproto
+ recordproto renderproto resourceproto scrnsaverproto sm trapproto
+ videoproto x11 xau xaw xaw6 xaw7 xaw8 xbitmaps xcmiscproto xcomposite
+ xcursor xdamage xdmcp xevie xext xextproto xf86bigfontproto
+ xf86dgaproto xf86driproto xf86miscproto xf86rushproto
+ xf86vidmodeproto xfixes xfont xfontcache xft xi xinerama
+ xineramaproto xkbfile xkbui xmu xmuu xorg-server xp xpm xprintapputil
+ xprintutil xpr oto xproxymngproto xrandr xrender xres xscrnsaver xt
+ xtrans xtrap xtst xv xvmc xxf86dga xxf86misc xxf86vm</literal>.</para>
+
+ <para>Always up-to-date list can be found in
+ <filename>/usr/ports/Mk/bsd.xorg.mk</filename>.</para>
+
+ <para>The Mesa Project is an effort to provide free OpenGL
+ implementation. You can specify a dependency on various components
+ of this project with <makevar>USE_GL</makevar> variable.
+ Valid options are: <literal>glut, glu, glw, gl</literal> and
+ <literal>linux</literal>. For backwards compatibility, the value
+ of <literal>yes</literal> maps to <literal>glu</literal>.</para>
+
+ <example id="use-xorg-example">
+ <title>USE_XORG example</title>
+ <programlisting>USE_XORG= xrender xft xkbfile xt xaw
+USE_GL= glu</programlisting>
+ </example>
+
+ <para>Many ports define <makevar>USE_XLIB</makevar>, which makes
+ the port depend on all the 50 or so libraries. This variable
+ exists for backwards compatibility, as it predates modular X.Org,
+ and should not be used on new ports.</para>
<table frame="none">
<title>Variables for ports that use X</title>
@@ -4631,30 +5142,25 @@ LDCONFIG_DIRS= %%PREFIX%%/lib/foo %%PREFIX%%/lib/bar</programlisting>
<tgroup cols="2">
<tbody>
<row>
- <entry><makevar>USE_X_PREFIX</makevar></entry>
-
- <entry>The port installs in <makevar>X11BASE</makevar>, not
- <makevar>PREFIX</makevar>.</entry>
- </row>
-
- <row>
<entry><makevar>USE_XLIB</makevar></entry>
- <entry>The port uses the X libraries.</entry>
+ <entry>The port uses the X libraries. Deprecated - use a list of
+ X.Org components in <makevar>USE_XORG</makevar> variable
+ instead.</entry>
</row>
<row>
- <entry><makevar>USE_MOTIF</makevar></entry>
+ <entry><makevar>USE_IMAKE</makevar></entry>
- <entry>The port uses the Motif toolkit. Implies
- <makevar>USE_XPM</makevar>.</entry>
+ <entry>會用到 <command>imake</command> 的 port。</entry>
</row>
<row>
- <entry><makevar>USE_IMAKE</makevar></entry>
+ <entry><makevar>USE_X_PREFIX</makevar></entry>
- <entry>The port uses <command>imake</command>. Implies
- <makevar>USE_X_PREFIX</makevar>.</entry>
+ <entry>Deprecated. Today it is equivalent to
+ <makevar>USE_XLIB</makevar> and can be replaced by it
+ freely.</entry>
</row>
<row>
@@ -4847,30 +5353,29 @@ USE_XLIB= yes</programlisting>
X server. The working <envar>DISPLAY</envar> is then passed
to the build.</para>
- <programlisting>.if defined(PACKAGE_BUILDING)
-BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT} \
- ${X11BASE}/lib/X11/fonts/misc/8x13O.pcf.gz:${X_FONTS_MISC_PORT}
-.endif</programlisting>
+ <programlisting>USE_DISPLAY= yes</programlisting>
</sect2>
<sect2 id="desktop-entries">
<title>Desktop entries</title>
- <para>Desktop Entries (<ulink
- url="http://standards.freedesktop.org/desktop-entry-spec/latest/">Freedesktop
- standard</ulink>) 可以經由設定 <makevar>DESKTOP_ENTRIES</makevar>
- 變數而輕易地建立在你的 port 之中。這些項目會在相應的桌面環境如 GNOME 或
- KDE 的應用程式選單中出現。檔案 <filename>.desktop</filename>
- 將會被建立、安裝以及自動地加入 <filename>pkg-plist</filename>
+ <para>可藉由設定
+ <makevar>DESKTOP_ENTRIES</makevar> 變數,以輕鬆設定 port 的 X 選單項目
+ (Desktop Entries,請參閱 <ulink
+ url="http://standards.freedesktop.org/desktop-entry-spec/latest/">
+ Freedesktop standard</ulink>)。 這些項目會在相應的桌面環境如 GNOME
+ 或 KDE 的應用程式選單中出現。 <filename>.desktop</filename> 檔案
+ 將會被建立、安裝以及自動加入 <filename>pkg-plist</filename>
中。語法為:</para>
<programlisting>DESKTOP_ENTRIES= "NAME" "COMMENT" "ICON" "COMMAND" "CATEGORY" StartupNotify</programlisting>
- <para>項目分類可參考 <ulink
+ <para>可供使用的分類可參考 <ulink
url="http://standards.freedesktop.org/menu-spec/latest/apa.html">
- Freedesktop website</ulink>。 變數 <makevar>StartupNotify</makevar>
- 決定應用程式在支援 startup noficication 的環境下是否清除狀態。</para>
+ Freedesktop 網站</ulink>。 而 <makevar>StartupNotify</makevar>
+ 變數會決定程式,是否支援 startup noficication 的環境。
+ </para>
<para>範例:</para>
@@ -4898,58 +5403,383 @@ BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT} \
<sect1 id="using-kde">
<title>Using KDE</title>
- <table frame="none">
- <title>Variables for ports that use KDE</title>
+ <sect2 id="kde-variables">
+ <title>Variable definitions</title>
- <tgroup cols="2">
- <tbody>
- <row>
- <entry><makevar>USE_QT_VER</makevar></entry>
-
- <entry>The port uses the Qt toolkit. Possible values are
- <literal>1</literal> and
- <literal>3</literal>; each specify the major version
- of Qt to use. Sets both <makevar>MOC</makevar> and
- <makevar>QTCPPFLAGS</makevar>to default appropriate
- values.</entry>
- </row>
+ <table frame="none">
+ <title>Variables for ports that use KDE</title>
- <row>
- <entry><makevar>USE_KDELIBS_VER</makevar></entry>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry><makevar>USE_KDELIBS_VER</makevar></entry>
- <entry>The port uses KDE libraries. Possible values are
- <literal>3</literal>; each specify the major version
- of KDE to use. Implies <makevar>USE_QT_VER</makevar>
- of the appropriate version.</entry>
- </row>
+ <entry>The port uses KDE libraries. It specifies the
+ major version of KDE to use and implies
+ <makevar>USE_QT_VER</makevar> of the appropriate
+ version. The only possible value is
+ <literal>3</literal>.</entry>
+ </row>
- <row>
- <entry><makevar>USE_KDEBASE_VER</makevar></entry>
+ <row>
+ <entry><makevar>USE_KDEBASE_VER</makevar></entry>
- <entry>The port uses KDE base. Possible values are
- <literal>3</literal>; each specify the major version
- of KDE to use. Implies <makevar>USE_KDELIBS_VER</makevar>
- of the appropriate version.</entry>
- </row>
+ <entry>The port uses KDE base. It specifies the major
+ version of KDE to use and implies
+ <makevar>USE_QT_VER</makevar> of the appropriate version.
+ The only possible value is <literal>3</literal>.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
- <row>
- <entry><makevar>MOC</makevar></entry>
+ </sect2>
- <entry>Set to the path of <command>moc</command>.
- Default set according to <makevar>USE_QT_VER</makevar>
- value.</entry>
- </row>
+ <sect2 id="kde-qt">
+ <title>Ports that require Qt</title>
- <row>
- <entry><makevar>QTCPPFLAGS</makevar></entry>
+ <table frame="none">
+ <title>Variables for ports that use Qt</title>
- <entry>Set the <makevar>CPPFLAGS</makevar> to use when
- processing Qt code. Default set according to
- <makevar>USE_QT_VER</makevar> value.</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry><makevar>USE_QT_VER</makevar></entry>
+
+ <entry>The port uses the Qt toolkit. Possible values
+ are <literal>3</literal> and <literal>4</literal>;
+ each specify the major version of Qt to use. Appropriate
+ parameters are passed to <command>configure</command>
+ script and <command>make</command>.</entry>
+ </row>
+
+ <row>
+ <entry><makevar>QT_PREFIX</makevar></entry>
+
+ <entry>Set to the path where Qt installed to (read-only
+ variable).</entry>
+ </row>
+
+ <row>
+ <entry><makevar>MOC</makevar></entry>
+
+ <entry>Set to the path of <command>moc</command>
+ (read-only variable). Default set according to
+ <makevar>USE_QT_VER</makevar> value.</entry>
+ </row>
+
+ <row>
+ <entry><makevar>QTCPPFLAGS</makevar></entry>
+
+ <entry>Additional compiler flags passed via
+ <makevar>CONFIGURE_ENV</makevar> for Qt toolkit.
+ Default set according to
+ <makevar>USE_QT_VER</makevar>.</entry>
+ </row>
+
+ <row>
+ <entry><makevar>QTCFGLIBS</makevar></entry>
+
+ <entry>Additional libraries for linking passed via
+ <makevar>CONFIGURE_ENV</makevar> for Qt toolkit.
+ Default set according to
+ <makevar>USE_QT_VER</makevar>.</entry>
+ </row>
+
+ <row>
+ <entry><makevar>QTNONSTANDARD</makevar></entry>
+
+ <entry>Suppress modification of
+ <makevar>CONFIGURE_ENV</makevar>,
+ <makevar>CONFIGURE_ARGS</makevar>, and
+ <makevar>MAKE_ENV</makevar>.</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table frame="none">
+ <title>Additional variables for ports that use Qt 4.x</title>
+
+ <tgroup cols="2">
+ <tbody>
+ <row>
+ <entry><makevar>QT_COMPONENTS</makevar></entry>
+
+ <entry>Specify tool and library dependencies for Qt4.
+ See below for details.</entry>
+ </row>
+
+ <row>
+ <entry><makevar>UIC</makevar></entry>
+
+ <entry>Set to the path of <command>uic</command> (read-only
+ variable). Default set according to
+ <makevar>USE_QT_VER</makevar> value.</entry>
+ </row>
+
+ <row>
+ <entry><makevar>QMAKE</makevar></entry>
+
+ <entry>Set to the path of <command>qmake</command>
+ (read-only variable). Default set according to
+ <makevar>USE_QT_VER</makevar> value.</entry>
+ </row>
+
+ <row>
+ <entry><makevar>QMAKESPEC</makevar></entry>
+
+ <entry>Set to the path of configuration file for
+ <command>qmake</command> (read-only variable). Default
+ set according to <makevar>USE_QT_VER</makevar>
+ value.</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>When <makevar>USE_QT_VER</makevar> is set, some useful
+ settings are passed to <command>configure</command> script:</para>
+
+ <programlisting>CONFIGURE_ARGS+= --with-qt-includes=${QT_PREFIX}/include \
+ --with-qt-libraries=${QT_PREFIX}/lib \
+ --with-extra-libs=${LOCALBASE}/lib \
+ --with-extra-includes=${LOCALBASE}/include
+CONFIGURE_ENV+= MOC="${MOC}" CPPFLAGS="${CPPFLAGS} ${QTCPPFLAGS}" LIBS="${QTCFGLIBS}" \
+ QTDIR="${QT_PREFIX}" KDEDIR="${KDE_PREFIX}"</programlisting>
+
+ <para>If <makevar>USE_QT_VER</makevar> is set to <literal>4</literal>,
+ the following settings are also deployed:</para>
+
+ <programlisting>CONFIGURE_ENV+= UIC="${UIC}" QMAKE="${QMAKE}" QMAKESPEC="${QMAKESPEC}"
+MAKE_ENV+= QMAKESPEC="${QMAKESPEC}"</programlisting>
+
+ </sect2>
+
+ <sect2 id="qt4-components">
+ <title>Component selection (Qt 4.x only)</title>
+
+ <para>When <makevar>USE_QT_VER</makevar> is set to 4, individual
+ Qt4 tool and library dependencies can be specified in the
+ <makevar>QT_COMPONENTS</makevar> variable. Every component
+ can be suffixed by either <literal>_build</literal> or <literal>_run</literal>,
+ the suffix indicating whether the component should be depended on at
+ buildtime or runtime, respectively. If unsuffixed, the component will be
+ depended on at both build- and runtime. Usually, library components
+ should be specified unsuffixed, tool components should be
+ specified with the <literal>_build</literal> suffix and plugin components
+ should be specified with the <literal>_run</literal> suffix. The most commonly
+ used components are listed below (all available components are
+ listed in <makevar>_QT_COMPONENTS_ALL</makevar> in
+ <filename>/usr/ports/Mk/bsd.qt.mk</filename>):</para>
+
+ <table frame="none">
+ <title>Available Qt4 library components</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>corelib</literal></entry>
+ <entry>core library (can be omitted unless the port
+ uses nothing but <literal>corelib</literal>)</entry>
+ </row>
+
+ <row>
+ <entry><literal>gui</literal></entry>
+ <entry>graphical user interface library</entry>
+ </row>
+
+ <row>
+ <entry><literal>network</literal></entry>
+ <entry>network library</entry>
+ </row>
+
+ <row>
+ <entry><literal>opengl</literal></entry>
+ <entry>OpenGL library</entry>
+ </row>
+
+ <row>
+ <entry><literal>qt3support</literal></entry>
+ <entry>Qt3 compatibility library</entry>
+ </row>
+
+ <row>
+ <entry><literal>qtestlib</literal></entry>
+ <entry>unit testing library</entry>
+ </row>
+
+ <row>
+ <entry><literal>script</literal></entry>
+ <entry>script library</entry>
+ </row>
+
+ <row>
+ <entry><literal>sql</literal></entry>
+ <entry>SQL library</entry>
+ </row>
+
+ <row>
+ <entry><literal>xml</literal></entry>
+ <entry>XML library</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>You can determine which libraries the application depends
+ on, by running <command>ldd</command> on the main executable
+ after a successful compilation.</para>
+
+ <table frame="none">
+ <title>Available Qt4 tool components</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>moc</literal></entry>
+ <entry>meta object compiler (needed for almost
+ every Qt application at buildtime)</entry>
+ </row>
+
+ <row>
+ <entry><literal>qmake</literal></entry>
+ <entry>Makefile generator / build utility</entry>
+ </row>
+
+ <row>
+ <entry><literal>rcc</literal></entry>
+ <entry>resource compiler (need if the application comes
+ with <filename>*.rc</filename> or <filename>*.qrc</filename>
+ files)</entry>
+ </row>
+
+ <row>
+ <entry><literal>uic</literal></entry>
+ <entry>user interface compiler (needed if the application
+ comes with <filename>*.ui</filename> files created by Qt Designer
+ - in practice, every Qt application with a GUI)</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <table frame="none">
+ <title>Available Qt4 plugin components</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>iconengines</literal></entry>
+ <entry>SVG icon engine plugin (if the application
+ ships SVG icons)</entry>
+ </row>
+
+ <row>
+ <entry><literal>imageformats</literal></entry>
+ <entry>imageformat plugins for GIF, JPEG, MNG and
+ SVG (if the application ships image files)</entry>
+ </row>
+
+ </tbody>
+ </tgroup>
+ </table>
+
+ <example id="qt4-components-example">
+ <title>Selecting Qt4 components</title>
+
+ <para>In this example, the ported application uses the
+ Qt4 graphical user interface library, the Qt4 core
+ library, all of the Qt4 code generation tools and Qt4's
+ Makefile generator. Since the gui library implies a
+ dependency on the core library, corelib does
+ not need to be specified. The Qt4 code generation
+ tools moc, uic and rcc, as well as the Makefile generator
+ qmake are only needed at buildtime, thus they are specified
+ with the <literal>_build</literal> suffix:</para>
+
+ <programlisting>USE_QT_VER= 4
+QT_COMPONENTS= gui moc_build qmake_build rcc_build uic_build</programlisting>
+ </example>
+ </sect2>
+
+ <sect2 id="qt-additional">
+ <title>Additional considerations</title>
+
+ <para>If the application does not provide a
+ <filename>configure</filename> file but a <filename>.pro</filename>
+ file, you can use the following:</para>
+
+ <programlisting>HAS_CONFIGURE= yes
+
+do-configure:
+ @cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} \
+ ${QMAKE} -unix PREFIX=${PREFIX} texmaker.pro</programlisting>
+
+ <para>Note the similarity to the <command>qmake</command> line
+ from the provided <filename>BUILD.sh</filename> script. Passing
+ <makevar>CONFIGURE_ENV</makevar> ensures <command>qmake</command>
+ will see the <makevar>QMAKESPEC</makevar> variable, without which
+ it cannot work. <command>qmake</command> generates standard
+ Makefiles, so it is not necessary to write our own
+ <maketarget>build</maketarget> target.</para>
+
+ <para>Qt applications often are written to be cross-platform
+ and often X11/Unix isn't the platform they are developed on,
+ which in turn often leads to certain loose ends, like:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><emphasis>Missing additional includepaths.</emphasis>
+ Many applications come with system tray icon support, but
+ neglect to look for includes and/or libraries in the X11
+ directories. You can tell <command>qmake</command> to
+ add directories to the include and library searchpaths
+ via the commandline, for example:</para>
+
+ <programlisting>${QMAKE} -unix PREFIX=${PREFIX} INCLUDEPATH+=${X11BASE}/include \
+ LIBS+=-L${X11BASE}/lib sillyapp.pro</programlisting>
+
+ </listitem>
+
+ <listitem>
+ <para><emphasis>Bogus installation paths.</emphasis>
+ Sometimes data such as icons or .desktop files are by
+ default installed into directories which aren't scanned by
+ XDG-compatible applications. <filename role="package">editors/texmaker</filename>
+ is an example for this - look at <filename>patch-texmaker.pro</filename>
+ in the <filename>files</filename> directory of that port
+ for a template on how to remedy this directly in the Qmake
+ project file.</para>
+ </listitem>
+ </itemizedlist>
+
+ </sect2>
</sect1>
@@ -4966,7 +5796,7 @@ BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT} \
<para>There are several JDKs in the ports collection, from various
vendors, and in several versions. If your port must use one of
these versions, you can define which one. The most current
- version is <filename role="package">java/jdk14</filename>.</para>
+ version is <filename role="package">java/jdk15</filename>.</para>
<table frame="none">
<title>Variables that may be set by ports that use Java</title>
@@ -5269,7 +6099,7 @@ BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT} \
<para>Regardless of the type of your port (library or application),
the additional documentation should be installed in the
- <link linkend="dads-documentation">same location</link> as for
+ <link linkend="install-documentation">same location</link> as for
any other port. The JavaDoc tool is known to produce a
different set of files depending on the version of the JDK that
is used. For ports that do not enforce the use of a particular
@@ -5326,7 +6156,7 @@ BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT} \
</sect1>
<sect1 id="using-php">
- <title>Using Apache and PHP</title>
+ <title>Web applications, Apache and PHP</title>
<sect2 id="using-apache">
<title>Apache</title>
@@ -5463,11 +6293,29 @@ BUILD_DEPENDS+= Xvfb:${X_VFBSERVER_PORT} \
</tbody>
</tgroup>
</table>
+ </sect2>
+
+ <sect2 id="web-apps">
+ <title>Web 應用程式</title>
<para>Web 應用程式應該安裝到
- <makevar>PREFIX</makevar><filename>/www/<replaceable>appname</replaceable></filename>
- ,同時不應該假設 Apache 已存在了,除非他們有明確地需要(depend on)
- Apahce。使用者也許希望在其他非 Apache 的 Web 伺服器上執行。</para>
+ <filename><makevar>PREFIX</makevar>/www/<replaceable>appname</replaceable></filename>
+ 。 For your convenience, this path is available both in
+ <filename>Makefile</filename> and in <filename>pkg-plist</filename>
+ as <makevar>WWWDIR</makevar>, and the path relative to
+ <makevar>PREFIX</makevar> is available in
+ <filename>Makefile</filename> as
+ <makevar>WWWDIR_REL</makevar>.</para>
+
+ <para>The user and group of web server process are available as
+ <makevar>WWWOWN</makevar> and <makevar>WWWGRP</makevar>, in case you
+ need to change the ownership of some files. The default values of
+ both are <literal>www</literal>. If you want different values for
+ your port, use <literal>WWWOWN?= myuser</literal> notation, to allow
+ user to override it easily.</para>
+
+ <para>請別過於相依 Apache,除非這些程式有明確需要,而得相依 Apache
+ 。也許有些使用者,會想在其他非 Apache 的 Web 伺服器上執行這些網頁程式。</para>
</sect2>
@@ -5612,6 +6460,21 @@ _DOCSDIR= .
<sect1 id="using-python">
<title>Using Python</title>
+ <para>The Ports Collection supports parallel installation of multiple
+ Python versions. Ports should make sure to use a correct
+ <command>python</command> interpreter, according to the user-settable
+ <makevar>PYTHON_VERSION</makevar> variable. Most prominently, this
+ means replacing the path to <command>python</command> executable in
+ scripts with the value of <makevar>PYTHON_CMD</makevar>
+ variable.</para>
+
+ <para>Ports that install files under <makevar>PYTHON_SITELIBDIR</makevar>
+ should use the <literal>pyXY-</literal> package name prefix, so their
+ package name embeds the version of Python they are installed
+ into.</para>
+
+ <programlisting>PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}</programlisting>
+
<table frame="none">
<title>Most useful variables for ports that use Python</title>
@@ -5680,6 +6543,12 @@ _DOCSDIR= .
</row>
<row>
+ <entry><makevar>PYNUMPY</makevar></entry>
+ <entry>Dependency line for the new numeric extension, numpy.
+ (PYNUMERIC is deprecated by upstream vendor).</entry>
+ </row>
+
+ <row>
<entry><makevar>PYXML</makevar></entry>
<entry>Dependency line for XML extension (not needed for
@@ -5812,7 +6681,7 @@ _DOCSDIR= .
</row>
<row>
- <entry><makevar>RUBY_SITEARCHILIBDIR</makevar></entry>
+ <entry><makevar>RUBY_SITEARCHLIBDIR</makevar></entry>
<entry>Architecture dependent libraries installation
path.</entry>
@@ -5944,85 +6813,1262 @@ USE_SDL+= mixer
</sect1>
<sect1 id="using-wx">
- <title>Using wxWidgets</title>
+ <title>Using <application>wxWidgets</application></title>
- <para>If your port uses <application>wxWidgets</application>
- cross-platform toolkit, define <literal>USE_WX=yes</literal>.
- A specific version can be requested by setting
- <literal>USE_WX=2.6</literal>. Ranges (<literal>2.4-2.6</literal>)
- and partial ranges (<literal>-2.4</literal>, <literal>2.6+</literal>)
- are also possible.</para>
+ <para>This section describes the status of the
+ <application>wxWidgets</application> libraries in the ports tree and
+ its integration with the ports system.</para>
- <para>List of required wxWidgets components can be set as
- <makevar>WX_COMPS</makevar>. Unless specified otherwise, port will
- depend on wxWidgets library (<literal>wx</literal>). Available
- components are:</para>
+ <sect2 id="wx-introduction">
+ <title>Introduction</title>
- <table frame="none">
- <title>Possible values for <makevar>WX_COMPS</makevar></title>
+ <para>There are many versions of the
+ <application>wxWidgets</application> libraries which conflict
+ between them (install files under the same name). In the ports tree
+ this problem has been solved by installing each version under a
+ different name using version number suffixes.</para>
+
+ <para>The obvious disadvantage of this is that each application has to
+ be modified to find the expected version. Fortunately, most of the
+ applications call the <command>wx-config</command> script to
+ determine the necessary compiler and linker flags. The script is
+ named differently for every available version. Majority of
+ applications respect an environment variable, or accept a configure
+ argument, to specify which <command>wx-config</command> script to
+ call. Otherwise they have to be patched.</para>
+ </sect2>
- <tgroup cols="2">
- <thead>
- <row>
- <entry>Value</entry>
+ <sect2 id="wx-version">
+ <title>Version selection</title>
- <entry>Means</entry>
- </row>
- </thead>
+ <para>To make your port use a specific version of
+ <application>wxWidgets</application> there are two variables
+ available for defining (if only one is defined the other will be set
+ to a default value):</para>
- <tbody>
- <row>
- <entry><literal>wx</literal></entry>
+ <table id="wx-ver-sel-table" frame="none">
+ <title>Variables to select <application>wxWidgets</application>
+ versions</title>
- <entry>wxWidget libraries</entry>
- </row>
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Variable</entry>
- <row>
- <entry><literal>contrib</literal></entry>
+ <entry>Description</entry>
- <entry>wxWidget contributed libraries</entry>
- </row>
+ <entry>Default value</entry>
+ </row>
+ </thead>
- <row>
- <entry><literal>python</literal></entry>
+ <tbody>
+ <row>
+ <entry><makevar>USE_WX</makevar></entry>
- <entry>wxPython</entry>
- </row>
+ <entry>List of versions the port can use</entry>
- <row>
- <entry><literal>mozilla</literal></entry>
+ <entry>All available versions</entry>
+ </row>
- <entry>wxMozilla (only available for 2.4)</entry>
- </row>
+ <row>
+ <entry><makevar>USE_WX_NOT</makevar></entry>
- <row>
- <entry><literal>svg</literal></entry>
+ <entry>List of versions the port can not use</entry>
- <entry>wxSVG (only available for 2.6)</entry>
- </row>
- </tbody>
- </tgroup>
- </table>
+ <entry>None</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The following is a list of available
+ <application>wxWidgets</application> versions and the corresponding
+ ports in the tree:</para>
+
+ <table frame="none">
+ <title>Available <application>wxWidgets</application>
+ versions</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Version</entry>
- <para>If locating wxWidget libraries needs a configure argument in
- addition to the <makevar>WX_CONFIG</makevar> variable, define
- <makevar>WX_CONF_ARGS</makevar> in your port. Possible values
- are <literal>absolute</literal> resulting in
- <literal>--with-wx-config=${WX_CONFIG}</literal>, and
- <literal>relative</literal> resulting in
- <literal>--with-wx=${X11BASE}</literal> being added to configure
- script arguments.</para>
+ <entry>Port</entry>
+ </row>
+ </thead>
- <para>Define <literal>WX_UNICODE=yes</literal> if your port needs
- the Unicode version of the wxWidgets libraries.</para>
+ <tbody>
+ <row>
+ <entry><literal>2.4</literal></entry>
- <para>Example of port requiring Unicode versions of wxWidgets 2.6 and
- contrib libraries:</para>
+ <entry><filename
+ role="package">x11-toolkits/wxgtk24</filename></entry>
+ </row>
- <programlisting>USE_WX= 2.6
-WX_COMPS= wx contrib
-WX_UNICODE= yes</programlisting>
+ <row>
+ <entry><literal>2.6</literal></entry>
+
+ <entry><filename
+ role="package">x11-toolkits/wxgtk26</filename></entry>
+ </row>
+ <row>
+ <entry><literal>2.8</literal></entry>
+
+ <entry><filename
+ role="package">x11-toolkits/wxgtk28</filename></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <note>
+ <para>The versions starting from <literal>2.5</literal> also come in
+ Unicode version and are installed by a slave port named like the
+ normal one plus a <literal>-unicode</literal> suffix, but this can
+ be handled with variables (see <xref
+ linkend="wx-unicode">).</para>
+ </note>
+
+ <para>The variables in <xref linkend="wx-ver-sel-table"> can be set
+ to one or more of the following combinations separated by
+ spaces:</para>
+
+ <table frame="none">
+ <title><application>wxWidgets</application> version
+ specifications</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Description</entry>
+
+ <entry>Example</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>Single version</entry>
+
+ <entry><literal>2.4</literal></entry>
+ </row>
+
+ <row>
+ <entry>Ascending range</entry>
+
+ <entry><literal>2.4+</literal></entry>
+ </row>
+
+ <row>
+ <entry>Descending range</entry>
+
+ <entry><literal>2.6-</literal></entry>
+ </row>
+
+ <row>
+ <entry>Full range (must be ascending)</entry>
+
+ <entry><literal>2.4-2.6</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>There are also some variables to select the preferred versions
+ from the available ones. They can be set to a list of versions, the
+ first ones will have higher priority.</para>
+
+ <table frame="none">
+ <title>Variables to select preferred
+ <application>wxWidgets</application> versions</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Designed for</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><makevar>WANT_WX_VER</makevar></entry>
+
+ <entry>the port</entry>
+ </row>
+ <row>
+ <entry><makevar>WITH_WX_VER</makevar></entry>
+
+ <entry>the user</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="wx-components">
+ <title>Component selection</title>
+
+ <para>There are other applications that, while not being
+ <application>wxWidgets</application> libraries, are related to them.
+ These applications can be specified in the
+ <makevar>WX_COMPS</makevar> variable. The following components are
+ available:</para>
+
+ <table frame="none">
+ <title>Available <application>wxWidgets</application>
+ components</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Description</entry>
+
+ <entry>Version restriction</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>wx</literal></entry>
+
+ <entry>main library</entry>
+
+ <entry>none</entry>
+ </row>
+
+ <row>
+ <entry><literal>contrib</literal></entry>
+
+ <entry>contributed libraries</entry>
+
+ <entry><literal>none</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>python</literal></entry>
+
+ <entry><application>wxPython</application>
+ (<application>Python</application> bindings)</entry>
+
+ <entry><literal>2.4-2.6</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>mozilla</literal></entry>
+
+ <entry><application>wxMozilla</application></entry>
+
+ <entry><literal>2.4</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>svg</literal></entry>
+
+ <entry><application>wxSVG</application></entry>
+
+ <entry><literal>2.6</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The dependency type can be selected for each component by adding
+ a suffix separated by a semicolon. If not present then a default
+ type will be used (see <xref linkend="wx-def-dep-types">). The
+ following types are available:</para>
+
+ <table frame="none">
+ <title>Available <application>wxWidgets</application> dependency
+ types</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>build</literal></entry>
+
+ <entry>Component is required for building, equivalent to
+ <makevar>BUILD_DEPENDS</makevar></entry>
+ </row>
+
+ <row>
+ <entry><literal>run</literal></entry>
+
+ <entry>Component is required for running, equivalent to
+ <makevar>RUN_DEPENDS</makevar></entry>
+ </row>
+
+ <row>
+ <entry><literal>lib</literal></entry>
+
+ <entry>Component is required for building and running,
+ equivalent to <makevar>LIB_DEPENDS</makevar>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The default values for the components are detailed in the
+ following table:</para>
+
+ <table id="wx-def-dep-types" frame="none">
+ <title>Default <application>wxWidgets</application> dependency
+ types</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Component</entry>
+
+ <entry>Dependency type</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>wx</literal></entry>
+
+ <entry><literal>lib</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>contrib</literal></entry>
+
+ <entry><literal>lib</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>python</literal></entry>
+
+ <entry><literal>run</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>mozilla</literal></entry>
+
+ <entry><literal>lib</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>svg</literal></entry>
+
+ <entry><literal>lib</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <example id="wx-components-example">
+ <title>Selecting <application>wxWidgets</application>
+ components</title>
+
+ <para>The following fragment corresponds to a port which uses
+ <application>wxWidgets</application> version
+ <literal>2.4</literal> and its contributed libraries.</para>
+
+ <programlisting>USE_WX= 2.4
+WX_COMPS= wx contrib</programlisting>
+ </example>
+ </sect2>
+ <sect2 id="wx-unicode">
+ <title>Unicode</title>
+
+ <para>The <application>wxWidgets</application> library supports
+ Unicode since version <literal>2.5</literal>. In the ports tree
+ both versions are available and can be selected with the following
+ variables:</para>
+
+ <table id="wx-unicode-var-table" frame="none">
+ <title>Variables to select Unicode in
+ <application>wxWidgets</application>
+ versions</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Variable</entry>
+
+ <entry>Description</entry>
+
+ <entry>Designed for</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><makevar>WX_UNICODE</makevar></entry>
+
+ <entry>The port works <emphasis>only</emphasis> with the
+ Unicode version</entry>
+
+ <entry>the port</entry>
+ </row>
+
+ <row>
+ <entry><makevar>WANT_UNICODE</makevar></entry>
+
+ <entry>The port works with both versions but prefers the
+ Unicode one</entry>
+
+ <entry>the port</entry>
+ </row>
+
+ <row>
+ <entry><makevar>WITH_UNICODE</makevar></entry>
+
+ <entry>The port will use the Unicode version</entry>
+
+ <entry>the user</entry>
+ </row>
+
+ <row>
+ <entry><makevar>WITHOUT_UNICODE</makevar></entry>
+
+ <entry>The port will use the normal version if
+ supported (when <makevar>WX_UNICODE</makevar> is not
+ defined)</entry>
+
+ <entry>the user</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <warning>
+ <para>Do not use <makevar>WX_UNICODE</makevar> for ports that can
+ use both Unicode and normal versions. If you want the port to use
+ Unicode by default define <makevar>WANT_UNICODE</makevar>
+ instead.</para>
+ </warning>
+ </sect2>
+
+ <sect2 id="wx-version-detection">
+ <title>Detecting installed versions</title>
+
+ <para>To detect an installed version you have to define
+ <makevar>WANT_WX</makevar>. If you do not set it to a specific
+ version then the components will have a version suffix. The
+ <makevar>HAVE_WX</makevar> variable will be filled after
+ detection.</para>
+
+ <example id="wx-ver-det-example">
+ <title>Detecting installed <application>wxWidgets</application>
+ versions and components</title>
+
+ <para>The following fragment can be used in a port that uses
+ <application>wxWidgets</application> if it is installed, or an
+ option is selected.</para>
+
+ <programlisting>WANT_WX= yes
+
+.include &lt;bsd.port.pre.mk&gt;
+
+.if defined(WITH_WX) || ${HAVE_WX:Mwx-2.4} != ""
+USE_WX= 2.4
+CONFIGURE_ARGS+=--enable-wx
+.endif</programlisting>
+
+ <para>The following fragment can be used in a port that enables
+ <application>wxPython</application> support if it is installed or
+ if an option is selected, in addition to
+ <application>wxWidgets</application>, both version
+ <literal>2.6</literal>.</para>
+
+ <programlisting>USE_WX= 2.6
+WX_COMPS= wx
+WANT_WX= 2.6
+
+.include &lt;bsd.port.pre.mk&gt;
+
+.if defined(WITH_WXPYTHON) || ${HAVE_WX:Mpython} != ""
+WX_COMPS+= python
+CONFIGURE_ARGS+=--enable-wxpython
+.endif</programlisting>
+ </example>
+ </sect2>
+
+ <sect2 id="wx-defined-variables">
+ <title>Defined variables</title>
+
+ <para>The following variables are available in the port (after
+ defining one from <xref linkend="wx-ver-sel-table">).</para>
+
+ <table frame="none">
+ <title>Variables defined for ports that use
+ <application>wxWidgets</application></title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><makevar>WX_CONFIG</makevar></entry>
+
+ <entry>The path to the <application>wxWidgets</application>
+ <command>wx-config</command> script (with different
+ name)</entry>
+ </row>
+ <row>
+ <entry><makevar>WXRC_CMD</makevar></entry>
+
+ <entry>The path to the <application>wxWidgets</application>
+ <command>wxrc</command> program (with different
+ name)</entry>
+ </row>
+ <row>
+ <entry><makevar>WX_VERSION</makevar></entry>
+
+ <entry>The <application>wxWidgets</application> version that
+ is going to be used (e.g., <literal>2.6</literal>)</entry>
+ </row>
+
+ <row>
+ <entry><makevar>WX_UNICODE</makevar></entry>
+
+ <entry>If not defined but Unicode is going to be used then it
+ will be defined</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+
+ <sect2 id="wx-premk">
+ <title>Processing in <filename>bsd.port.pre.mk</filename></title>
+
+ <para>If you need to use the variables for running commands right
+ after including <filename>bsd.port.pre.mk</filename> you need to
+ define <makevar>WX_PREMK</makevar>.</para>
+
+ <important>
+ <para>If you define <makevar>WX_PREMK</makevar>, then the version,
+ dependencies, components and defined variables will not change if
+ you modify the <application>wxWidgets</application> port variables
+ <emphasis>after</emphasis> including
+ <filename>bsd.port.pre.mk</filename>.</para>
+ </important>
+
+ <example id="wx-premk-example">
+ <title>Using <application>wxWidgets</application> variables in
+ commands</title>
+
+ <para>The following fragment illustrates the use of
+ <makevar>WX_PREMK</makevar> by running the
+ <command>wx-config</command> script to obtain the full version
+ string, assign it to a variable and pass it to the program.</para>
+
+ <programlisting>USE_WX= 2.4
+WX_PREMK= yes
+
+.include &lt;bsd.port.pre.mk&gt;
+
+.if exists(${WX_CONFIG})
+VER_STR!= ${WX_CONFIG} --release
+
+PLIST_SUB+= VERSION="${VER_STR}"
+.endif</programlisting>
+ </example>
+
+ <note>
+ <para>The <application>wxWidgets</application> variables can be
+ safely used in commands when they are inside targets without the
+ need of <makevar>WX_PREMK</makevar>.</para>
+ </note>
+ </sect2>
+
+ <sect2 id="wx-additional-config-args">
+ <title>Additional <command>configure</command> arguments</title>
+
+ <para>Some GNU <command>configure</command> scripts can not find
+ <application>wxWidgets</application> with just the
+ <literal>WX_CONFIG</literal> environment variable set, requiring
+ additional arguments. The <makevar>WX_CONF_ARGS</makevar> variable
+ can be used for provide them.</para>
+
+ <table frame="none">
+ <title>Legal values for <makevar>WX_CONF_ARGS</makevar></title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Possible value</entry>
+
+ <entry>Resulting argument</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>absolute</literal></entry>
+
+ <entry><literal>--with-wx-config=${WX_CONFIG}</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>relative</literal></entry>
+
+ <entry><literal>--with-wx=${X11BASE}
+ --with-wx-config=${WX_CONFIG:T}</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+ </sect2>
+ </sect1>
+
+ <sect1 id="using-lua">
+ <title>Using <application>Lua</application></title>
+
+ <para>This section describes the status of the
+ <application>Lua</application> libraries in the ports tree and its
+ integration with the ports system.</para>
+
+ <sect2 id="lua-introduction">
+ <title>Introduction</title>
+
+ <para>There are many versions of the <application>Lua</application>
+ libraries and corresponding interpreters, which conflict between
+ them (install files under the same name). In the ports tree this
+ problem has been solved by installing each version under a different
+ name using version number suffixes.</para>
+
+ <para>The obvious disadvantage of this is that each application has to
+ be modified to find the expected version. But it can be solved by
+ adding some additional flags to the compiler and linker.</para>
+ </sect2>
+
+ <sect2 id="lua-version">
+ <title>Version selection</title>
+
+ <para>To make your port use a specific version of
+ <application>Lua</application> there are two variables available
+ for defining (if only one is defined the other will be set to a
+ default value):</para>
+
+ <table id="lua-ver-sel-table" frame="none">
+ <title>Variables to select <application>Lua</application>
+ versions</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Variable</entry>
+
+ <entry>Description</entry>
+
+ <entry>Default value</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><makevar>USE_LUA</makevar></entry>
+
+ <entry>List of versions the port can use</entry>
+
+ <entry>All available versions</entry>
+ </row>
+
+ <row>
+ <entry><makevar>USE_LUA_NOT</makevar></entry>
+
+ <entry>List of versions the port can not use</entry>
+
+ <entry>None</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The following is a list of available
+ <application>Lua</application> versions and the corresponding ports
+ in the tree:</para>
+
+ <table frame="none">
+ <title>Available <application>Lua</application> versions</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Version</entry>
+
+ <entry>Port</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>4.0</literal></entry>
+
+ <entry><filename role="package">lang/lua4</filename></entry>
+ </row>
+
+ <row>
+ <entry><literal>5.0</literal></entry>
+
+ <entry><filename role="package">lang/lua50</filename></entry>
+ </row>
+
+ <row>
+ <entry><literal>5.1</literal></entry>
+
+ <entry><filename role="package">lang/lua</filename></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The variables in <xref linkend="lua-ver-sel-table"> can be set
+ to one or more of the following combinations separated by
+ spaces:</para>
+
+ <table frame="none">
+ <title><application>Lua</application> version specifications</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Description</entry>
+
+ <entry>Example</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry>Single version</entry>
+
+ <entry><literal>4.0</literal></entry>
+ </row>
+
+ <row>
+ <entry>Ascending range</entry>
+
+ <entry><literal>5.0+</literal></entry>
+ </row>
+
+ <row>
+ <entry>Descending range</entry>
+
+ <entry><literal>5.0-</literal></entry>
+ </row>
+
+ <row>
+ <entry>Full range (must be ascending)</entry>
+
+ <entry><literal>5.0-5.1</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>There are also some variables to select the preferred versions
+ from the available ones. They can be set to a list of versions, the
+ first ones will have higher priority.</para>
+
+ <table frame="none">
+ <title>Variables to select preferred <application>Lua</application>
+ versions</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Designed for</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><makevar>WANT_LUA_VER</makevar></entry>
+
+ <entry>the port</entry>
+ </row>
+
+ <row>
+ <entry><makevar>WITH_LUA_VER</makevar></entry>
+
+ <entry>the user</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <example id="lua-version-example">
+ <title>Selecting the <application>Lua</application> version</title>
+
+ <para>The following fragment is from a port which can use
+ <application>Lua</application> version <literal>5.0</literal> or
+ <literal>5.1</literal>, and uses <literal>5.0</literal> by
+ default. It can be overriden by the user using
+ <makevar>WITH_LUA_VER</makevar>.</para>
+
+ <programlisting>USE_LUA= 5.0-5.1
+WANT_LUA_VER= 5.0</programlisting>
+ </example>
+ </sect2>
+
+ <sect2 id="lua-components">
+ <title>Component selection</title>
+
+ <para>There are other applications that, while not being
+ <application>Lua</application> libraries, are related to them.
+ These applications can be specified in the
+ <makevar>LUA_COMPS</makevar> variable. The following components are
+ available:</para>
+
+ <table frame="none">
+ <title>Available <application>Lua</application> components</title>
+
+ <tgroup cols="3">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Description</entry>
+
+ <entry>Version restriction</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>lua</literal></entry>
+
+ <entry>main library</entry>
+
+ <entry>none</entry>
+ </row>
+
+ <row>
+ <entry><literal>tolua</literal></entry>
+
+ <entry>Library for accesing C/C++ code</entry>
+
+ <entry><literal>4.0-5.0</literal></entry>
+ </row>
+
+ <row>
+ <entry><literal>ruby</literal></entry>
+
+ <entry>Ruby bindings</entry>
+
+ <entry><literal>4.0-5.0</literal></entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <note>
+ <para>There are more components but they are modules for the
+ interpreter, not used by applications (only by other
+ modules).</para>
+ </note>
+
+ <para>The dependency type can be selected for each component by adding
+ a suffix separated by a semicolon. If not present then a default
+ type will be used (see <xref linkend="lua-def-dep-types">). The
+ following types are available:</para>
+
+ <table frame="none">
+ <title>Available <application>Lua</application> dependency
+ types</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>build</literal></entry>
+
+ <entry>Component is required for building, equivalent to
+ <makevar>BUILD_DEPENDS</makevar></entry>
+ </row>
+
+ <row>
+ <entry><literal>run</literal></entry>
+
+ <entry>Component is required for running, equivalent to
+ <makevar>RUN_DEPENDS</makevar></entry>
+ </row>
+
+ <row>
+ <entry><literal>lib</literal></entry>
+
+ <entry>Component is required for building and running,
+ equivalent to <makevar>LIB_DEPENDS</makevar>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <para>The default values for the components are detailed in the
+ following table:</para>
+
+ <table id="lua-def-dep-types" frame="none">
+ <title>Default <application>Lua</application> dependency
+ types</title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Component</entry>
+
+ <entry>Dependency type</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><literal>lua</literal></entry>
+
+ <entry><literal>lib</literal> for <literal>4.0-5.0</literal>
+ (shared) and <literal>build</literal> for
+ <literal>5.1</literal> (static)</entry>
+ </row>
+
+ <row>
+ <entry><literal>tolua</literal></entry>
+
+ <entry><literal>build</literal> (static)</entry>
+ </row>
+
+ <row>
+ <entry><literal>ruby</literal></entry>
+
+ <entry><literal>lib</literal> (shared)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <example id="lua-components-example">
+ <title>Selecting <application>Lua</application> components</title>
+
+ <para>The following fragment corresponds to a port which uses
+ <application>Lua</application> version <literal>4.0</literal> and
+ its <application>Ruby</application> bindings.</para>
+
+ <programlisting>USE_LUA= 4.0
+LUA_COMPS= lua ruby</programlisting>
+ </example>
+ </sect2>
+
+ <sect2 id="lua-version-detection">
+ <title>Detecting installed versions</title>
+
+ <para>To detect an installed version you have to define
+ <makevar>WANT_LUA</makevar>. If you do not set it to a specific
+ version then the components will have a version suffix. The
+ <makevar>HAVE_LUA</makevar> variable will be filled after
+ detection.</para>
+
+ <example id="lua-ver-det-example">
+ <title>Detecting installed <application>Lua</application> versions
+ and components</title>
+
+ <para>The following fragment can be used in a port that uses
+ <application>Lua</application> if it is installed, or an option is
+ selected.</para>
+
+ <programlisting>WANT_LUA= yes
+
+.include &lt;bsd.port.pre.mk&gt;
+
+.if defined(WITH_LUA5) || ${HAVE_LUA:Mlua-5.[01]} != ""
+USE_LUA= 5.0-5.1
+CONFIGURE_ARGS+=--enable-lua5
+.endif</programlisting>
+
+ <para>The following fragment can be used in a port that enables
+ <application>tolua</application> support if it is installed or if
+ an option is selected, in addition to
+ <application>Lua</application>, both version
+ <literal>4.0</literal>.</para>
+
+ <programlisting>USE_LUA= 4.0
+LUA_COMPS= lua
+WANT_LUA= 4.0
+
+.include &lt;bsd.port.pre.mk&gt;
+
+.if defined(WITH_TOLUA) || ${HAVE_LUA:Mtolua} != ""
+LUA_COMPS+= tolua
+CONFIGURE_ARGS+=--enable-tolua
+.endif</programlisting>
+ </example>
+ </sect2>
+
+ <sect2 id="lua-defined-variables">
+ <title>Defined variables</title>
+
+ <para>The following variables are available in the port (after
+ defining one from <xref linkend="lua-ver-sel-table">).</para>
+
+ <table frame="none">
+ <title>Variables defined for ports that use
+ <application>Lua</application></title>
+
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Name</entry>
+
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry><makevar>LUA_VER</makevar></entry>
+
+ <entry>The <application>Lua</application> version that is
+ going to be used (e.g., <literal>5.1</literal>)</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_VER_SH</makevar></entry>
+ <entry>The <application>Lua</application> shared library major
+ version (e.g., <literal>1</literal>)</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_VER_STR</makevar></entry>
+
+ <entry>The <application>Lua</application> version without the
+ dots (e.g., <literal>51</literal>)</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_PREFIX</makevar></entry>
+
+ <entry>The prefix where <application>Lua</application> (and
+ components) is installed</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_SUBDIR</makevar></entry>
+
+ <entry>The directory under <filename>${PREFIX}/bin</filename>,
+ <filename>${PREFIX}/share</filename> and
+ <filename>${PREFIX}/lib</filename> where
+ <application>Lua</application> is installed</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_INCDIR</makevar></entry>
+
+ <entry>The directory where <application>Lua</application> and
+ <application>tolua</application> header files are
+ installed</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_LIBDIR</makevar></entry>
+
+ <entry>The directory where <application>Lua</application> and
+ <application>tolua</application> libraries are
+ installed</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_MODLIBDIR</makevar></entry>
+
+ <entry>The directory where <application>Lua</application>
+ module libraries (<filename>.so</filename>) are
+ installed</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_MODSHAREDIR</makevar></entry>
+
+ <entry>The directory where <application>Lua</application>
+ modules (<filename>.lua</filename>) are installed</entry>
+ </row>
+
+ <row>
+ <entry><makevar>LUA_PKGNAMEPREFIX</makevar></entry>
+
+ <entry>The package name prefix used by
+ <application>Lua</application> modules</entry>
+ </row>
+ <row>
+ <entry><makevar>LUA_CMD</makevar></entry>
+
+ <entry>The path to the <application>Lua</application>
+ interpreter</entry>
+ </row>
+ <row>
+ <entry><makevar>LUAC_CMD</makevar></entry>
+
+ <entry>The path to the <application>Lua</application>
+ compiler</entry>
+ </row>
+ <row>
+ <entry><makevar>TOLUA_CMD</makevar></entry>
+
+ <entry>The path to the <application>tolua</application>
+ program</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+ <example id="lua-variables-example">
+ <title>Telling the port where to find
+ <application>Lua</application></title>
+
+ <para>The following fragment shows how to tell a port that uses a
+ configure script where the <application>Lua</application> header
+ files and libraries are.</para>
+
+ <programlisting>
+USE_LUA= 4.0
+GNU_CONFIGURE= yes
+CONFIGURE_ENV= CPPFLAGS="-I${LUA_INCDIR}" LDFLAGS="-L${LUA_LIBDIR}"</programlisting>
+ </example>
+ </sect2>
+
+ <sect2 id="lua-premk">
+ <title>Processing in <filename>bsd.port.pre.mk</filename></title>
+
+ <para>If you need to use the variables for running commands right
+ after including <filename>bsd.port.pre.mk</filename> you need to
+ define <makevar>LUA_PREMK</makevar>.</para>
+
+ <important>
+ <para>If you define <makevar>LUA_PREMK</makevar>, then the version,
+ dependencies, components and defined variables will not change if
+ you modify the <application>Lua</application> port variables
+ <emphasis>after</emphasis> including
+ <filename>bsd.port.pre.mk</filename>.</para>
+ </important>
+
+ <example id="lua-premk-example">
+ <title>Using <application>Lua</application> variables in
+ commands</title>
+
+ <para>The following fragment illustrates the use of
+ <makevar>LUA_PREMK</makevar> by running the
+ <application>Lua</application> interpreter to obtain the full
+ version string, assign it to a variable and pass it to the
+ program.</para>
+
+ <programlisting>USE_LUA= 5.0
+LUA_PREMK= yes
+
+.include &lt;bsd.port.pre.mk&gt;
+
+.if exists(${LUA_CMD})
+VER_STR!= ${LUA_CMD} -v
+
+CFLAGS+= -DLUA_VERSION_STRING="${VER_STR}"
+.endif</programlisting>
+ </example>
+
+ <note>
+ <para>The <application>Lua</application> variables can be safely
+ used in commands when they are inside targets without the need of
+ <makevar>LUA_PREMK</makevar>.</para>
+ </note>
+ </sect2>
+ </sect1>
+
+ <sect1 id="using-xfce">
+ <title>Using Xfce</title>
+
+ <para>The <makevar>USE_XFCE</makevar> variable is used to autoconfigure
+ the dependencies for ports which use an Xfce based library or application
+ like
+ <filename role="package">x11-toolkits/libxfce4gui</filename> and
+ <filename role="package">x11-wm/xfce4-panel</filename>.</para>
+
+ <para>The following Xfce libraries and applications are recognized at
+ the moment:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>libexo: <filename role="package">x11/libexo</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>libgui: <filename role="package">x11-toolkits/libxfce4gui</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>libutil: <filename role="package">x11/libxfce4util</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>libmcs: <filename role="package">x11/libxfce4mcs</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>mcsmanager: <filename role="package">sysutils/xfce4-mcs-manager</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>panel: <filename role="package">x11-wm/xfce4-panel</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>thunar: <filename role="package">x11-fm/thunar</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>wm: <filename role="package">x11-wm/xfce4-wm</filename></para>
+ </listitem>
+
+ <listitem>
+ <para>xfdev: <filename role="package">dev/xfce4-dev-tools</filename></para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>The following additional parameters are recognized:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para>configenv: Use this if your port requires a special modified
+ <makevar>CONFIGURE_ENV</makevar> to find it's required libraries.
+ <programlisting>-I&dollar;{LOCALBASE}/include -L&dollar;{LOCALBASE}/lib</programlisting>
+ gets added to CPPFLAGS to <makevar>CONFIGURE_ENV</makevar>.</para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>Therefore, if a port has a dependency on
+ <filename role="package">sysutils/xfce4-mcs-manager</filename> and
+ requires the special CPPFLAGS in its configure environment,
+ the syntax will be:</para>
+
+ <programlisting>USE_XFCE= mcsmanager configenv</programlisting>
</sect1>
<sect1 id="rc-scripts">
@@ -6031,15 +8077,18 @@ WX_UNICODE= yes</programlisting>
<para><filename>rc.d</filename> scripts are used to start services on system
startup, and to give administrators a standard way of stopping,
starting and restarting the service. Ports integrate into
- the system <filename>rc.d</filename> framework. Details on usage
+ the system <filename>rc.d</filename> framework. Details on its usage
can be found in
<ulink url="&url.books.handbook;/configtuning-rcd.html">the rc.d Handbook
- chapter</ulink>. Detailed explanation of available commands are in
- &man.rc.8; and &man.rc.subr.8;.</para>
+ chapter</ulink>. Detailed explanation of available commands is
+ provided in
+ &man.rc.8; and &man.rc.subr.8;. Finally, there is
+ <ulink url="&url.articles.rc-scripting.en">an article</ulink>
+ on practical aspects of <filename>rc.d</filename> scripting.</para>
<para>One or more rc scripts can be installed:</para>
- <programlisting>USE_RC_SUBR= doorman.sh</programlisting>
+ <programlisting>USE_RC_SUBR= doormand</programlisting>
<para>Scripts must be placed in the <filename>files</filename>
subdirectory and a <literal>.in</literal> suffix must be added to their
@@ -6068,29 +8117,32 @@ WX_UNICODE= yes</programlisting>
<programlisting>#!/bin/sh
-# PROVIDE: doorman
+# PROVIDE: doormand
# REQUIRE: LOGIN
-
#
-# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to enable doorman:
-# doorman_enable (bool): Set to "NO" by default.
-# Set it to "YES" to enable doorman
-# doorman_config (path): Set to "%%PREFIX%%/etc/doormand/doormand.cf" by default.
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# doormand_enable (bool): Set to NO by default.
+# Set it to YES to enable doormand.
+# doormand_config (path): Set to %%PREFIX%%/etc/doormand/doormand.cf
+# by default.
#
. %%RC_SUBR%%
-name="doorman"
-rcvar=`set_rcvar`
+name="doormand"
+rcvar=${name}_enable
+
+command=%%PREFIX%%/sbin/${name}
+pidfile=/var/run/${name}.pid
load_rc_config $name
-: ${doorman_enable="NO"}
-: ${doorman_config="%%PREFIX%%/etc/doormand/doormand.cf"}
+: ${doormand_enable="NO"}
+: ${doormand_config="%%PREFIX%%/etc/doormand/doormand.cf"}
-command=%%PREFIX%%/sbin/doormand
-pidfile=/var/run/doormand.pid
-command_args="-p $pidfile -f $doorman_config"
+command_args="-p $pidfile -f $doormand_config"
run_rc_command "$1"</programlisting>
@@ -6100,14 +8152,44 @@ run_rc_command "$1"</programlisting>
and the latter sets one if the variable is unset
<emphasis>or</emphasis> null.
A user might very well include something like
- <programlisting>doorman_flags=""</programlisting> in their
+ <programlisting>doormand_flags=""</programlisting> in their
<filename>rc.conf.local</filename> file, and a variable
substitution using &quot;:=&quot; would inappropriately
override the user's intention.</para>
+ <para>The suffix of the rc script is provided in
+ <makevar>RC_SUBR_SUFFIX</makevar> for further use in the port's
+ <filename>Makefile</filename>. Current versions of &os; do not add
+ any suffix to the script name, but older versions used to add
+ <filename>.sh</filename> suffix.</para>
+
+ <note>
+ <para>No new scripts should be added with the <filename>.sh</filename>
+ suffix. At some point there will be a mass repocopy of all the
+ scripts that still have that suffix.</para>
+ </note>
+
+ <sect2>
+ <title>Stopping services at deinstall</title>
+
+ <para>It is possible to have a service stopped automatically as part of
+ the deinstall routine. We advise using this feature only when it's
+ absolutely necessary to stop a service before it's files go
+ away. Usually, it's up to the administrator's discretion to decide,
+ whether to stop the service on deinstall or not. Also note this
+ affects upgrades, too.</para>
+
+ <para>Line like this goes to the <filename>pkg-plist</filename>:</para>
+
+ <programlisting>@stopdaemon doormand</programlisting>
+
+ <para>The argument must match the content of
+ <makevar>USE_RC_SUBR</makevar> variable.</para>
+ </sect2>
</sect1>
</chapter>
+
<chapter id="plist">
<title>Advanced <filename>pkg-plist</filename> practices</title>
@@ -6132,7 +8214,7 @@ run_rc_command "$1"</programlisting>
the patchlevel (e.g., <literal>5.005</literal>). Several other
<literal>%%<replaceable>VARS</replaceable>%%</literal> related to
port's documentation files are described in <link
- linkend="dads-documentation">the relevant section</link>.</para>
+ linkend="install-documentation">the relevant section</link>.</para>
<para>If you need to make other substitutions, you can set the
<makevar>PLIST_SUB</makevar> variable with a list of
@@ -6319,37 +8401,33 @@ etc/orbit.conf.sample
<sect1 id="plist-autoplist">
<title>自動產生 package list</title>
- <para>首先,先確認您的 port 除了 <filename>pkg-plist</filename> 尚未搞定之外,其他都完成了。</para>
+ <para>首先,先確認您的 port 除了 <filename>pkg-plist</filename>
+ 尚未搞定之外,其他都完成了。</para>
- <para>接著, create a temporary directory tree into which your port can be
- installed, and install any dependencies.
- <replaceable>port-type</replaceable> should be <literal>local</literal>
- for non-X ports and <literal>x11-4</literal> or <literal>x11</literal>
- for ports which install into the directory hierarchy of XFree86 4
- or an earlier XFree86 release, respectively.</para>
+ <para>接著,建立臨時目錄以供該 port 安裝,並且把所有相依套件都裝好
+ 。</para>
- <screen>&prompt.root; <userinput>mkdir /var/tmp/<replaceable>port-name</replaceable></userinput>
-&prompt.root; <userinput>mtree -U -f /etc/mtree/BSD.<replaceable>port-type</replaceable>.dist -d -e -p /var/tmp/<replaceable>port-name</replaceable></userinput>
-&prompt.root; <userinput>make depends PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput></screen>
+ <screen>&prompt.root; <userinput>mkdir /var/tmp/$(make -V PORTNAME)</userinput>
+&prompt.root; <userinput>mtree -U -f $(make -V MTREE_FILE) -d -e -p /var/tmp/$(make -V PORTNAME)</userinput>
+&prompt.root; <userinput>make depends PREFIX=/var/tmp/$(make -V PORTNAME)</userinput></screen>
- <para>Store the directory structure in a new file.</para>
+ <para>把這目錄架構存到新檔案。</para>
- <screen>&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * -type d) | sort &gt; OLD-DIRS</userinput></screen>
+ <screen>&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort &gt; OLD-DIRS</userinput></screen>
- <para>Create an empty <filename>pkg-plist</filename> file:</para>
+ <para>新增空的 <filename>pkg-plist</filename> 檔案:</para>
- <screen>&prompt.root; <userinput>touch pkg-plist</userinput></screen>
+ <screen>&prompt.root; <userinput>:&gt;pkg-plist</userinput></screen>
- <para>If your port honors <makevar>PREFIX</makevar> (which it should)
- you can then install the port and create the package list.</para>
+ <para>若該 port 有遵循 <makevar>PREFIX</makevar>(也應該要遵循),
+ 接著就可以安裝該 port 並產生檔案清單。</para>
- <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/<replaceable>port-name</replaceable></userinput>
-&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * \! -type d) | sort &gt; pkg-plist</userinput></screen>
+ <screen>&prompt.root; <userinput>make install PREFIX=/var/tmp/$(make -V PORTNAME)</userinput>
+&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * \! -type d) | sort &gt; pkg-plist</userinput></screen>
- <para>You must also add any newly created directories to the packing
- list.</para>
+ <para>這時要記得把新建的目錄,也加到檔案清單內。</para>
- <screen>&prompt.root; <userinput>(cd /var/tmp/<replaceable>port-name</replaceable> && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' &gt;&gt; pkg-plist</userinput></screen>
+ <screen>&prompt.root; <userinput>(cd /var/tmp/$(make -V PORTNAME) && find -d * -type d) | sort | comm -13 OLD-DIRS - | sort -r | sed -e 's#^#@dirrm #' &gt;&gt; pkg-plist</userinput></screen>
<para>Finally, you need to tidy up the packing list by hand; it is not
<emphasis>all</emphasis> automated. Manual pages should be listed in
@@ -6403,6 +8481,25 @@ etc/orbit.conf.sample
after a &man.pkg.add.1; or to display licensing
information.</para>
+ <para>When some lines about the build-time knobs or warnings
+ have to be displayed, use <makevar>ECHO_MSG</makevar>. The
+ <filename>pkg-message</filename> file is only for
+ post-installation steps. Likewise, the distinction between
+ <makevar>ECHO_MSG</makevar> and <makevar>ECHO_CMD</makevar>
+ should be kept in mind. The former is for printing
+ informational text to the screen, while the latter is for
+ command pipelining.</para>
+
+ <para>A good example for both can be found in
+ <filename>shells/bash2/Makefile</filename>:</para>
+
+ <programlisting>update-etc-shells:
+ @${ECHO_MSG} "updating /etc/shells"
+ @${CP} /etc/shells /etc/shells.bak
+ @( ${GREP} -v ${PREFIX}/bin/bash /etc/shells.bak; \
+ ${ECHO_CMD} ${PREFIX}/bin/bash) &gt;/etc/shells
+ @${RM} /etc/shells.bak</programlisting>
+
<note>
<para>The <filename>pkg-message</filename> file does not need to be
added to <filename>pkg-plist</filename>. Also, it will not get
@@ -6586,7 +8683,7 @@ SUB_LIST= ARCH=${ARCH}</programlisting>
<para>Example of a good <filename>pkg-message.in</filename>:</para>
- <programlisting>Now it's time to configure this package.
+ <programlisting>Now it is time to configure this package.
Copy %%PREFIX%%/share/examples/putsy/%%ARCH%%.conf into your home directory
as .putsy.conf and edit it.</programlisting>
@@ -6648,18 +8745,49 @@ as .putsy.conf and edit it.</programlisting>
doubt, the best thing to do is ask on &a.ports;.</para>
</sect1>
- <sect1 id="porting-prefix">
- <title><makevar>PREFIX</makevar></title>
+ <sect1 id="testing-porttools">
+ <title>Port Tools</title>
+
+ <para>The <filename role="package">ports-mgmt/porttools</filename>
+ program is part of the Ports Collection.</para>
+
+ <para><command>port</command> is the front-end script,
+ which can help you simplify the testing job. Whenever you want
+ to test a new port or update an existing one, you can use
+ <command>port test</command> to test your port, including the
+ <link linkend="testing-portlint"><command>portlint</command></link>
+ checking. This command also detects and lists any files that
+ are not listed in <filename>pkg-plist</filename>. See the
+ following example:</para>
+
+ <screen>&prompt.root; <userinput>port test /usr/ports/net/csup</userinput></screen>
+ </sect1>
- <para>Do try to make your port install relative to
- <makevar>PREFIX</makevar>. The value of this variable will be set
- to <makevar>LOCALBASE</makevar> (default
+ <sect1 id="porting-prefix">
+ <title><makevar>PREFIX</makevar> and <makevar>DESTDIR</makevar></title>
+
+ <para><makevar>PREFIX</makevar> determines the location where
+ the port will install. It is usually <filename>/usr/local</filename>,
+ or <filename>/opt</filename>. User can set <makevar>PREFIX</makevar>
+ to anything he wants. Your port must respect this variable.</para>
+
+ <para><makevar>DESTDIR</makevar>, if set by user, determines the
+ complete alternative environment, usually a jail, or an installed
+ system mounted elsewhere than <filename>/</filename>.
+ A port will actually install into
+ <makevar>DESTDIR</makevar>/<makevar>PREFIX</makevar>, and register
+ with the package database in <makevar>DESTDIR</makevar>/var/db/pkg.
+ It is very important to write ports that respect
+ <makevar>DESTDIR</makevar>.</para>
+
+ <para>The value of <makevar>PREFIX</makevar> will be set
+ to <makevar>LOCALBASE_REL</makevar> (default
<filename>/usr/local</filename>). If
<makevar>USE_X_PREFIX</makevar> or <makevar>USE_IMAKE</makevar> is
- set, <makevar>PREFIX</makevar> will be <makevar>X11BASE</makevar> (default
+ set, <makevar>PREFIX</makevar> will be <makevar>X11BASE_REL</makevar> (default
<filename>/usr/X11R6</filename>). If
<makevar>USE_LINUX_PREFIX</makevar> is set, <makevar>PREFIX</makevar>
- will be <makevar>LINUXBASE</makevar> (default
+ will be <makevar>LINUXBASE_REL</makevar> (default
<filename>/compat/linux</filename>).</para>
<para>Avoiding the hard-coding of <filename>/usr/local</filename> or
@@ -6669,7 +8797,7 @@ as .putsy.conf and edit it.</programlisting>
automatic; otherwise, this can often be done by simply replacing the
occurrences of <filename>/usr/local</filename> (or
<filename>/usr/X11R6</filename> for X ports that do not use imake)
- in the various <filename>scripts/Makefile</filename>s in the port to read
+ in the various <filename>Makefile</filename>s in the port to read
<makevar>${PREFIX}</makevar>, as this variable is automatically passed
down to every stage of the build and install processes.</para>
@@ -6691,7 +8819,7 @@ as .putsy.conf and edit it.</programlisting>
to do that while you have it installed would do that.</para>
<para>Do not set <makevar>USE_X_PREFIX</makevar> unless your port
- truly requires it (i.e., it links against X libs or it needs to
+ truly requires it (i.e., it needs to
reference files in <makevar>X11BASE</makevar>).</para>
<para>The variable <makevar>PREFIX</makevar> can be reassigned in your
@@ -6710,6 +8838,65 @@ as .putsy.conf and edit it.</programlisting>
<literal>-DPAGER=\"/usr/local/bin/less\"</literal>. This way it will
have a better chance of working if the system administrator has
moved the whole <filename>/usr/local</filename> tree somewhere else.</para>
+
+ <para>Note that <makevar>LOCALBASE</makevar>,
+ <makevar>LINUXBASE</makevar>, <makevar>X11BASE</makevar>,
+ <makevar>DOCSDIR</makevar>, <makevar>EXAMPLESDIR</makevar>,
+ <makevar>DATADIR</makevar>, <makevar>DESKTOPDIR</makevar> variables
+ already contain <makevar>DESTDIR</makevar>. Using
+ <makevar>DESTDIR</makevar>&nbsp;<makevar>LOCALBASE</makevar> is
+ wrong. Use <makevar>LOCALBASE_REL</makevar>,
+ <makevar>LINUXBASE_REL</makevar>, <makevar>X11BASE_REL</makevar>
+ if you need a variable relative to <makevar>DESTDIR</makevar>.
+ To keep things terse, <makevar>TARGETDIR</makevar> can be used to
+ replace <makevar>DESTDIR</makevar>&nbsp;<makevar>PREFIX</makevar>.</para>
+
+ <para>Example of correct usage:</para>
+
+ <programlisting>post-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/helper ${TARGETDIR}/bin/helper
+ ${INSTALL_DATA} ${WRKSRC}/guide.txt ${DOCSDIR}</programlisting>
+
+ <para>When referencing dependencies in the port, the
+ <makevar>LOCALBASE</makevar> is used, as we are working with
+ dependencies inside the target environment. For hardcoding file
+ paths in the software, <makevar>LOCALBASE_REL</makevar> must
+ be used, because the software will run inside the target
+ environment.</para>
+
+ <para>Example of correct usage:</para>
+
+ <programlisting>RUN_DEPENDS= ${LOCALBASE}/share/gonzo/launch.dat:${PORTSDIR}/games/gonzo
+
+post-patch:
+ @${REINPLACE_CMD} -e 's|/usr/gonzo/launch.dat|${LOCALBASE_REL}/share/gonzo/launch.dat}' ${WRKSRC}/main.c
+ @${REINPLACE_CMD} -e 's|/etc/game.conf|${PREFIX}/etc/game.conf|' ${WRKSRC}/loader.c
+
+post-install:
+ @${INSTALL_DATA} ${WRKSRC}/example/conf ${TARGETDIR}/etc/game.conf</programlisting>
+
+ <para>In packing lists and in <filename>pkg-*</filename> scripts,
+ <literal>%%LOCALBASE%%</literal>, <literal>%%LINUXBASE%%</literal>
+ and <literal>%%X11BASE%%</literal> expansions will contain paths
+ stripped of <makevar>DESTDIR</makevar>, as all these files are
+ processed of a context of target environment.</para>
+ </sect1>
+
+ <sect1 id="testing-tinderbox">
+ <title>Tinderbox</title>
+
+ <para>If you're an avid ports contributor, you might want to take a
+ look at <application>Tinderbox</application>. It is a powerful
+ system for building and testing ports based on the scripts used on
+ <link linkend="build-cluster">Pointyhat</link>. You can install
+ <application>Tinderbox</application> using
+ <filename role="package">ports-mgmt/tinderbox</filename> port. Be sure
+ to read supplied documentation since the configuration is not
+ trivial.</para>
+
+ <para>Visit the <ulink url="http://tinderbox.marcuscom.com/">Tinderbox website</ulink>
+ for more details.</para>
+
</sect1>
</chapter>
@@ -6783,19 +8970,17 @@ as .putsy.conf and edit it.</programlisting>
maintainer. &os; has over 2000 ports without maintainers,
and this is an area where more volunteers are always needed.
(For a detailed description of the responsibilities of maintainers,
- refer to the
+ refer to the section in the
<ulink url="&url.books.developers-handbook;/policies.html#POLICIES-MAINTAINER">
- MAINTAINER on Makefiles</ulink> section.)</para>
-
- <para> The best way to
- send us the diff is by including it via &man.send-pr.1; (category
- <literal>ports</literal>). If you are volunteering to maintain the
- port,
- be sure to put <literal>[maintainer update]</literal> at the beginning
- of your synopsis line and set the <quote>Class</quote> of your PR
- to <literal>maintainer-update</literal>. Otherwise, the
- <quote>Class</quote> of your PR should be
- <literal>change-request</literal>. Please mention any added or
+ Developer's Handbook</ulink>.)</para>
+
+ <para>最好的方式是使用 &man.send-pr.1; 並附上 diff 一併回報(類別請選
+ <literal>ports</literal>)。 若你是該 port 的維護者,請記得在 synopsis
+ 那行的開頭註明 <literal>[maintainer update]</literal>,並且在 PR 的
+ <quote>Class</quote> 分類填上 <literal>maintainer-update</literal>。
+ 否則,該 PR 的 <quote>Class</quote> 處就是填
+ <literal>change-request</literal>。
+ Please mention any added or
deleted files in the message, as they have to be explicitly specified
to &man.cvs.1; when doing a commit. If the diff is more than about 20KB,
please compress and uuencode it; otherwise, just include it in the PR
@@ -7045,8 +9230,9 @@ as .putsy.conf and edit it.</programlisting>
this entry (in quotes). You should generate a UUID
for each new VuXML entry (and do not forget to substitute
it for the template UUID unless you are writing the
- entry from scratch). You can use &man.uuidgen.1; in
- FreeBSD 5.x, or you may install the port <filename
+ entry from scratch). You can use &man.uuidgen.1; to
+ generate a VuXML UUID; alternatively, if you are using
+ FreeBSD 4.x, you may install the port <filename
role="package">devel/p5-Data-UUID</filename> and issue
the following command:</para>
@@ -7242,8 +9428,8 @@ as .putsy.conf and edit it.</programlisting>
that has been fixed in version <literal>0.65_7</literal>.</para>
<para>As a prerequisite, you need to install fresh versions of the
- ports <filename role="package">security/portaudit</filename> and
- <filename role="package">security/portaudit-db</filename>.</para>
+ ports <filename role="package">ports-mgmt/portaudit</filename> and
+ <filename role="package">ports-mgmt/portaudit-db</filename>.</para>
<para>First, check whether there already is an entry for this
vulnerability. If there were such entry, it would match the
@@ -7334,65 +9520,6 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
doing.</para>
</sect1>
- <sect1 id="dads-strip">
- <title>Stripping Binaries</title>
-
- <para>Do not strip binaries manually unless you have to. All binaries
- should be stripped, but the <maketarget>INSTALL_PROGRAM</maketarget>
- macro will install and strip a binary at the same time (see the next
- section).</para>
-
- <para>If you need to strip a file, but do not wish to use the
- <makevar>INSTALL_PROGRAM</makevar> macro,
- <makevar>${STRIP_CMD}</makevar> will strip your program. This is
- typically done within the <literal>post-install</literal>
- target. For example:</para>
-
- <programlisting>post-install:
- ${STRIP_CMD} ${PREFIX}/bin/xdl</programlisting>
-
- <para>Use the &man.file.1; command on the installed executable to
- check whether the binary is stripped or not. If it does not say
- <literal>not stripped</literal>, it is stripped. Additionally,
- &man.strip.1; will not strip a previously stripped program; it
- will instead exit cleanly.</para>
- </sect1>
-
- <sect1 id="dads-install">
- <title>INSTALL_* macros</title>
-
- <para>Do use the macros provided in <filename>bsd.port.mk</filename>
- to ensure correct modes and ownership of files in your own
- <maketarget>*-install</maketarget> targets.</para>
-
- <itemizedlist>
- <listitem>
- <para><makevar>INSTALL_PROGRAM</makevar> is a command to install
- binary executables.</para>
- </listitem>
-
- <listitem>
- <para><makevar>INSTALL_SCRIPT</makevar> is a command to install
- executable scripts.</para>
- </listitem>
-
- <listitem>
- <para><makevar>INSTALL_DATA</makevar> is a command to install
- sharable data.</para>
- </listitem>
-
- <listitem>
- <para><makevar>INSTALL_MAN</makevar> is a command to install
- manpages and other documentation (it does not compress
- anything).</para>
- </listitem>
- </itemizedlist>
-
- <para>These are basically the <command>install</command> command with
- all the appropriate flags. See below for an example on how to use
- them.</para>
- </sect1>
-
<sect1 id="porting-wrkdir">
<title><makevar>WRKDIR</makevar></title>
@@ -8155,6 +10282,12 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
</row>
<row>
+ <entry>4.11-STABLE after adding libdata/ldconfig directories
+ to mtree files.</entry>
+ <entry>492101</entry>
+ </row>
+
+ <row>
<entry>5.0-CURRENT</entry>
<entry>500000</entry>
</row>
@@ -8813,6 +10946,14 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
<entry>504105</entry>
</row>
<row>
+ <entry>5.5-RELEASE.</entry>
+ <entry>505000</entry>
+ </row>
+ <row>
+ <entry>5.5-STABLE after branching for RELENG_5_5</entry>
+ <entry>505100</entry>
+ </row>
+ <row>
<entry>6.0-CURRENT</entry>
<entry>600000</entry>
</row>
@@ -8978,7 +11119,7 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
</row>
<row>
<entry>6.0-STABLE after credential argument is added to
- dev_clone vent handler. 6.0-RELEASE.</entry>
+ dev_clone event handler. 6.0-RELEASE.</entry>
<entry>600034</entry>
</row>
<row>
@@ -9032,6 +11173,81 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
<entry>601103</entry>
</row>
<row>
+ <entry>6.1-STABLE after DSO (dynamic shared
+ objects) support has been enabled in
+ OpenSSL.</entry>
+ <entry>601104</entry>
+ </row>
+ <row>
+ <entry>6.1-STABLE after 802.11 fixups changed the
+ api for the IEEE80211_IOC_STA_INFO ioctl.</entry>
+ <entry>601104</entry>
+ </row>
+ <row>
+ <entry>6.2-RELEASE</entry>
+ <entry>602000</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after 6.2-RELEASE.</entry>
+ <entry>602100</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after the addition of Wi-Spy
+ quirk.</entry>
+ <entry>602101</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after pci_find_extcap() addition.</entry>
+ <entry>602102</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of dlsym change to look
+ for a requested symbol both
+ in specified dso and its implicit dependencies.</entry>
+ <entry>602103</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of ng_deflate(4) and
+ ng_pred1(4) netgraph nodes and new compression and
+ encryption modes for ng_ppp(4) node.</entry>
+ <entry>602104</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of BSD licensed version of &man.gzip.1;
+ ported from NetBSD.</entry>
+ <entry>602105</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of PCI MSI and MSI-X
+ support.</entry>
+ <entry>602106</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of ncurses 5.6 and wide
+ character support.</entry>
+ <entry>602107</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of CAM 'SG' peripheral device,
+ which implements a subset of Linux SCSI SG passthrough device API.</entry>
+ <entry>602108</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of readline 5.2 patchset 002.</entry>
+ <entry>602109</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of pmap_invalidate_cache(),
+ pmap_change_attr(), pmap_mapbios(), pmap_mapdev_attr(),
+ and pmap_unmapbios() for amd64 and i386.</entry>
+ <entry>602110</entry>
+ </row>
+ <row>
+ <entry>6.2-STABLE after MFC of BOP_BDFLUSH and caused breakage
+ of the filesystem modules KBI.</entry>
+ <entry>602111</entry>
+ </row>
+ <row>
<entry>7.0-CURRENT.</entry>
<entry>700000</entry>
</row>
@@ -9043,7 +11259,7 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
</row>
<row>
<entry>7.0-CURRENT after credential argument is added to
- dev_clone vent handler.</entry>
+ dev_clone event handler.</entry>
<entry>700002</entry>
</row>
<row>
@@ -9052,7 +11268,7 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
</row>
<row>
<entry>7.0-CURRENT after solisten(9) kernel arguments
- are modified to accept a backlog paramater.</entry>
+ are modified to accept a backlog parameter.</entry>
<entry>700004</entry>
</row>
<row>
@@ -9088,23 +11304,23 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
<entry>700010</entry>
</row>
<row>
- <entry>7-0.CURRENT after tv_sec was made time_t on
+ <entry>7.0-CURRENT after tv_sec was made time_t on
all platforms but Alpha.</entry>
<entry>700011</entry>
</row>
<row>
- <entry>7-0.CURRENT after ldconfig_local_dirs change.</entry>
+ <entry>7.0-CURRENT after ldconfig_local_dirs change.</entry>
<entry>700012</entry>
</row>
<row>
- <entry>7-0.CURRENT after changes to
+ <entry>7.0-CURRENT after changes to
<filename>/etc/rc.d/abi</filename> to support
<filename>/compat/linux/etc/ld.so.cache</filename>
being a symlink in a readonly filesystem.</entry>
<entry>700013</entry>
</row>
<row>
- <entry>7-0.CURRENT after pts import.</entry>
+ <entry>7.0-CURRENT after pts import.</entry>
<entry>700014</entry>
</row>
<row>
@@ -9125,6 +11341,188 @@ Reference: &lt;http://www.freebsd.org/ports/portaudit/74a9541d-5d6c-11d8-80e3-00
<entry>7.0-CURRENT after import of snd_emu10kx.</entry>
<entry>700018</entry>
</row>
+ <row>
+ <entry>7.0-CURRENT after import of OpenSSL 0.9.8b.</entry>
+ <entry>700019</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after addition of bus_dma_get_tag
+ function</entry>
+ <entry>700020</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after libpcap 0.9.4 and
+ tcpdump 3.9.4 import.</entry>
+ <entry>700021</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after dlsym change to look
+ for a requested symbol both
+ in specified dso and its implicit dependencies.</entry>
+ <entry>700022</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after adding new sound IOCTLs.</entry>
+ <entry>700023</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after import of OpenSSL 0.9.8d.</entry>
+ <entry>700024</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the addition of libelf.</entry>
+ <entry>700025</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after major changes on sound
+ sysctls.</entry>
+ <entry>700026</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the addition of Wi-Spy
+ quirk.</entry>
+ <entry>700027</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the addition of sctp calls to libc
+ </entry>
+ <entry>700028</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the GNU &man.gzip.1; implementation was
+ replaced with a BSD licensed version ported from NetBSD.</entry>
+ <entry>700029</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the removal of IPIP tunnel encapsulation (VIFF_TUNNEL) from the IPv4 multicast forwarding code.
+ </entry>
+ <entry>700030</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the modification of bus_setup_intr() (newbus).
+ </entry>
+ <entry>700031</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the inclusion of ipw(4) and iwi(4) firmwares.
+ </entry>
+ <entry>700032</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the inclusion of ncurses wide character support.
+ </entry>
+ <entry>700033</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after changes to how insmntque(),
+ getnewvnode(), and vfs_hash_insert() work.
+ </entry>
+ <entry>700034</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after addition of a notify mechanism
+ for CPU frequency changes.
+ </entry>
+ <entry>700035</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after import of the ZFS filesystem.</entry>
+ <entry>700036</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after addition of CAM 'SG' peripheral device,
+ which implements a subset of Linux SCSI SG passthrough device API.</entry>
+ <entry>700037</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after changing &man.getenv.3;, &man.putenv.3;,
+ &man.setenv.3; and &man.unsetenv.3; to be POSIX
+ conformant.</entry>
+ <entry>700038</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the changes in 700038 were
+ backed out.</entry>
+ <entry>700039</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the addition of &man.flopen.3;
+ to libutil.</entry>
+ <entry>700040</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after enabling symbol versioning, and changing
+ the default thread library to libthr.</entry>
+ <entry>700041</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after the import of gcc 4.2.0.</entry>
+ <entry>700042</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after bump of all shared library
+ versions that had not been changed since
+ RELENG_6.</entry>
+ <entry>700043</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after changing the argument for
+ vn_open()/VOP_OPEN() from filedescriptor index to the
+ struct file *.</entry>
+ <entry>700044</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after changing &man.pam.nologin.8; to
+ provide an account management function instead of an
+ authentication function to the PAM framework.</entry>
+ <entry>700045</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after updated 802.11 wireless
+ support.</entry>
+ <entry>700046</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after adding TCP LRO interface
+ capabilities.</entry>
+ <entry>700047</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after
+ RFC 3678 API support added to the IPv4 stack.
+ Legacy RFC 1724 behaviour of the IP_MULTICAST_IF
+ ioctl has now been removed; 0.0.0.0/8 may no longer
+ be used to specify an interface index.
+ struct ipmreqn should be used instead.</entry>
+ <entry>700048</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after importing pf from OpenBSD
+ 4.1</entry>
+ <entry>700049</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after adding IPv6 support for
+ FAST_IPSEC, deleting KAME IPSEC, and renaming
+ FAST_IPSEC to IPSEC.</entry>
+ <entry>(not changed)</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after converting setenv/putenv/etc.
+ calls from traditional BSD to POSIX.</entry>
+ <entry>700050</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after adding new mmap/lseek/etc
+ syscalls.</entry>
+ <entry>700051</entry>
+ </row>
+ <row>
+ <entry>7.0-CURRENT after moving I4B headers to
+ include/i4b.</entry>
+ <entry>700052</entry>
+ </row>
+
</tbody>
</tgroup>
</table>
@@ -9269,125 +11667,6 @@ post-install:
<!-- smiley -->:-).</para>
</sect1>
- <sect1 id="dads-documentation">
- <title>Install additional documentation</title>
-
- <para>If your software has some documentation other than the standard
- man and info pages that you think is useful for the user, install it
- under <filename><makevar>PREFIX</makevar>/share/doc</filename>.
- This can be done, like the previous item, in the
- <maketarget>post-install</maketarget> target.</para>
-
- <para>Create a new directory for your port. The directory name should
- reflect what the port is. This usually means
- <makevar>PORTNAME</makevar>. However, if you
- think the user might want different versions of the port to be
- installed at the same time, you can use the whole
- <makevar>PKGNAME</makevar>.</para>
-
- <para>Make the installation dependent on the variable
- <makevar>NOPORTDOCS</makevar> so that users can disable it in
- <filename>/etc/make.conf</filename>, like this:</para>
-
- <programlisting>post-install:
-.if !defined(NOPORTDOCS)
- ${MKDIR} ${DOCSDIR}
- ${INSTALL_MAN} ${WRKSRC}/docs/xvdocs.ps ${DOCSDIR}
-.endif</programlisting>
-
- <para>Here are some handy variables and how they are expanded
- by default when used
- in the <filename>Makefile</filename>:</para>
-
- <itemizedlist>
- <listitem>
- <para><makevar>DATADIR</makevar> gets expanded to
- <filename><makevar>PREFIX</makevar>/share/<makevar>PORTNAME</makevar></filename>.</para>
- </listitem>
-
- <listitem>
- <para><makevar>DOCSDIR</makevar> gets expanded to
- <filename><makevar>PREFIX</makevar>/share/doc/<makevar>PORTNAME</makevar></filename>.</para>
- </listitem>
-
- <listitem>
- <para><makevar>EXAMPLESDIR</makevar> gets expanded to
- <filename><makevar>PREFIX</makevar>/share/examples/<makevar>PORTNAME</makevar></filename>.</para>
- </listitem>
- </itemizedlist>
-
- <para>These variables are exported to <makevar>PLIST_SUB</makevar>.
- Their values will appear there as pathnames relative to
- <filename><makevar>PREFIX</makevar></filename> if possible.
- That is, <filename>share/doc/<makevar>PORTNAME</makevar></filename>
- will be substituted for <literal>%%DOCSDIR%%</literal>
- in the packing list by default, and so on.
- (See more on <filename>pkg-plist</filename> substitution
- <link linkend="plist-sub">here</link>.)</para>
-
- <para>All documentation files and directories installed should
- be included in <filename>pkg-plist</filename> with the
- <literal>%%PORTDOCS%%</literal> prefix, for example:</para>
-
- <programlisting>%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
-%%PORTDOCS%%%%DOCSDIR%%/CONTACT
-%%PORTDOCS%%@dirrm %%DOCSDIR%%</programlisting>
-
- <para>As an alternative to enumerating the documentation files
- in <filename>pkg-plist</filename>, a port can set the variable
- <makevar>PORTDOCS</makevar> to a list of file names and shell
- glob patterns to add to the final packing list.
- The names will be relative to <makevar>DOCSDIR</makevar>.
- Therefore, a port that utilizes <makevar>PORTDOCS</makevar> and
- uses a non-default location for its documentation should set
- <makevar>DOCSDIR</makevar> accordingly.
- If a directory is listed in <makevar>PORTDOCS</makevar>
- or matched by a glob pattern from this variable,
- the entire subtree of contained files and directories will be
- registered in the final packing list. If <makevar>NOPORTDOCS</makevar>
- is defined then files and directories listed in
- <makevar>PORTDOCS</makevar> would not be installed and neither
- would be added to port packing list.
- Installing the documentation at <makevar>PORTDOCS</makevar>
- as shown above remains up to the port itself.
- A typical example of utilizing <makevar>PORTDOCS</makevar>
- looks as follows:</para>
-
- <programlisting>PORTDOCS= README.* ChangeLog docs/*</programlisting>
-
- <note>
- <para>You can also use the <filename>pkg-message</filename> file to
- display messages upon installation. See <link
- linkend="porting-message">the section on using
- <filename>pkg-message</filename></link> for details.
- The <filename>pkg-message</filename> file does not need to be
- added to <filename>pkg-plist</filename>.</para>
- </note>
- </sect1>
-
- <sect1 id="dads-subdirs">
- <title>Subdirectories</title>
-
- <para>Try to let the port put things in the right subdirectories of
- <makevar>PREFIX</makevar>. Some ports lump everything and put it in
- the subdirectory with the port's name, which is incorrect. Also,
- many ports put everything except binaries, header files and manual
- pages in the a subdirectory of <filename>lib</filename>, which does
- not work well with the BSD paradigm. Many of the files should be
- moved to one of the following: <filename>etc</filename>
- (setup/configuration files), <filename>libexec</filename>
- (executables started internally), <filename>sbin</filename>
- (executables for superusers/managers), <filename>info</filename>
- (documentation for info browser) or <filename>share</filename>
- (architecture independent files). See &man.hier.7; for details;
- the rules governing
- <filename>/usr</filename> pretty much apply to
- <filename>/usr/local</filename> too. The exception are ports
- dealing with USENET <quote>news</quote>. They may use
- <filename><makevar>PREFIX</makevar>/news</filename> as a destination
- for their files.</para>
- </sect1>
-
<sect1 id="dads-sh-exec">
<title>在 wrapper scripts 中使用 <function>exec</function> 述句</title>
@@ -9405,184 +11684,32 @@ exec %%LOCALBASE%%/bin/java -jar %%DATADIR%%/foo.jar "$@"</programlisting>
</sect1>
<sect1 id="dads-uid-and-gids">
- <title>UIDs and GIDs</title>
+ <title>UIDs 及 GIDs</title>
+
+ <para>The current list of reserved UIDs and GIDs can be found
+ in <filename>ports/UIDs</filename> and
+ <filename>ports/GIDs</filename>.</para>
<para>If your port requires a certain user to be on the installed
system, let the <filename>pkg-install</filename> script call
<command>pw</command> to create it automatically. Look at
- <filename role="package">net/cvsup-mirror</filename> for an example.</para>
+ <filename role="package">net/cvsup-mirror</filename> for an example.
+ Please note that this is strongly discouraged, please register
+ user/group ID numbers as stated below.</para>
<para>If your port must use the same user/group ID number when it is
installed as a binary package as when it was compiled, then you must
- choose a free UID from 50 to 999 and register it below. Look at
+ choose a free UID from 50 to 999 and register it either in
+ <filename>ports/UIDs</filename> (for users) or in
+ <filename>ports/GIDs</filename> (for groups). Look at
<filename role="package">japanese/Wnn6</filename> for an example.</para>
<para>Make sure you do not use a UID already used by the system or
other ports.</para>
- <para>This is the current list of UIDs between 50 and 999.</para>
-
- <!-- Please keep this list sorted by uid -->
- <programlisting>bind:*:53:53:Bind Sandbox:/:/sbin/nologin
-majordom:*:54:54:Majordomo Pseudo User:/usr/local/majordomo:/nonexistent
-rdfdb:*:55:55:rdfDB Daemon:/var/db/rdfdb:/bin/sh
-spamd:*:58:58:SpamAssassin user:/var/spool/spamd:/sbin/nologin
-cyrus:*:60:60:the cyrus mail server:/nonexistent:/nonexistent
-gnats:*:61:1:GNATS database owner:/usr/local/share/gnats/gnats-db:/bin/sh
-proxy:*:62:62:Packet Filter pseudo-user:/nonexistent:/nonexistent
-uucp:*:66:66:UUCP pseudo-user:/var/spool/uucppublic:/usr/libexec/uucp/uucico
-xten:*:67:67:X-10 daemon:/usr/local/xten:/nonexistent
-pop:*:68:6:Post Office Owner (popper):/nonexistent:/sbin/nologin
-wnn:*:69:7:Wnn:/nonexistent:/nonexistent
-pgsql:*:70:70:PostgreSQL pseudo-user:/usr/local/pgsql:/bin/sh
-oracle:*:71:71::0:0:Oracle:/usr/local/oracle7:/sbin/nologin
-ircd:*:72:72:IRC daemon:/nonexistent:/nonexistent
-ircservices:*:73:73:IRC services:/nonexistent:/nonexistent
-simscan:*:74:74:Simscan User:/nonexistent:/sbin/nologin
-ifmail:*:75:66:Ifmail user:/nonexistent:/nonexistent
-www:*:80:80:World Wide Web Owner:/nonexistent:/sbin/nologin
-alias:*:81:81:QMail user:/var/qmail/alias:/nonexistent
-qmaild:*:82:81:QMail user:/var/qmail:/nonexistent
-qmaill:*:83:81:QMail user:/var/qmail:/nonexistent
-qmailp:*:84:81:QMail user:/var/qmail:/nonexistent
-qmailq:*:85:82:QMail user:/var/qmail:/nonexistent
-qmailr:*:86:82:QMail user:/var/qmail:/nonexistent
-qmails:*:87:82:QMail user:/var/qmail:/nonexistent
-mysql:*:88:88:MySQL Daemon:/var/db/mysql:/sbin/nologin
-vpopmail:*:89:89:VPop Mail User:/usr/local/vpopmail:/nonexistent
-firebird:*:90:90:Firebird Database Administrator:/usr/local/firebird:/bin/sh
-mailman:*:91:91:Mailman User:/usr/local/mailman:/sbin/nologin
-gdm:*:92:92:GDM Sandbox:/:/sbin/nologin
-jabber:*:93:93:Jabber Daemon:/nonexistent:/nonexistent
-p4admin:*:94:94:Perforce admin:/usr/local/perforce:/sbin/nologin
-interch:*:95:95:Interchange user:/usr/local/interchange:/sbin/nologin
-squeuer:*:96:96:SQueuer Owner:/nonexistent:/bin/sh
-mud:*:97:97:MUD Owner:/nonexistent:/bin/sh
-msql:*:98:98:mSQL-2 pseudo-user:/var/db/msqldb:/bin/sh
-rscsi:*:99:99:Remote SCSI:/usr/local/rscsi:/usr/local/sbin/rscsi
-squid:*:100:100:squid caching-proxy pseudo user:/usr/local/squid:/sbin/nologin
-quagga:*:101:101:Quagga route daemon pseudo user:/usr/local/etc/quagga:/sbin/nologin
-ganglia:*:102:102:Ganglia User:/nonexistent:/sbin/nologin
-sgeadmin:*:103:103:Sun Grid Engine Admin:/nonexistent:/sbin/nologin
-slimserv:*:104:104:Slim Devices SlimServer pseudo-user:/nonexistent:/sbin/nologin
-dnetc:*:105:105:distributed.net client and proxy pseudo-user:/nonexistent:/sbin/nologin
-clamav:*:106:106:Clamav Antivirus:/nonexistent:/sbin/nologin
-cacti:*:107:107:Cacti Sandbox:/nonexistent:/sbin/nologin
-webkit:*:108:108:WebKit Default User:/usr/local/www/webkit:/bin/sh
-quickml:*:109:109:quickml Server:/nonexistent:/sbin/nologin
-vscan:*:110:110:Scanning Virus Account:/var/amavis:/bin/sh
-fido:*:111:111:Fido System:/usr/local/fido:/bin/sh
-dcc:*:112:112:Distributed Checksum Clearinghouse:/nonexistent:/sbin/nologin
-amavis:*:113:113:Amavis-stats Account:/nonexistent:/sbin/nologin
-dhis:*:114:114:DHIS Daemon:/nonexistent:/sbin/nologin
-_symon:*:115:115:Symon Account:/var/empty:/sbin/nologin
-postfix:*:125:125:Postfix Mail System:/var/spool/postfix:/sbin/nologin
-rbldns:*:153:153:rbldnsd pseudo-user:/nonexistent:/sbin/nologin
-sfs:*:171:171:Self-Certifying File System:/nonexistent:/sbin/nologin
-agk:*:172:172:AquaGateKeeper:/nonexistent:/nonexistent
-polipo:*:173:173:polipo web cache:/nonexistent:/sbin/nologin
-bogomilter:*:174:174:milter-bogom:/nonexistent:/sbin/nologin
-moinmoin:*:192:192:MoinMoin User:/nonexistent:/sbin/nologin
-sympa:*:200:200:Sympa Owner:/nonexistent:/sbin/nologin
-privoxy:*:201:201:Privoxy proxy user:/nonexistent:/sbin/nologin
-dspam:*:202:202:Dspam:/nonexistent:/sbin/nologin
-shoutcast:*:210:210:Shoutcast sandbox:/nonexistent:/bin/sh
-_tor:*:256:256:Tor anonymising router:/var/db/tor:/bin/sh
-smxs:*:260:260:Sendmail X SMTPS:/nonexistent:/sbin/nologin
-smxq:*:261:261:Sendmail X QMGR:/nonexistent:/sbin/nologin
-smxc:*:262:262:Sendmail X SMTPC:/nonexistent:/sbin/nologin
-smxm:*:263:263:Sendmail X misc:/nonexistent:/sbin/nologin
-smx:*:264:264:Sendmail X other:/nonexistent:/sbin/nologin
-ldap:*:389:389:OpenLDAP Server:/nonexistent:/sbin/nologin
-drweb:*:426:426:Dr.Web Mail Scanner:/nonexistent:/sbin/nologin
-courier:*:465:465:Courier Mail Server:/nonexistent:/sbin/nologin
-_bbstored:*:505:505::0:0:BoxBackup Store Daemon:/nonexistent:/bin/sh
-qtss:*:554:554:Darwin Streaming Server:/nonexistent:/sbin/nologin
-ircdru:*:555:555:Russian hybrid IRC server:/nonexistent:/bin/sh
-messagebus:*:556:556:D-BUS Daemon User:/nonexistent:/sbin/nologin
-avahi:*:558:558:Avahi Daemon User:/nonexistent:/sbin/nologin
-bnetd:*:700:700:Bnetd user:/nonexistent:/sbin/nologin
-bopm:*:717:717:Blitzed Open Proxy Monitor:/nonexistent:/bin/sh
-bacula:*:910:910:Bacula Daemon:/var/db/bacula:/sbin/nologin</programlisting>
-
- <para>This is the current list of reserved GIDs.</para>
-
- <!-- Please keep this list sorted by gid -->
- <!-- XXX incomplete! -->
- <programlisting>bind:*:53:
-rdfdb:*:55:
-spamd:*:58:
-cyrus:*:60:
-proxy:*:62:
-authpf:*:63:
-uucp:*:66:
-xten:*:67:
-dialer:*:68:
-network:*:69:
-pgsql:*:70:
-simscan:*:74:
-www:*:80:
-qnofiles:*:81:
-qmail:*:82:
-mysql:*:88:
-vpopmail:*:89:
-firebird:*:90:
-mailman:*:91:
-gdm:*:92:
-jabber:*:93:
-p4admin:*:94:
-interch:*:95:
-squeuer:*:96:
-mud:*:97:
-msql:*:98:
-rscsi:*:99:
-squid:*:100:
-quagga:*:101:
-ganglia:*:102:
-sgeadmin:*:103:
-slimserv:*:104:
-dnetc:*:105:
-clamav:*:106:
-cacti:*:107:
-webkit:*:108:
-quickml:*:109:
-vscan:*:110:
-fido:*:111:
-dcc:*:112:
-amavis:*:113:
-dhis:*:114:
-_symon:*:115:
-postfix:*:125:
-maildrop:*:126:
-rbldns:*:153:
-sfs:*:171:
-agk:*:172:
-polipo:*:173:
-moinmoin:*:192:
-sympa:*:200:
-dspam:*:202:
-_tor:*:256:
-smxs:*:260:
-smxq:*:261:
-smxc:*:262:
-smxm:*:263:
-smx:*:264:
-ldap:*:389:
-drweb:*:426:
-courier:*:465:
-_bbstored:*:505:
-qtss:*:554:
-ircdru:*:555:
-messagebus:*:556:
-realtime:*:557:
-avahi:*:558:
-bnetd:*:700:
-bopm:*:717:
-bacula:*:910:</programlisting>
-
- <para>Please include a notice when you submit a port (or an upgrade)
- that reserves a new UID or GID in this range. This allows us to
- keep the list of reserved IDs up to date.</para>
+ <para>Please include a patch against these two files when you
+ require a new user or group to be created for your
+ port.</para>
</sect1>
<sect1 id="dads-rational">
@@ -9705,6 +11832,17 @@ bacula:*:910:</programlisting>
different values, so do not just hardcode
<literal>-pthread</literal> into patches and always use
<makevar>PTHREAD_LIBS</makevar>.</para>
+
+ <note>
+ <para>If building the port errors out with <literal>unrecognized
+ option '-pthread'</literal> when setting
+ <makevar>PTHREAD_LIBS</makevar>, it may be desirable to use
+ <command>gcc</command> as linker by setting
+ <makevar>CONFIGURE_ENV</makevar> to <literal>LD=${CC}</literal>.
+ The <literal>-pthread</literal> option is not supported by
+ <command>ld</command> directly.</para>
+ </note>
+
</sect1>
<sect1 id="dads-freedback">
@@ -9751,7 +11889,7 @@ bacula:*:910:</programlisting>
<listitem>
<para><makevar>BROKEN</makevar> is reserved for ports that
currently do not compile, install, or deinstall correctly.
- It should be used for ports where the the problem is
+ It should be used for ports where the problem is
believed to be temporary.</para>
<para>If instructed, the build cluster will still attempt to
@@ -9759,7 +11897,7 @@ bacula:*:910:</programlisting>
them to see if the underlying problem has been
resolved. (However, in general, the cluster is run without
this.)</para>
-
+
<para>For instance, use
<makevar>BROKEN</makevar> when a port:</para>
@@ -9810,7 +11948,7 @@ bacula:*:910:</programlisting>
<listitem>
<para><makevar>IGNORE</makevar> is reserved for ports that
should not be built for some other reason.
- It should be used for ports where the the problem is
+ It should be used for ports where the problem is
believed to be structural.
The build
cluster will not, under any
@@ -9858,7 +11996,7 @@ bacula:*:910:</programlisting>
</listitem>
<listitem>
- <para>If a port sould be marked <makevar>IGNORE</makevar>
+ <para>If a port should be marked <makevar>IGNORE</makevar>
only on certain architectures, there are two other
convenience variables that will automatically set
<makevar>IGNORE</makevar> for you:
@@ -9868,6 +12006,25 @@ bacula:*:910:</programlisting>
<programlisting>ONLY_FOR_ARCHS= i386 amd64</programlisting>
<programlisting>NOT_FOR_ARCHS= alpha ia64 sparc64</programlisting>
+
+ <para>A custom <makevar>IGNORE</makevar> message can be set
+ using <makevar>ONLY_FOR_ARCHS_REASON</makevar> and
+ <makevar>NOT_FOR_ARCHS_REASON</makevar>. Per architecture
+ entries are possible with
+ <makevar>ONLY_FOR_ARCHS_REASON_<replaceable>ARCH</replaceable></makevar>
+ and
+ <makevar>NOT_FOR_ARCHS_REASON_<replaceable>ARCH</replaceable></makevar>.
+ </listitem>
+
+ <listitem>
+ <para>If a port fetches i386 binaries and installs them,
+ <makevar>IA32_BINARY_PORT</makevar> should be set. If this
+ variable is set, it will be checked whether the
+ <filename>/usr/lib32</filename> directory is available for
+ IA32 versions of libraries and whether the kernel
+ has IA32 compatibility compiled in. If one of these two
+ dependencies is not satisfied, <makevar>IGNORE</makevar> will
+ be set automatically.</para>
</listitem>
</itemizedlist>
@@ -9935,7 +12092,7 @@ bacula:*:910:</programlisting>
<para>It is a common mistake to use <literal>.error</literal>
for this purpose. The problem with this is that many
automated tools that work with the ports tree will fail in
- this situation. The most common occurence of this is seen
+ this situation. The most common occurrence of this is seen
when trying to build <filename>/usr/ports/INDEX</filename>
(see <xref linkend="make-describe">). However, even more
trivial commands such as <command>make -V maintainer</command>
@@ -9968,10 +12125,30 @@ IGNORE=POINTYHAT is not supported
<command>make index</command> 的過程中就會需要用到
<filename>sysctl</filename>。</para>
- <para>在 <filename>sysctl</filename> 的使用上,一定要用完整的路徑,
- 也就是以 <filename>/sbin/</filename> 開頭,因為有些使用者也許沒有
- 將 <filename>/sbin/</filename> 放置在他們的環境變數
- <envar>PATH</envar> 中。</para>
+ <para>若要使用 &man.sysctl.8; 則必須透過 <makevar>SYSCTL</makevar>
+ 此一變數才可,因為這樣才會包含完整路徑,
+ 同時也可以隨時因應使用者需求而替換為其他路徑。</para>
+ </sect1>
+
+ <sect1 id="dads-rerolling-distfiles">
+ <title>Rerolling distfiles</title>
+
+ <para>Sometimes the authors of software change the content of
+ released distfiles without changing the file's name. You have
+ to verify that the changes are official and have been performed
+ by the author. It has happened in the past that the distfile
+ was silently altered on the download servers with the intent
+ to cause harm or compromise end user security.</para>
+
+ <para>Put the old distfile aside, download the new one, unpack
+ them and compare the content with &man.diff.1;. If you see
+ nothing suspicious, you can update <filename>distinfo</filename>.
+ Be sure to summarize the differences in your PR or commit log,
+ so that other people know that you have taken care to ensure
+ that nothing bad has happened.</para>
+
+ <para>You might also want to contact the authors of the software
+ and confirm the changes with them.</para>
</sect1>
<sect1 id="dads-workarounds">