# 4.3.修改 port

在一个私有目录中解压 tarball 的副本，并进行必要的修改，以确保该 Port 可以在当前版本的 FreeBSD 下正确编译。要**仔细记录**每个步骤，因为稍后将需要将这些步骤自动化。当 Port 完成时，所有操作，包括文件的删除、添加或修改，都必须可以通过自动化脚本或补丁文件来完成。

如果 Port 需要大量的用户交互或定制来编译或安装，可以参考 Larry Wall 的经典 Configure 脚本，可能需要做一些类似的工作。新的 Ports 的目标是使每个 Port 尽可能“即插即用”，同时占用最小的磁盘空间。

> **注意**
>
> 除非明确说明，所有为 FreeBSD Ports 创建和第三方软件的补丁文件、脚本及其他文件，都假设遵守标准的 BSD 版权条件。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://porters-handbook.bsdcn.org/di-4-zhang-fu-za-de-port/4.3.-xiu-gai-port.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
